Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

AtomParser.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr                                                                       
00003  *cr            (C) Copyright 1995-2008 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.20 $       $Date: 2008/03/27 19:36:34 $
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 "utilities.h"
00025 #include "JString.h"
00026 
00027 // the idea about strings is that some can be regexed.
00028 //  "This" is a double-quoted string  -- can do regex
00029 //  'this' is a single-quoted string  -- don't do regex
00030 //   this  is a raw, or unquoted, string -- don't do regex
00031 enum  atomparser_stringtype {DQ_STRING, SQ_STRING, RAW_STRING};
00032 
00034 typedef struct atomparser_string {
00035   atomparser_stringtype st;
00036   JString s;
00037 } atomparser_string;
00038 
00041 typedef struct atomparser_node {
00042    int node_type;   // this is an 'AND', 'WITHIN', ...
00043    int extra_type;  // for weird things like distinguishing
00044                     // 'index 5 to 7' from 'index 5 7'
00045    double dval;
00046    int ival;
00047    atomparser_string sele;  // if this is a string, what kind of string?
00048    atomparser_node *left, *right;
00049    atomparser_node(int nnode_t, int nextra_t = -1) {  // constructor
00050       node_type = nnode_t;
00051       extra_type = nextra_t;
00052       left = NULL;
00053       right = NULL;
00054    }
00055    ~atomparser_node(void) {  // destructor
00056       if (left) delete left;
00057       if (right) delete right;
00058    }
00059 } atomparser_node;
00060 
00062 extern atomparser_node *atomparser_result;
00063 
00066 int atomparser_yylookup(const char *s, int len);
00067 
00069 extern char *atomparser_yystring;
00070 
00072 extern class SymbolTable *atomparser_symbols;
00073 
00074 #endif
00075 

Generated on Sun Jul 6 01:27:17 2008 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002