22 #ifndef __CCL_PARSE_TREE_H__
23 # define __CCL_PARSE_TREE_H__
void ccl_parse_tree_delete_node(ccl_parse_tree *t)
Deletes the node t.
Possible values that can decorate a node.
ccl_parse_tree * ccl_parse_tree_create(int type, const char *type_string, ccl_parse_tree_value_type vtype, int line, const char *filename, ccl_parse_tree *child, ccl_parse_tree *next, ccl_parse_tree *container)
Creates a new node.
enum ccl_parse_tree_value_type_enum ccl_parse_tree_value_type
Enum that indicates the kind of data that decorates a node.
int ccl_parse_tree_count_siblings(ccl_parse_tree *t)
Returns the number of siblings of the node t.
An integer value stored in the int_value field of a ccl_parse_tree_value.
ccl_parse_tree * ccl_parse_tree_duplicate(ccl_parse_tree *t, ccl_parse_tree **cont)
Duplicate the tree t.
const char * filename
Name of the "file" from which this tree has been read. This field can indicates something else than a...
ccl_ustring id_value
A unique string (not deletable)
int line
Line of the "file" where this tree starts.
No data is attached to the node.
A string value stored in the string_value field of a ccl_parse_tree_value.
ccl_parse_tree * next_in_container
Pointer to the next node the global storage list. This list is used to collect all nodes created duri...
Structure encoding of a parse-tree node.
ccl_parse_tree_value value
A value that decorates this. This value is taken from the union ccl_parse_tree_value according to the...
ccl_parse_tree_value_type_enum
Enum that indicates the kind of data that decorates a node.
int int_value
An integer value.
A floating-point value stored in the flt_value field of a ccl_parse_tree_value.
int node_type
An integer indicating the kind of the node e.g. the name of the non-terminal that generates the sub-t...
Some useful and common macros.
ccl_parse_tree * ccl_parse_tree_reverse_siblings(ccl_parse_tree *t)
Reverses the list of siblings starting at the node t.
Module gathering routines frequently used for the manipulation of string.
char * ccl_ustring
Alias type for strings that are stored in an internal dictionary and then can be used as identifiers ...
const char * node_type_string
A human-readable string of the node_type field. Mainly for debugging purposes.
ccl_parse_tree * child
Pointer to the first child of the node (NULL for leaves).
void ccl_parse_tree_delete_tree(ccl_parse_tree *t)
Deletes the tree t and its siblings.
ccl_parse_tree * next
Pointer to the next sibling of the node in the sibling list of the parent node.
char * string_value
An allocated string that must be freed when the tree is deleted.
void ccl_parse_tree_delete_container(ccl_parse_tree *t)
Deletes the nodes in the list t.
double flt_value
A floating point value.
An indentifier value stored in the id_value field of a ccl_parse_tree_value.
ccl_parse_tree_value_type value_type
Field indicating what type of data is stored into the value field.