public class RuleDoc extends TreeDoc
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
m_action |
private int |
m_id |
private boolean |
m_internal |
private LexerDoc |
m_lexer |
private int |
m_lineNumber |
private java.util.LinkedList<PatternDoc> |
m_patterns |
private java.util.HashSet<LexerStateDoc> |
m_states |
private static int |
s_count |
Modifier and Type | Method and Description |
---|---|
void |
addPattern(PatternDoc pattern) |
void |
addStates(java.lang.String states)
Add a comma separated list of states that this pattern applies to.
|
static RuleDoc |
createInternalRule(LexerDoc lexer)
There are two internal rules:
<<EOF>>
for dealing with unexpected end of the file and
.|\n
that covers all characters.
|
java.lang.String |
getAction() |
int |
getId()
The order of the rule is important, so it is necessary to have a sequential id
that determines the order of the rules.
|
boolean |
getInternal() |
int |
getLineNumber()
Obtain the line number information of the pattern.
|
PatternDoc[] |
getPatterns() |
LexerStateDoc[] |
getStates() |
void |
setAction(java.lang.String action) |
private void |
setInternal() |
void |
setLineNumber(int lineNumber) |
getProperty, setProperty
private static int s_count
private final LexerDoc m_lexer
private final int m_id
private int m_lineNumber
private final java.util.LinkedList<PatternDoc> m_patterns
private java.lang.String m_action
private java.util.HashSet<LexerStateDoc> m_states
private boolean m_internal
public RuleDoc(LexerDoc lexer)
public static RuleDoc createInternalRule(LexerDoc lexer)
lexer
- the parent LexerDocpublic int getId()
public int getLineNumber()
public void setLineNumber(int lineNumber)
public void addPattern(PatternDoc pattern)
public PatternDoc[] getPatterns()
public void setAction(java.lang.String action)
public java.lang.String getAction()
public void addStates(java.lang.String states)
states
- a comma separated list of statespublic LexerStateDoc[] getStates()
public boolean getInternal()
private void setInternal()