"eof" is no longer a write command.
[external/ragel.git] / ragel / parsetree.h
index 84fa9e0..54a8671 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Adrian Thurston <thurston@cs.queensu.ca>
+ *  Copyright 2001-2006 Adrian Thurston <thurston@complang.org>
  */
 
 /*  This file is part of Ragel.
@@ -181,17 +181,30 @@ struct ParserAction
        Action *action;
 };
 
+struct ConditionTest
+{
+       ConditionTest( const InputLoc &loc, AugType type, Action *action, bool sense ) : 
+               loc(loc), type(type), action(action), sense(sense) { }
+
+       InputLoc loc;
+       AugType type;
+       Action *action;
+       bool sense;
+};
+
 struct Token
 {
        char *data;
        int length;
        InputLoc loc;
 
-       void prepareLitString( Token &result, bool &caseInsensitive );
        void append( const Token &other );
-       void set( char *str, int len );
+       void set( const char *str, int len );
 };
 
+char *prepareLitString( const InputLoc &loc, const char *src, long length, 
+                       long &resLen, bool &caseInsensitive );
+
 /* Store the value and type of a priority augmentation. */
 struct PriorityAug
 {
@@ -208,19 +221,17 @@ struct PriorityAug
  */
 struct VarDef
 {
-       VarDef( char *name, JoinOrLm *joinOrLm )
-               : name(name), joinOrLm(joinOrLm) { }
+       VarDef( const char *name, JoinOrLm *joinOrLm )
+               : name(name), joinOrLm(joinOrLm), isExport(false) { }
        
        /* Parse tree traversal. */
        FsmAp *walk( ParseData *pd );
        void makeNameTree( const InputLoc &loc, ParseData *pd );
        void resolveNameRefs( ParseData *pd );
 
-       char *name;
+       const char *name;
        JoinOrLm *joinOrLm;
-
        bool isExport;
-       bool isEntry;
 };
 
 
@@ -289,8 +300,9 @@ struct LongestMatch
        FsmAp *walk( ParseData *pd );
        void makeNameTree( ParseData *pd );
        void resolveNameRefs( ParseData *pd );
-       void runLonestMatch( ParseData *pd, FsmAp *graph );
-       Action *newAction( ParseData *pd, const InputLoc &loc, char *name, 
+       void transferScannerLeavingActions( FsmAp *graph );
+       void runLongestMatch( ParseData *pd, FsmAp *graph );
+       Action *newAction( ParseData *pd, const InputLoc &loc, const char *name, 
                        InlineList *inlineList );
        void makeActions( ParseData *pd );
        void findName( ParseData *pd );
@@ -298,7 +310,7 @@ struct LongestMatch
 
        InputLoc loc;
        LmPartList *longestMatchList;
-       char *name;
+       const char *name;
 
        Action *lmActSelect;
        bool lmSwitchHandlesError;
@@ -318,9 +330,9 @@ struct JoinOrLm
        };
 
        JoinOrLm( Join *join ) : 
-               join(join), type(JoinType) {}
+               join(join), longestMatch(0), type(JoinType) {}
        JoinOrLm( LongestMatch *longestMatch ) :
-               longestMatch(longestMatch), type(LongestMatchType) {}
+               join(0), longestMatch(longestMatch), type(LongestMatchType) {}
 
        FsmAp *walk( ParseData *pd );
        void makeNameTree( ParseData *pd );
@@ -456,7 +468,7 @@ struct FactorWithAug
        PriorDesc *priorDescs;
        Vector<Label> labels;
        Vector<EpsilonLink> epsilonLinks;
-       Vector<ParserAction> conditions;
+       Vector<ConditionTest> conditions;
 
        FactorWithRep *factorWithRep;
 };