![]()
|
TOP --> CcDoc
C++ parse tree node. It is a list of string rep ids.
|
| type | The node type. |
| parent | The parent node. |
| lineno | The current line number. |
public CCcDocParserNode ( STMT_TYPE type ,
CCcDocParserNode * parent ,
long lineno ,
const char * token ) ;
Construct a root node with a single token.
| type | The node type. |
| parent | The parent node. |
| lineno | The current line number. |
| token | The token. |
public CCcDocParserNode ( STMT_TYPE type ,
CCcDocParserNode * parent ,
long lineno ,
CJdlStringList & tokens ) ;
Construct a root node with a list of tokens.
| type | The node type. |
| parent | The parent node. |
| lineno | The current line number. |
| tokens | The list of tokens. |
public CCcDocParserNode ( CCcDocParserNode * parent ,
SCOPE_TYPE scope ,
STMT_TYPE type ,
ulong lineno ,
ulong level ,
ulong offset ,
ulong nameid ,
ulong recid ) ;
Construct a node from the CTF file. This assumes that the node has already been compiled.
| parent | The parent node. |
| scope | The node scope. |
| type | The node type. |
| lineno | The file lineno. |
| level | The node nesting level. |
| offset | The node offset from the parent list. |
| nameid | The node name reference. |
| recid | The node record id. |
public CCcDocParserNode ( CCcDocParserNode * parent ,
uint idx ,
const CCcDocParserNode * obj ) ;
Insert before copy constructor.
| parent | The parent node. |
| idx | The index to insert before. |
| obj | The object to copy from. |
public ~ CCcDocParserNode ( ) ;
Destructor.
public enum STMT_TYPE { STMT_ASM ,
STMT_CLASS ,
STMT_CLASS_CONSTRUCTOR ,
STMT_CLASS_DESTRUCTOR ,
STMT_CLASS_FORWARD ,
STMT_COMMENT_BRIEF ,
STMT_COMMENT_FULL ,
STMT_COMMENT_DIRECTIVE ,
STMT_COMMENT_DIRECTIVE_PKG ,
STMT_COMMENT_DIRECTIVE_PKGDOC ,
STMT_ENUM ,
STMT_FILE ,
STMT_FRIEND_CLASS ,
STMT_FRIEND_FUNCTION ,
STMT_FUNCTION ,
STMT_INCLUDE ,
STMT_MACRO ,
STMT_MACRO_INST ,
STMT_NAMESPACE ,
STMT_NAMESPACE_ALIAS ,
STMT_PRAGMA ,
STMT_SCOPE_PRIVATE ,
STMT_SCOPE_PROTECTED ,
STMT_SCOPE_PUBLIC ,
STMT_SCOPED_FUNCTION ,
STMT_SCOPED_TEMPLATE_FUNCTION ,
STMT_STRUCT ,
STMT_STRUCT_FORWARD ,
STMT_TEMPLATE_CLASS ,
STMT_TEMPLATE_FORWARD ,
STMT_TEMPLATE_FUNCTION ,
STMT_TYPEDEF ,
STMT_UNION ,
STMT_USING ,
STMT_VARIABLE ,
STMT_UNKNOWN } ;
The node statement type.
public enum SCOPE_TYPE { SCOPE_GLOBAL ,
SCOPE_LOCAL ,
SCOPE_PUBLIC ,
SCOPE_PRIVATE ,
SCOPE_PROTECTED ,
SCOPE_UNKNOWN } ;
The node scope.
public enum DATA_TYPE { DATA_ID ,
DATA_KEYWORD ,
DATA_RESERVED ,
DATA_UNKNOWN } ;
The node type.
public CCcDocParserNode * GetFirst ( ) ;
Get the first child node.
public CCcDocParserNode * GetNext ( ) ;
Get the next child node.
public CCcDocParserNode * GetChild ( ulong i ) const ;
Get the i-th child node.
| i | The node index. |
public ulong GetNumChildren ( ) const ;
Get the number of child nodes.
public STMT_TYPE GetType ( ) const ;
Get the node type.
public static STMT_TYPE GetType ( const char * ) ;
Get the node type by name.
| The | short (3 char) type name. |
public const char * GetTypeName ( ) const ;
Get the 3 character internal type name suitable for parsing from the ctf file.
public static const char * GetTypeName ( STMT_TYPE type ) ;
Get the 3 character internal type name suitable for parsing from the ctf file.
public const char * GetLongTypeName ( ) const ;
Get the long type name, suitable for displaying in the package index.
public static const char * GetLongTypeName ( STMT_TYPE type ) ;
Get the long type name, suitable for displaying in the package index.
| type | The type. |
public SCOPE_TYPE GetScope ( ) const ;
Get the node scope.
public static SCOPE_TYPE GetScope ( const char * name ) ;
Get the node scope by name.
| The | short (3 char) scope name. |
public const char * GetScopeName ( ) const ;
Get the 3 character internal scope name suitable for parsing from the ctf file.
public static const char * GetScopeName ( SCOPE_TYPE scope ) ;
Get the 3 character internal scope name suitable for parsing from the ctf file.
public const char * GetLongScopeName ( ) const ;
Get the long scope name, suitable for displaying in the package index.
public static const char * GetLongScopeName ( SCOPE_TYPE scope ) ;
Get the long scope name, suitable for displaying in the package index.
| scope | The scope. |
public static DATA_TYPE GetDataType ( const char * name ) ;
Get the string data type. This is useful for determining whether this string is a candidate for cross referencing.
| name | The string. |
public DATA_TYPE GetDataType ( ulong idx ) const ;
Get the string data type of the i-th token. This is useful for determining whether this string is a candidate for cross referencing.
| idx | The index of the i-th token. The maximum number of tokens is GetNumItems(). |
public const char * GetDataString ( ulong idx ) const ;
Get the token string of the i-th token.
| idx | The index of the i-th token. The maximum number of tokens is GetNumItems(). |
public void Compile ( uint level = 0 ,
uint offset = 0 ,
SCOPE_TYPE scope = SCOPE_UNKNOWN ) ;
Compile a node tree. This should only be called for the root node.
| level | The current level. |
| offset | The current offset in the parent list. |
| scope | The default scope state. |
public void Dump ( FILE * fp = stdout ,
const char * prefix = 0 ,
bool recurseFlag = true ) ;
Dump the contents of the node tree to a specified file.
| fp | The output file. |
| prefix | The desired prefix. |
| recurseFlag | If true, recurse otherwise only print this node and it's children. |
public void Walk ( void ( * fct ) ( CCcDocParserNode * node , void * arg ) , void * arg ) ;
Walk the tree recursively and call the specified function with the current node.
| fct | The callback function. |
| arg | A user supplied argument. |
public ulong GetChildIdx ( ) const ;
Get the child offset from the parent.
public ulong GetRecId ( ) const ;
Get the record id.
public ulong GetLevel ( ) const ;
Get the nesting level.
public ulong GetOffset ( ) const ;
Get the offset in the parent's child list.
public ulong GetLineno ( ) const ;
Get the line number in the source file.
public const char * GetFileName ( ) const ;
Get the source file name.
public ulong GetNameId ( ) const ;
Get the name handle.
public const char * GetName ( ) const ;
Get the node name as a string.
public CCcDocParserNode * GetParent ( ) const ;
Get the nodes parent. The root of the tree will have a NULL parent.
public const char * GetString ( ulong i ) const ;
Get the i-th token string. Use GetNumItems() to determine the total number of tokens.
Token strings are stored in a non-duplicated form using CCcDocStringRep which means that handles are required to convert them to strings. This was done to save memory.
| i | The i-th token. |
public void Append ( ulong idx ) ;
Append a new handle to the token list.
| idx | The token handle. |
public void Append ( const char * str ) ;
Append a new string to the token list. The string is converted to a handle inside the append.
| str | The token. |
public void Set ( ulong idx ,
const char * str ) ;
Set the i-th token to the specified string.
| idx | The index. |
| str | The new string. |
public void Set ( ulong idx ,
ulong id ) ;
Set the i-th token to the specified string handle.
| idx | The index. |
| str | The new string handle. |
public void Copy ( const CJdlStringList & list ) ;
Copy a token list. Each token is converted to its associated handle.
| list | The new token list. |
public void Copy ( const CJdlVector < ulong > & list ) ;
Copy a token handle list.
| list | The new token list. |
public void SetRecId ( ulong i ) ;
Set the unique record id. This should only be called by the CTF processing.
| i | The new id. |
public void SetChildIdx ( ulong i ) ;
Set the child index. This is normally set in the constructor. It only needs to be changed when records are inserted into the parent child list.
| i | The new idx. |
This documentation was generated automatically by the ccdoc tool (version 0.7a).
Click here to submit a bug report or feature request.
Click here to return to the top of the page.