public class SAXRule extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static ArrayList<GrammarRuleRecord> |
arrRuleRecords
Keeper for rules references.
|
protected int |
count
Counter keeps track of how many times the rule is used in the grammar.
|
protected int |
index
Index used for printing.
|
protected Set<Integer> |
indexes
This keeps rule indexes - once rule created or used, its placement position is extracted from
the TerminalSymbol position and stored here.
|
protected int |
level
The rule level, used to assess the hierarchy.
|
protected static AtomicInteger |
numRules
This is static - the global rule enumerator counter.
|
protected int |
ruleIndex
The rule's number.
|
protected SAXGuard |
theGuard
Guard symbol to mark beginning and end of rule.
|
protected static ArrayList<SAXRule> |
theRules
Yet another, global static structure allowing fast rule access.
|
| Constructor and Description |
|---|
SAXRule()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addIndex(int position)
Adds an index of the rule occurrence.
|
protected void |
assignLevel()
This traces the rule level.
|
SAXSymbol |
first()
Report the FIRST symbol of the rule.
|
int |
getLevel() |
ArrayList<GrammarRuleRecord> |
getRuleRecords() |
protected void |
getSAXRules()
Add-on to the original code by manfred and seninp.
|
SAXSymbol |
last()
Report the LAST symbol of the rule.
|
static String |
printRules()
Original getRules() method.
|
static void |
reset()
Cleans up data structures.
|
GrammarRules |
toGrammarRulesData() |
protected static AtomicInteger numRules
protected static final ArrayList<SAXRule> theRules
protected static ArrayList<GrammarRuleRecord> arrRuleRecords
protected SAXGuard theGuard
protected int count
protected int ruleIndex
protected int index
protected int level
public static String printRules()
public static void reset()
public SAXSymbol first()
public SAXSymbol last()
protected void assignLevel()
public int getLevel()
public ArrayList<GrammarRuleRecord> getRuleRecords()
public void addIndex(int position)
position - the rule position.protected void getSAXRules()
public GrammarRules toGrammarRulesData()
Copyright © 2021 JMotif. All rights reserved.