Package jflex
Class RegExps
- java.lang.Object
-
- jflex.RegExps
-
public class RegExps extends java.lang.ObjectStores all rules of the specification for later access in RegExp -> NFA- Version:
- JFlex 1.7.0
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<Action>actionsthe action of a regexp(package private) java.util.List<java.lang.Boolean>BOLflag if it is a BOL regexp(package private) intgen_look_countCount of many general lookahead expressions there are.(package private) java.util.List<java.lang.Integer>linesthe spec line in which a regexp is used(package private) java.util.List<RegExp>lookthe lookahead expression(package private) java.util.List<java.lang.Integer>look_entrythe forward DFA entry point of the lookahead expression(package private) java.util.List<RegExp>regExpsthe regexp(package private) java.util.List<java.util.List<java.lang.Integer>>statesthe lexical states in wich the regexp is used
-
Constructor Summary
Constructors Constructor Description RegExps()Constructor for RegExps.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStates(int regNum, java.util.List<java.lang.Integer> newStates)addStates.voidcheckActions()checkActions.voidcheckLookAheads()checkLookAheads.ActiongetAction(int num)getAction.intgetLine(int num)getLine.RegExpgetLookAhead(int num)getLookAhead.intgetLookEntry(int num)getLookEntry.intgetNum()getNum.RegExpgetRegExp(int num)getRegExp.java.util.List<java.lang.Integer>getStates(int num)Getter for the fieldstates.intinsert(int line, java.util.List<java.lang.Integer> stateList, RegExp regExp, Action action, java.lang.Boolean isBOL, RegExp lookAhead)insert.intinsert(java.util.List<java.lang.Integer> stateList, Action action)insert.booleanisBOL(int num)isBOL.booleanisEOF(int num)isEOF.private voidlookAheadCase(int regExpNum)Determine which case of lookahead expression regExpNum points to (if any).intNFASize(Macros macros)NFASize.
-
-
-
Field Detail
-
lines
java.util.List<java.lang.Integer> lines
the spec line in which a regexp is used
-
states
java.util.List<java.util.List<java.lang.Integer>> states
the lexical states in wich the regexp is used
-
regExps
java.util.List<RegExp> regExps
the regexp
-
actions
java.util.List<Action> actions
the action of a regexp
-
BOL
java.util.List<java.lang.Boolean> BOL
flag if it is a BOL regexp
-
look
java.util.List<RegExp> look
the lookahead expression
-
look_entry
java.util.List<java.lang.Integer> look_entry
the forward DFA entry point of the lookahead expression
-
gen_look_count
int gen_look_count
Count of many general lookahead expressions there are. Need 2*gen_look_count additional DFA entry points.
-
-
Method Detail
-
insert
public int insert(int line, java.util.List<java.lang.Integer> stateList, RegExp regExp, Action action, java.lang.Boolean isBOL, RegExp lookAhead)insert.
-
insert
public int insert(java.util.List<java.lang.Integer> stateList, Action action)insert.- Parameters:
stateList- aListobject.action- aActionobject.- Returns:
- a int.
-
addStates
public void addStates(int regNum, java.util.List<java.lang.Integer> newStates)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
public RegExp getLookAhead(int num)
getLookAhead.- Parameters:
num- a int.- Returns:
- a
RegExpobject.
-
isEOF
public boolean isEOF(int num)
isEOF.- Parameters:
num- a int.- Returns:
- a boolean.
-
getStates
public java.util.List<java.lang.Integer> getStates(int num)
Getter for the fieldstates.- Parameters:
num- a int.- Returns:
- a
Listobject.
-
getRegExp
public RegExp getRegExp(int num)
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
public Action getAction(int num)
getAction.- Parameters:
num- a int.- Returns:
- a
Actionobject.
-
NFASize
public int NFASize(Macros macros)
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.
-
-