parsetree.h (ragel-7.0.0.11) | : | parsetree.h (ragel-7.0.0.12) | ||
---|---|---|---|---|
skipping to change at line 300 | skipping to change at line 300 | |||
InputLoc getLoc(); | InputLoc getLoc(); | |||
Join *join; | Join *join; | |||
Action *action; | Action *action; | |||
InputLoc semiLoc; | InputLoc semiLoc; | |||
Action *setActId; | Action *setActId; | |||
Action *actOnLast; | Action *actOnLast; | |||
Action *actOnNext; | Action *actOnNext; | |||
Action *actLagBehind; | Action *actLagBehind; | |||
Action *actNfaOnLast; | ||||
Action *actNfaOnNext; | ||||
Action *actNfaOnEof; | ||||
int longestMatchId; | int longestMatchId; | |||
bool inLmSelect; | bool inLmSelect; | |||
LongestMatch *longestMatch; | LongestMatch *longestMatch; | |||
LongestMatchPart *prev, *next; | LongestMatchPart *prev, *next; | |||
}; | }; | |||
/* Declare a new type so that ptreetypes.h need not include dlist.h. */ | /* Declare a new type so that ptreetypes.h need not include dlist.h. */ | |||
struct LmPartList : DList<LongestMatchPart> {}; | struct LmPartList : DList<LongestMatchPart> {}; | |||
struct LongestMatch | struct LongestMatch | |||
{ | { | |||
/* Construct with a list of joins */ | /* Construct with a list of joins */ | |||
LongestMatch( const InputLoc &loc, LmPartList *longestMatchList ) : | LongestMatch( const InputLoc &loc, LmPartList *longestMatchList ) | |||
loc(loc), longestMatchList(longestMatchList), | : | |||
lmSwitchHandlesError(false) { } | loc(loc), | |||
longestMatchList(longestMatchList), | ||||
lmSwitchHandlesError(false), | ||||
nfaConstruction(false) | ||||
{ } | ||||
InputLoc loc; | ||||
LmPartList *longestMatchList; | ||||
std::string name; | ||||
Action *lmActSelect; | ||||
bool lmSwitchHandlesError; | ||||
bool nfaConstruction; | ||||
LongestMatch *next, *prev; | ||||
/* Tree traversal. */ | /* Tree traversal. */ | |||
FsmRes walkClassic( ParseData *pd ); | ||||
FsmRes walk( ParseData *pd ); | FsmRes walk( ParseData *pd ); | |||
FsmRes mergeNfaStates( ParseData *pd, FsmAp *fsm ); | ||||
bool onlyOneNfa( ParseData *pd, FsmAp *fsm, StateAp *st, NfaTrans *in ); | ||||
bool matchCanFail( ParseData *pd, FsmAp *fsm, StateAp *st ); | ||||
void eliminateNfaActions( ParseData *pd, FsmAp *fsm ); | ||||
void advanceNfaActions( ParseData *pd, FsmAp *fsm ); | ||||
FsmRes buildBaseNfa( ParseData *pd ); | ||||
FsmRes walkNfa( ParseData *pd ); | ||||
void makeNameTree( ParseData *pd ); | void makeNameTree( ParseData *pd ); | |||
void resolveNameRefs( ParseData *pd ); | void resolveNameRefs( ParseData *pd ); | |||
void transferScannerLeavingActions( FsmAp *graph ); | void transferScannerLeavingActions( FsmAp *graph ); | |||
void runLongestMatch( ParseData *pd, FsmAp *graph ); | void runLongestMatch( ParseData *pd, FsmAp *graph ); | |||
Action *newLmAction( ParseData *pd, const InputLoc &loc, const char *name , | Action *newLmAction( ParseData *pd, const InputLoc &loc, const char *name , | |||
InlineList *inlineList ); | InlineList *inlineList ); | |||
void makeActions( ParseData *pd ); | void makeActions( ParseData *pd ); | |||
void findName( ParseData *pd ); | void findName( ParseData *pd ); | |||
void restart( FsmAp *graph, TransAp *trans ); | void restart( FsmAp *graph, TransAp *trans ); | |||
void restart( FsmAp *graph, CondAp *cond ); | ||||
InputLoc loc; | ||||
LmPartList *longestMatchList; | ||||
std::string name; | ||||
Action *lmActSelect; | ||||
bool lmSwitchHandlesError; | ||||
LongestMatch *next, *prev; | ||||
}; | }; | |||
/* List of Expressions. */ | /* List of Expressions. */ | |||
typedef DList<Expression> ExprList; | typedef DList<Expression> ExprList; | |||
struct MachineDef | struct MachineDef | |||
{ | { | |||
enum Type { | enum Type { | |||
JoinType, | JoinType, | |||
LongestMatchType, | LongestMatchType, | |||
skipping to change at line 642 | skipping to change at line 660 | |||
/* Language elements a factor node can be. */ | /* Language elements a factor node can be. */ | |||
enum Type { | enum Type { | |||
LiteralType, | LiteralType, | |||
RangeType, | RangeType, | |||
OrExprType, | OrExprType, | |||
RegExprType, | RegExprType, | |||
ReferenceType, | ReferenceType, | |||
ParenType, | ParenType, | |||
LongestMatchType, | LongestMatchType, | |||
NfaRep, | NfaRep, | |||
NfaWrap, | ||||
CondStar, | CondStar, | |||
CondPlus | CondPlus | |||
}; | }; | |||
enum NfaRepeatMode { | ||||
NfaLegacy = 1, | ||||
NfaGreedy, | ||||
NfaLazy | ||||
}; | ||||
/* Construct with a literal fsm. */ | /* Construct with a literal fsm. */ | |||
Factor( Literal *literal ) : | Factor( Literal *literal ) : | |||
literal(literal), type(LiteralType) { } | literal(literal), type(LiteralType) { } | |||
/* Construct with a range. */ | /* Construct with a range. */ | |||
Factor( Range *range ) : | Factor( Range *range ) : | |||
range(range), type(RangeType) { } | range(range), type(RangeType) { } | |||
/* Construct with the or part of a regular expression. */ | /* Construct with the or part of a regular expression. */ | |||
Factor( ReItem *reItem ) : | Factor( ReItem *reItem ) : | |||
skipping to change at line 710 | skipping to change at line 735 | |||
int lower, upper; | int lower, upper; | |||
long repId; | long repId; | |||
Expression *expression; | Expression *expression; | |||
Action *action1; | Action *action1; | |||
Action *action2; | Action *action2; | |||
Action *action3; | Action *action3; | |||
Action *action4; | Action *action4; | |||
Action *action5; | Action *action5; | |||
Action *action6; | Action *action6; | |||
PriorDesc priorDescs[4]; | PriorDesc priorDescs[4]; | |||
NfaRepeatMode mode; | ||||
Type type; | Type type; | |||
}; | }; | |||
/* A range machine. Only ever composed of two literals. */ | /* A range machine. Only ever composed of two literals. */ | |||
struct Range | struct Range | |||
{ | { | |||
Range( Literal *lowerLit, Literal *upperLit, bool caseIndep ) | Range( Literal *lowerLit, Literal *upperLit, bool caseIndep ) | |||
: lowerLit(lowerLit), upperLit(upperLit), caseIndep(caseIndep) { } | : lowerLit(lowerLit), upperLit(upperLit), caseIndep(caseIndep) { } | |||
End of changes. 8 change blocks. | ||||
12 lines changed or deleted | 38 lines changed or added |