Sample Namespace Implementation: oaNative to oaWinNS
The following example shows the flow when converting a scalar name string
from the oaNative namespace to a name
string in the Windows name space (oaWinNS).
This flow uses the getType()
function to implement the name type and the
get() function to implement the
name strings.
- Implement the code that checks the name type. Because the Windows namespace
only supports scalar names, throw an exception for all other name types.
- Once you have a valid name type, implement code that determines if the
name string is an escaped keyword.
- If the name string is a keyword in oaWinNS and it is escaped, the name
string is valid in oaWinNS and the processing of this name is complete.
- If the name string is a keyword in oaWinNS and it is not escaped,
oaNative throws an exception.
- If a name string is not a keyword, check each character in the name to
determine if it is a valid character in the oaWinNS namespace. Character
validation follows the flow shown in the figure below. Because bus characters
are not allowed in the Windows namespace, oaNative throws an exception if an
oaNative bus character is found in the name string. Case sensitivity is
considered when validating the keywords as well as when validating each
character.
Return to Deriving Namespaces
Copyright © 2001-2010 Cadence Design Systems, Inc.
All rights reserved.