home *** CD-ROM | disk | FTP | other *** search
- /**
- GRAB Graph Layout and Browser System
-
- Copyright (c) 1989, Tera Computer Company
- **/
-
- /* header for parsing predicates */
-
- #ifndef pparse_h
- #define pparse_h
-
- #include "attribute.h"
- #include "token.h"
-
- typedef struct ptree PTREE;
-
- typedef struct ptree /* parse tree */
- {
- TOKEN token; /* indicator of what it is */
- char *val; /* string for a value */
- int lineno; /* line number where this token appeared */
- PTREE *left; /* left child */
- PTREE *right; /* right child */
- };
-
- /* shorthand for otherwise tedious checks that must be done */
- #define ck \
- if (error) return NULL;
-
- #define ck_match(t) \
- if (!match_token(t, TRUE, TRUE)) return NULL;
-
- /* some might call these first and follow sets... */
- #define command_list_ender(t) \
- ((t) == ELSIF_TOKEN || (t) == ELSE_TOKEN || (t) == ENDIF_TOKEN || \
- (t) == EOF_TOKEN)
-
- #define node_starter(t) \
- ((t) == STRING_TOKEN || (t) == IN_TOKEN || (t) == OUT_TOKEN || \
- (t) == PARENTS_TOKEN || (t) == CHILDREN_TOKEN || (t) == SOURCE_TOKEN || \
- (t) == SINK_TOKEN || (t) == ANCESTORS_TOKEN || (t) == DESCENDANTS_TOKEN)
-
- #define attr_starter(t) \
- ((t) == STRING_TOKEN || (t) == DISPLAYED_TOKEN || \
- (t) == COALESCER_TOKEN || (t) == BRUSH_TOKEN || (t) == COLOR_TOKEN || \
- (t) == SHAPE_TOKEN || (t) == NODE_TOKEN || (t) == EDGE_TOKEN)
-
- #endif
-