/*
- * Copyright 2001-2006 Adrian Thurston <thurston@cs.queensu.ca>
+ * Copyright 2001-2006 Adrian Thurston <thurston@complang.org>
*/
/* This file is part of Ragel.
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
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
{
*/
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 );
void resolveNameRefs( ParseData *pd );
const char *name;
- JoinOrLm *joinOrLm;
+ MachineDef *machineDef;
bool isExport;
};
/* 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 );
Join *join;
LongestMatch *longestMatch;
+ LengthDef *lengthDef;
Type type;
};
* ptreetypes, which should be just typedef forwards. */
struct InlineList : public DList<InlineItem> { };
-
-
-#endif /* _PARSETREE_H */
+#endif