public class ParseOperation extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
expression |
protected boolean |
infix
State flag for parsing context.
|
protected LinkedList<Object> |
outputQueue |
protected ExpressionParser |
parser |
protected Position |
pos |
protected Deque<Object> |
stack |
| Constructor and Description |
|---|
ParseOperation(ExpressionParser parser,
String expression) |
| Modifier and Type | Method and Description |
|---|---|
protected char |
currentChar() |
protected char |
futureChar(int offset) |
protected boolean |
isIdentifierPart(char c)
Determines whether the given character is allowed to start an identifier.
|
protected boolean |
isIdentifierStart(char c)
Determines whether the given character is allowed to start an identifier.
|
protected Character |
parseChar(char c)
Attempts to parse the given character.
|
protected <CS extends CharSequence> |
parseChars(CS cs)
Attempts to parse the given characters.
|
protected String |
parseElementSeparator()
Attempts to parse an element separator symbol.
|
protected Group |
parseGroupTerminator()
Attempts to parse a group terminator symbol.
|
protected int |
parseIdentifier()
Attempts to parse an identifier, as defined by
isIdentifierStart(char) and isIdentifierPart(char). |
protected Object |
parseLiteral()
Attempts to parse a literal (e.g.
|
protected Operator |
parseOperator()
Attempts to parse an operator.
|
LinkedList<Object> |
parsePostfix()
Parses the expression into an output queue in Reverse
Polish notation (i.e., postfix notation).
|
protected String |
parseStatementSeparator()
Attempts to parse a statement separator symbol.
|
protected String |
parseToken(int length)
Parses a token of the given length.
|
protected Variable |
parseVariable()
Attempts to parse a variable.
|
protected void |
parseWhitespace()
Skips past any whitespace to the next interesting character.
|
String |
toString() |
protected final ExpressionParser parser
protected final String expression
protected final Position pos
protected final LinkedList<Object> outputQueue
protected boolean infix
public ParseOperation(ExpressionParser parser, String expression)
public LinkedList<Object> parsePostfix()
protected char currentChar()
protected char futureChar(int offset)
protected void parseWhitespace()
protected Object parseLiteral()
Literals.parseLiteral(java.lang.CharSequence)protected Variable parseVariable()
protected int parseIdentifier()
isIdentifierStart(char) and isIdentifierPart(char).protected boolean isIdentifierStart(char c)
The default implementation uses
Character.isUnicodeIdentifierStart(char), but also accepts
underscores, since many popular programming languages (e.g. Python and
Java) allow identifiers to begin with an underscore symbol.
protected boolean isIdentifierPart(char c)
The default implementation uses
Character.isUnicodeIdentifierPart(char).
protected Operator parseOperator()
protected Group parseGroupTerminator()
protected String parseElementSeparator()
protected String parseStatementSeparator()
protected Character parseChar(char c)
protected <CS extends CharSequence> CS parseChars(CS cs)
protected String parseToken(int length)
Copyright © 2015–2023 SciJava. All rights reserved.