public class StructuredParser extends ConfigurableParser
The class can either be used by subclassing and setting the configuration of the parser in the constructor or by creating a StructuredParser object and calling its configuration methods.
public class StandardStructuredParser extends StructuredParser {
public StandardStructuredParser() {
super();
this.addHashComments();
...
ExpressionRule expr = new ExpressionRule();
StatementRule statement = new StatementRule();
SequenceRule seq = new SequenceRule(statement);
....
setStructuredRules(seq,expr);
}
}
or
StructuredParser parser = new StructuredParser(); parser.addHashComments(); ... ExpressionRule expr = new ExpressionRule(); StatementRule statement = new StatementRule(); SequenceRule seq = new SequenceRule(statement); .... parser.setStructuredRules(seq,expr);
| Constructor and Description |
|---|
StructuredParser() |
| Modifier and Type | Method and Description |
|---|---|
GrammaticalRuleI |
getStructuredRules() |
void |
setStructuredRules(GrammaticalRuleI head)
Should be called at the end of the configuration, sets up the StructuredGrammerParser.
|
addArrayAccessMatcher, addBracketMatcher, addDoubleQuoteStrings, addExponentNumbers, addFunctionMatcher, addGrammarMatcher, addHashComments, addIdentifiers, addListMatcher, addListOrBracketMatcher, addOperatorTokenMatcher, addSemiColonTerminator, addSimpleNumbers, addSingleQuoteStrings, addSlashComments, addSymbols, addTokenFilter, addTokenMatcher, addWhiteSpace, addWhiteSpaceCommentFilter, continueParse, filter, getGrammarMatchers, getGrammarParserFactory, getJep, getLightWeightInstance, getOperatorTokenMatcher, getSymbolToken, getSymbolTokenMatcher, getTokenFilters, getTokenizerFactory, getTokenMatchers, init, parse, parse, restart, scan, scan, setGrammarParserFactory, setImplicitMultiplicationSymbols, setTokenizerFactorypublic void setStructuredRules(GrammaticalRuleI head)
head - root of parsing rulespublic GrammaticalRuleI getStructuredRules()
Copyright © 2018 Singular Systems http://www.singularsys.com/jep