fold_ca.c

Retrieves constant and attribute data from a tree

Author

Marcel Sondaar

License

Public Domain

Summary
fold_ca.cRetrieves constant and attribute data from a tree
Functions
LibGFX_ConstAttrFoldwalks the tree and retrieves the currently applicable value/attribute to a simple extent

Functions

LibGFX_ConstAttrFold

int LibGFX_ConstAttrFold (AST_Node *root,
int *const_val,
int *attr_val)

walks the tree and retrieves the currently applicable value/attribute to a simple extent

in

rootthe node to start checking
const_vala pointer to an integer to receive the constant value
attr_vala pointer to an integer to receive the attribute index

out

return0 if there is no match, 1 for a constant match, 2 for an attribute match

All arguments may be NULL without impeding functionality. const_val/attr_val will only be written if non-null and the corresponding match was found.

int LibGFX_ConstAttrFold (AST_Node *root,
int *const_val,
int *attr_val)
walks the tree and retrieves the currently applicable value/attribute to a simple extent