fsmgraph.h (ragel-7.0.0.10) | : | fsmgraph.h (ragel-7.0.0.11) | ||
---|---|---|---|---|
/* | /* | |||
* Copyright 2001-2016 Adrian Thurston <thurston@colm.net> | * Copyright 2001-2018 Adrian Thurston <thurston@colm.net> | |||
* | * | |||
* Permission is hereby granted, free of charge, to any person obtaining a copy | * Permission is hereby granted, free of charge, to any person obtaining a copy | |||
* of this software and associated documentation files (the "Software"), to | * of this software and associated documentation files (the "Software"), to | |||
* deal in the Software without restriction, including without limitation the | * deal in the Software without restriction, including without limitation the | |||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | |||
* sell copies of the Software, and to permit persons to whom the Software is | * sell copies of the Software, and to permit persons to whom the Software is | |||
* furnished to do so, subject to the following conditions: | * furnished to do so, subject to the following conditions: | |||
* | * | |||
* The above copyright notice and this permission notice shall be included in al l | * The above copyright notice and this permission notice shall be included in al l | |||
* copies or substantial portions of the Software. | * copies or substantial portions of the Software. | |||
skipping to change at line 77 | skipping to change at line 77 | |||
struct InlineList; | struct InlineList; | |||
struct TooManyStates {}; | struct TooManyStates {}; | |||
struct PriorInteraction | struct PriorInteraction | |||
{ | { | |||
PriorInteraction( long long id ) : id(id) {} | PriorInteraction( long long id ) : id(id) {} | |||
long long id; | long long id; | |||
}; | }; | |||
struct RepetitionError {}; | ||||
struct TransDensity {}; | ||||
struct NfaRound | struct NfaRound | |||
{ | { | |||
NfaRound( long depth, long groups ) | NfaRound( long depth, long groups ) | |||
: depth(depth), groups(groups) {} | : depth(depth), groups(groups) {} | |||
long depth; | long depth; | |||
long groups; | long groups; | |||
}; | }; | |||
typedef Vector<NfaRound> NfaRoundVect; | typedef Vector<NfaRound> NfaRoundVect; | |||
skipping to change at line 1012 | skipping to change at line 1009 | |||
CondSpaceMap condSpaceMap; | CondSpaceMap condSpaceMap; | |||
~CondData() | ~CondData() | |||
{ | { | |||
condSpaceMap.empty(); | condSpaceMap.empty(); | |||
} | } | |||
}; | }; | |||
struct FsmGbl | struct FsmGbl | |||
{ | { | |||
FsmGbl() | FsmGbl( const HostLang *hostLang ) | |||
: | : | |||
printStatistics(false), | printStatistics(false), | |||
errorCount(0), | errorCount(0), | |||
//inLibRagel(false), | //inLibRagel(false), | |||
displayPrintables(false), | displayPrintables(false), | |||
//backend(Direct), | ||||
hostLang(hostLang), | ||||
stringTables(false), | stringTables(false), | |||
//backendFeature(GotoFeature), | ||||
checkPriorInteraction(0), | checkPriorInteraction(0), | |||
wantDupsRemoved(true), | wantDupsRemoved(true), | |||
minimizeLevel(MinimizePartition2), | minimizeLevel(MinimizePartition2), | |||
minimizeOpt(MinimizeMostOps) | minimizeOpt(MinimizeMostOps) | |||
{} | {} | |||
bool printStatistics; | bool printStatistics; | |||
/* | /* | |||
* Error reporting. | * Error reporting. | |||
skipping to change at line 1057 | skipping to change at line 1057 | |||
std::ostream &info(); | std::ostream &info(); | |||
std::stringstream libcerr; | std::stringstream libcerr; | |||
std::stringstream libcout; | std::stringstream libcout; | |||
int errorCount; | int errorCount; | |||
//bool inLibRagel; | //bool inLibRagel; | |||
void abortCompile( int code ); | void abortCompile( int code ); | |||
bool displayPrintables; | bool displayPrintables; | |||
//RagelBackend backend; | ||||
const HostLang *hostLang; | ||||
bool stringTables; | bool stringTables; | |||
//BackendFeature backendFeature; | ||||
bool checkPriorInteraction; | bool checkPriorInteraction; | |||
bool wantDupsRemoved; | bool wantDupsRemoved; | |||
MinimizeLevel minimizeLevel; | MinimizeLevel minimizeLevel; | |||
MinimizeOpt minimizeOpt; | MinimizeOpt minimizeOpt; | |||
}; | }; | |||
/* All FSM operations must be between machines that have been created using the | /* All FSM operations must be between machines that have been created using the | |||
* same context object. */ | * same context object. */ | |||
struct FsmCtx | struct FsmCtx | |||
skipping to change at line 1255 | skipping to change at line 1258 | |||
/* Actions to execute upon entering into a state. */ | /* Actions to execute upon entering into a state. */ | |||
ActionTable toStateActionTable; | ActionTable toStateActionTable; | |||
/* Actions to execute when going from the state to the transition. */ | /* Actions to execute when going from the state to the transition. */ | |||
ActionTable fromStateActionTable; | ActionTable fromStateActionTable; | |||
/* Actions to add to any future transitions that leave via this state. */ | /* Actions to add to any future transitions that leave via this state. */ | |||
ActionTable outActionTable; | ActionTable outActionTable; | |||
/* Conditions to add to any future transiions that leave via this sttate. */ | /* Conditions to add to any future transiions that leave via this state. */ | |||
CondSpace *outCondSpace; | CondSpace *outCondSpace; | |||
CondKeySet outCondKeys; | CondKeySet outCondKeys; | |||
/* Error action tables. */ | /* Error action tables. */ | |||
ErrActionTable errActionTable; | ErrActionTable errActionTable; | |||
/* Actions to execute on eof. */ | /* Actions to execute on eof. */ | |||
ActionTable eofActionTable; | ActionTable eofActionTable; | |||
/* Set of longest match items that may be active in this state. */ | /* Set of longest match items that may be active in this state. */ | |||
skipping to change at line 1847 | skipping to change at line 1850 | |||
Vector<BreadthCost> costs; | Vector<BreadthCost> costs; | |||
}; | }; | |||
/* Result of an operation. */ | /* Result of an operation. */ | |||
struct FsmRes | struct FsmRes | |||
{ | { | |||
struct Fsm {}; | struct Fsm {}; | |||
struct TooManyStates {}; | struct TooManyStates {}; | |||
struct PriorInteraction {}; | struct PriorInteraction {}; | |||
struct CondCostTooHigh {}; | struct CondCostTooHigh {}; | |||
struct RepetitionError {}; | ||||
struct InternalError {}; | struct InternalError {}; | |||
enum Type | enum Type | |||
{ | { | |||
TypeFsm = 1, | TypeFsm = 1, | |||
TypeTooManyStates, | TypeTooManyStates, | |||
TypePriorInteraction, | TypePriorInteraction, | |||
TypeCondCostTooHigh, | TypeCondCostTooHigh, | |||
TypeRepetitionError, | ||||
TypeInternalError, | TypeInternalError, | |||
}; | }; | |||
FsmRes( const Fsm &, FsmAp *fsm ) | FsmRes( const Fsm &, FsmAp *fsm ) | |||
: fsm(fsm), type(TypeFsm) {} | : fsm(fsm), type(TypeFsm) {} | |||
FsmRes( const TooManyStates & ) | FsmRes( const TooManyStates & ) | |||
: fsm(0), type(TypeTooManyStates) {} | : fsm(0), type(TypeTooManyStates) {} | |||
FsmRes( const PriorInteraction &, long long guardId ) | FsmRes( const PriorInteraction &, long long guardId ) | |||
: fsm(0), type(TypePriorInteraction), id(guardId) {} | : fsm(0), type(TypePriorInteraction), id(guardId) {} | |||
FsmRes( const CondCostTooHigh &, long long costId ) | FsmRes( const CondCostTooHigh &, long long costId ) | |||
: fsm(0), type(TypeCondCostTooHigh), id(costId) {} | : fsm(0), type(TypeCondCostTooHigh), id(costId) {} | |||
FsmRes( const RepetitionError & ) | ||||
: fsm(0), type(TypeRepetitionError) {} | ||||
FsmRes( const InternalError & ) | FsmRes( const InternalError & ) | |||
: fsm(0), type(TypeInternalError) {} | : fsm(0), type(TypeInternalError) {} | |||
bool success() { return fsm != 0; } | bool success() { return fsm != 0; } | |||
FsmAp *fsm; | FsmAp *fsm; | |||
Type type; | Type type; | |||
long long id; | long long id; | |||
}; | }; | |||
End of changes. 11 change blocks. | ||||
11 lines changed or deleted | 9 lines changed or added |