00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2011 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * RCS INFORMATION: 00011 * 00012 * $RCSfile: AtomParser.h,v $ 00013 * $Author: johns $ $Locker: $ $State: Exp $ 00014 * $Revision: 1.25 $ $Date: 2012/02/01 22:42:51 $ 00015 * 00016 *************************************************************************** 00017 * DESCRIPTION: 00018 * Basic data types for the yacc/lex interface and for the parse tree 00019 * 00020 ***************************************************************************/ 00021 #ifndef ATOMPARSER_H 00022 #define ATOMPARSER_H 00023 00024 #include "JString.h" 00025 00026 // the idea about strings is that some can be regexed. 00027 // "This" is a double-quoted string -- can do regex 00028 // 'this' is a single-quoted string -- don't do regex 00029 // this is a raw, or unquoted, string -- don't do regex 00030 enum atomparser_stringtype {DQ_STRING, SQ_STRING, RAW_STRING}; 00031 00033 typedef struct atomparser_string { 00034 atomparser_stringtype st; 00035 JString s; 00036 } atomparser_string; 00037 00039 typedef struct atomparser_node { 00040 int node_type; 00041 00042 int extra_type; 00043 00044 double dval; 00045 int ival; 00046 atomparser_string sele; 00047 atomparser_node *left; 00048 atomparser_node *right; 00049 00051 atomparser_node(int nnode_t, int nextra_t = -1) { 00052 node_type = nnode_t; 00053 extra_type = nextra_t; 00054 left = NULL; 00055 right = NULL; 00056 } 00057 00062 ~atomparser_node(void) { // destructor 00063 if (left) 00064 delete left; 00065 left=NULL; 00066 00067 if (right) 00068 delete right; 00069 right=NULL; 00070 } 00071 } atomparser_node; 00072 00074 extern atomparser_node *atomparser_result; 00075 00078 int atomparser_yylookup(const char *s, int len); 00079 00081 extern char *atomparser_yystring; 00082 00084 extern class SymbolTable *atomparser_symbols; 00085 00086 #endif 00087
1.2.14 written by Dimitri van Heesch,
© 1997-2002