Note that properties will not be set when they aren't applicable. For example, class types, typedefs, etc have .loc, but primitives do not.
The following properties are common to all object types.
- loc: Source location of the object
Dehydra presents AST nodes as variables. These types are used to represent variables, functions, assignments, etc. The following properties are available:
- decl: The function declaration.
- name: The function name.
- type: The a type object describing this variable
- isStatic: True if the node is static
Variables can have flags describing the context they are used in:
- .isReturn: the variable is being returned
- .isDecl: the variable is being declared
- .assign: variable is an LHS, the value of the property is an array of #Variable Objects being assigned
- .isFcall: the variable is being used as a function call.
- .arguments: refers to an array of #Variable Objectss used as arguments to make a function call
- .fieldOf: is present when the variable is being accessed through another variable (eg. foo->member). It refers to the #Variable Object of the container
Dehydra provides detailed type objects. A Dehydra type object can represent a primitive type (with .name attribute), a class type (with .name, .members attributes, etc.), a pointer type (with isPointer=true and a type attribute), a reference type (with isReference=true and a .type attribute), or a function pointer type (with .parameters attribute, etc).
Function type objects are an extension of #Variable Objects.
- methodOf: For functions, refers to #Aggregate Type of the class containing the function
- isVirtual int: Value 1 indicates a virtual function, 2 indicates a pure virtual
- isConstructor: indicates a constructor. Constructors generally have a .fieldOf attribute unless they are constructing the return value and .isReturn attribute is present.
This type object represents aggregate types in GCC.