Package jflex
Class RegExps
java.lang.Object
jflex.RegExps
Stores all rules of the specification for later access in RegExp -> NFA
- Version:
- JFlex 1.7.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionthe action of a regexpflag if it is a BOL regexp(package private) intCount of many general lookahead expressions there are.the spec line in which a regexp is usedthe lookahead expressionthe forward DFA entry point of the lookahead expressionthe regexpthe lexical states in wich the regexp is used -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStates.voidcheckActions.voidcheckLookAheads.getAction(int num) getAction.intgetLine(int num) getLine.getLookAhead(int num) getLookAhead.intgetLookEntry(int num) getLookEntry.intgetNum()getNum.getRegExp(int num) getRegExp.getStates(int num) Getter for the fieldstates.intinsert(int line, List<Integer> stateList, RegExp regExp, Action action, Boolean isBOL, RegExp lookAhead) insert.intinsert.booleanisBOL(int num) isBOL.booleanisEOF(int num) isEOF.private voidlookAheadCase(int regExpNum) Determine which case of lookahead expression regExpNum points to (if any).intNFASize.
-
Field Details
-
lines
the spec line in which a regexp is used -
states
the lexical states in wich the regexp is used -
regExps
the regexp -
actions
the action of a regexp -
BOL
flag if it is a BOL regexp -
look
the lookahead expression -
look_entry
the forward DFA entry point of the lookahead expression -
gen_look_count
int gen_look_countCount of many general lookahead expressions there are. Need 2*gen_look_count additional DFA entry points.
-
-
Constructor Details
-
RegExps
public RegExps()Constructor for RegExps.
-
-
Method Details
-
insert
public int insert(int line, List<Integer> stateList, RegExp regExp, Action action, Boolean isBOL, RegExp lookAhead) insert. -
insert
insert. -
addStates
addStates.- Parameters:
regNum- a int.newStates- aListobject.
-
getNum
public int getNum()getNum.- Returns:
- a int.
-
isBOL
public boolean isBOL(int num) isBOL.- Parameters:
num- a int.- Returns:
- a boolean.
-
getLookAhead
getLookAhead.- Parameters:
num- a int.- Returns:
- a
RegExpobject.
-
isEOF
public boolean isEOF(int num) isEOF.- Parameters:
num- a int.- Returns:
- a boolean.
-
getStates
Getter for the fieldstates.- Parameters:
num- a int.- Returns:
- a
Listobject.
-
getRegExp
getRegExp.- Parameters:
num- a int.- Returns:
- a
RegExpobject.
-
getLine
public int getLine(int num) getLine.- Parameters:
num- a int.- Returns:
- a int.
-
getLookEntry
public int getLookEntry(int num) getLookEntry.- Parameters:
num- a int.- Returns:
- a int.
-
checkActions
public void checkActions()checkActions. -
getAction
getAction.- Parameters:
num- a int.- Returns:
- a
Actionobject.
-
NFASize
NFASize.- Parameters:
macros- aMacrosobject.- Returns:
- a int.
-
checkLookAheads
public void checkLookAheads()checkLookAheads. -
lookAheadCase
private void lookAheadCase(int regExpNum) Determine which case of lookahead expression regExpNum points to (if any). Set case data in corresponding action. Increment count of general lookahead expressions for entry points of the two additional DFAs. Register DFA entry point in RegExpsNeeds to be run before adding any regexps/rules to be able to reserve the correct amount of space of lookahead DFA entry points.
- Parameters:
regExpNum- the number of the regexp in RegExps.
-