public class StructuredGrammarParser extends java.lang.Object implements java.io.Serializable, GrammarParser
Modifier and Type | Field and Description |
---|---|
protected Lookahead2Iterator<Token> |
it |
Constructor and Description |
---|
StructuredGrammarParser(GrammaticalRuleI head,
GrammarParser sy)
Construct the parser
|
Modifier and Type | Method and Description |
---|---|
Node |
parse(java.util.Iterator<Token> input)
Main entry point used by the ConfigurableParser
|
Node |
parsePrefixSuffix()
Callback function used by GrammerMatchers where the matcher expects
a simple number, variable, or function call with optional, prefix or suffix operator.
|
Node |
parseSubExpression()
Calls the parseSubExpression method of the ShuntingYard
|
void |
setIterator(Lookahead2Iterator<Token> it)
Set the iterator used by the
GrammarParser.parseSubExpression() |
protected transient Lookahead2Iterator<Token> it
public StructuredGrammarParser(GrammaticalRuleI head, GrammarParser sy)
head
- root of the rules for parsing the structured grammarsy
- base parser for expressionspublic Node parse(java.util.Iterator<Token> input) throws ParseException
GrammarParser
parse
in interface GrammarParser
input
- iterator with the list of tokensParseException
- if the input cannot be parsedpublic void setIterator(Lookahead2Iterator<Token> it)
GrammarParser
GrammarParser.parseSubExpression()
setIterator
in interface GrammarParser
it
- the iteratorpublic Node parseSubExpression() throws ParseException
parseSubExpression
in interface GrammarParser
ParseException
- if the input cannot be parsedpublic Node parsePrefixSuffix() throws ParseException
GrammarParser
parsePrefixSuffix
in interface GrammarParser
ParseException
- if the input cannot be parsedCopyright © 2018 Singular Systems http://www.singularsys.com/jep