public class ExprParser
extends java.lang.Object
Tokens
. Determines
which token the cursor is in. Analyzes the expression to determine if
it will yield the correct type.
TODO: reorg so there is one constructor and various getters that scan/parse/analyze on demand as needed, so user is shielded from knowing how much analysis is needed for a particular getter (like getResultType v. getValue)
Modifier and Type | Class and Description |
---|---|
class |
ExprParser.Token
Token represents a lexeme in a parsed expression.
|
Modifier and Type | Field and Description |
---|---|
static int |
TOKEN_BINARYOP |
static int |
TOKEN_BOOLEAN_CONSTANT |
static int |
TOKEN_CHARLIT |
static int |
TOKEN_CONSTRUCTOR |
static int |
TOKEN_FUNCTION |
static int |
TOKEN_IDENTIFIER |
static int |
TOKEN_LBRACKET |
static int |
TOKEN_LPAREN |
static int |
TOKEN_NULL |
static int |
TOKEN_NUMBER |
static int |
TOKEN_PRE_UNARYOP |
static int |
TOKEN_RBRACKET |
static int |
TOKEN_RPAREN |
static int |
TOKEN_STRINGLIT |
static int |
TOKEN_TYPE_OP |
static int |
TOKEN_TYPE_OPERAND |
static int |
TOKEN_TYPE_UNKNOWN |
static int |
TOKEN_UNARY_OR_BINARY_OP |
static int |
TOKEN_UNKNOWN |
Modifier and Type | Method and Description |
---|---|
java.util.List<ExprParser.Token> |
getConcatTokens() |
java.util.List<DOID> |
getReferences() |
DOID |
getResultID() |
java.util.List<ExprParser.Token> |
getTokens() |
boolean |
hasError() |
static boolean |
higherPrecedence(java.lang.String op1,
java.lang.String op2)
Determine whether op1 has higher precedence than op2.
|
static ExprParser |
usageOnly(ExprParser parser,
RuleComponent parent) |
public static final int TOKEN_TYPE_OPERAND
public static final int TOKEN_IDENTIFIER
public static final int TOKEN_FUNCTION
public static final int TOKEN_CONSTRUCTOR
public static final int TOKEN_NUMBER
public static final int TOKEN_STRINGLIT
public static final int TOKEN_CHARLIT
public static final int TOKEN_BOOLEAN_CONSTANT
public static final int TOKEN_NULL
public static final int TOKEN_TYPE_OP
public static final int TOKEN_LPAREN
public static final int TOKEN_RPAREN
public static final int TOKEN_BINARYOP
public static final int TOKEN_PRE_UNARYOP
public static final int TOKEN_UNARY_OR_BINARY_OP
public static final int TOKEN_LBRACKET
public static final int TOKEN_RBRACKET
public static final int TOKEN_TYPE_UNKNOWN
public static final int TOKEN_UNKNOWN
public static ExprParser usageOnly(ExprParser parser, RuleComponent parent)
public boolean hasError()
public DOID getResultID()
public java.util.List<DOID> getReferences()
public static boolean higherPrecedence(java.lang.String op1, java.lang.String op2)
op1
- op2
- public java.util.List<ExprParser.Token> getTokens()
public java.util.List<ExprParser.Token> getConcatTokens()