update(add) packaging directory and spec file from OBSTF:Private, OBS
[external/ragel.git] / ragel / parsetree.h
index 7e35c34..dd38678 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.
@@ -66,11 +66,12 @@ struct FactorWithNeg;
 struct Factor;
 struct Expression;
 struct Join;
-struct JoinOrLm;
+struct MachineDef;
 struct LongestMatch;
 struct LongestMatchPart;
 struct LmPartList;
 struct Range;
+struct LengthDef;
 
 /* Type of augmentation. Describes locations in the machine. */
 enum AugType
@@ -198,11 +199,13 @@ struct Token
        int length;
        InputLoc loc;
 
-       void prepareLitString( Token &result, bool &caseInsensitive );
        void append( const Token &other );
        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
 {
@@ -219,8 +222,8 @@ struct PriorityAug
  */
 struct VarDef
 {
-       VarDef( const char *name, JoinOrLm *joinOrLm )
-               : name(name), joinOrLm(joinOrLm), isExport(false) { }
+       VarDef( const char *name, MachineDef *machineDef )
+               : name(name), machineDef(machineDef), isExport(false) { }
        
        /* Parse tree traversal. */
        FsmAp *walk( ParseData *pd );
@@ -228,7 +231,7 @@ struct VarDef
        void resolveNameRefs( ParseData *pd );
 
        const char *name;
-       JoinOrLm *joinOrLm;
+       MachineDef *machineDef;
        bool isExport;
 };
 
@@ -320,17 +323,20 @@ struct LongestMatch
 /* List of Expressions. */
 typedef DList<Expression> ExprList;
 
-struct JoinOrLm
+struct MachineDef
 {
        enum Type {
                JoinType,
-               LongestMatchType
+               LongestMatchType,
+               LengthDefType
        };
 
-       JoinOrLm( Join *join ) : 
-               join(join), type(JoinType) {}
-       JoinOrLm( LongestMatch *longestMatch ) :
-               longestMatch(longestMatch), type(LongestMatchType) {}
+       MachineDef( Join *join )
+               : join(join), longestMatch(0), lengthDef(0), type(JoinType) {}
+       MachineDef( LongestMatch *longestMatch )
+               : join(0), longestMatch(longestMatch), lengthDef(0), type(LongestMatchType) {}
+       MachineDef( LengthDef *lengthDef )
+               : join(0), longestMatch(0), lengthDef(lengthDef), type(LengthDefType) {}
 
        FsmAp *walk( ParseData *pd );
        void makeNameTree( ParseData *pd );
@@ -338,6 +344,7 @@ struct JoinOrLm
        
        Join *join;
        LongestMatch *longestMatch;
+       LengthDef *lengthDef;
        Type type;
 };
 
@@ -762,6 +769,4 @@ struct InlineItem
  * ptreetypes, which should be just typedef forwards. */
 struct InlineList : public DList<InlineItem> { };
 
-
-
-#endif /* _PARSETREE_H */
+#endif