Package org.apache.commons.jexl2.parser
Class Parser
- java.lang.Object
-
- org.apache.commons.jexl2.parser.StringParser
-
- org.apache.commons.jexl2.parser.JexlParser
-
- org.apache.commons.jexl2.parser.Parser
-
- All Implemented Interfaces:
ParserConstants,ParserTreeConstants
public class Parser extends JexlParser implements ParserTreeConstants, ParserConstants
-
-
Field Summary
Fields Modifier and Type Field Description booleanALLOW_REGISTERSTokenjj_ntNext token.protected JJTParserStatejjtreeTokentokenCurrent token.ParserTokenManagertoken_sourceGenerated Token Manager.-
Fields inherited from class org.apache.commons.jexl2.parser.JexlParser
frame
-
Fields inherited from interface org.apache.commons.jexl2.parser.ParserConstants
and, AND, assign, COLON, COMMA, DEFAULT, DIGIT, div, DOT, ELSE, ELVIS, EMPTY, EOF, eq, FALSE, FLOAT_LITERAL, FOR, FOR_EACH_IN, FOREACH, ge, gt, IDENTIFIER, IF, IN, INTEGER_LITERAL, LBRACKET, LCURLY, le, LETTER, LPAREN, lt, minus, mod, mult, ne, NEW, not, NULL, or, OR, plus, QMARK, RBRACKET, RCURLY, REGISTER, REGISTERS, req, RETURN, rne, RPAREN, SEMICOL, SIZE, STRING_LITERAL, tilda, tokenImage, TRUE, VAR, WHILE, xor
-
Fields inherited from interface org.apache.commons.jexl2.parser.ParserTreeConstants
JJTADDITIVENODE, JJTADDITIVEOPERATOR, JJTAMBIGUOUS, JJTANDNODE, JJTARRAYACCESS, JJTARRAYLITERAL, JJTASSIGNMENT, JJTBITWISEANDNODE, JJTBITWISECOMPLNODE, JJTBITWISEORNODE, JJTBITWISEXORNODE, JJTBLOCK, JJTCONSTRUCTORNODE, JJTDIVNODE, JJTEMPTYFUNCTION, JJTEQNODE, JJTERNODE, JJTFALSENODE, JJTFOREACHSTATEMENT, JJTFUNCTIONNODE, JJTGENODE, JJTGTNODE, JJTIDENTIFIER, JJTIFSTATEMENT, JJTJEXLSCRIPT, JJTLENODE, JJTLTNODE, JJTMAPENTRY, JJTMAPLITERAL, JJTMETHODNODE, JJTMODNODE, JJTMULNODE, JJTNENODE, jjtNodeName, JJTNOTNODE, JJTNRNODE, JJTNULLLITERAL, JJTNUMBERLITERAL, JJTORNODE, JJTREFERENCE, JJTREFERENCEEXPRESSION, JJTRETURNSTATEMENT, JJTSIZEFUNCTION, JJTSIZEMETHOD, JJTSTRINGLITERAL, JJTTERNARYNODE, JJTTRUENODE, JJTUNARYMINUSNODE, JJTVAR, JJTVOID, JJTWHILESTATEMENT
-
-
Constructor Summary
Constructors Constructor Description Parser(java.io.InputStream stream)Constructor with InputStream.Parser(java.io.InputStream stream, java.lang.String encoding)Constructor with InputStream and supplied encodingParser(java.io.Reader stream)Constructor.Parser(ParserTokenManager tm)Constructor with generated Token Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidAdditiveExpression()ArithmeticvoidAdditiveOperator()voidAndExpression()voidAnyMethod()voidArrayAccess()voidArrayLiteral()voidAssignment()voidBlock()voidBooleanLiteral()voidConditionalAndExpression()voidConditionalExpression()Conditional & relationalvoidConditionalOrExpression()voidConstructor()voidDeclareVar()voiddisable_tracing()Disable tracing.voidDotReference()voidEmptyFunction()Functions & Methodsvoidenable_tracing()Enable tracing.voidEqualityExpression()voidExclusiveOrExpression()voidExpression()Expression syntaxvoidExpressionStatement()voidFloatLiteral()voidForeachStatement()voidFunction()ParseExceptiongenerateParseException()Generate ParseException.TokengetNextToken()Get the next Token.TokengetToken(int index)Get the specific Token.voidIdentifier(boolean top)Identifier & LiteralsvoidIfStatement()voidInclusiveOrExpression()voidIntegerLiteral()ASTJexlScriptJexlScript()StatementsvoidLiteral()voidLValueVar()voidMapEntry()voidMapLiteral()voidMethod()voidMultiplicativeExpression()voidNullLiteral()ASTJexlScriptparse(java.io.Reader reader, JexlInfo info)voidPrimaryExpression()ReferencesvoidReference()voidReferenceExpression()ReferenceExpression is a subclass of ArrayAccessvoidReInit(java.io.InputStream stream)Reinitialise.voidReInit(java.io.InputStream stream, java.lang.String encoding)Reinitialise.voidReInit(java.io.Reader stream)Reinitialise.voidReInit(ParserTokenManager tm)Reinitialise.voidRelationalExpression()voidReturnStatement()voidSizeFunction()voidSizeMethod()voidStatement()voidStringIdentifier()voidStringLiteral()booleantrace_enabled()Trace enabled.voidUnaryExpression()voidVar()voidWhileStatement()-
Methods inherited from class org.apache.commons.jexl2.parser.JexlParser
checkVariable, declareVariable, getFrame, Identifier, setFrame
-
Methods inherited from class org.apache.commons.jexl2.parser.StringParser
buildString, escapeString, readString
-
-
-
-
Field Detail
-
jjtree
protected JJTParserState jjtree
-
ALLOW_REGISTERS
public boolean ALLOW_REGISTERS
-
token_source
public ParserTokenManager token_source
Generated Token Manager.
-
-
Constructor Detail
-
Parser
public Parser(java.io.InputStream stream)
Constructor with InputStream.
-
Parser
public Parser(java.io.InputStream stream, java.lang.String encoding)
Constructor with InputStream and supplied encoding
-
Parser
public Parser(java.io.Reader stream)
Constructor.
-
Parser
public Parser(ParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
parse
public ASTJexlScript parse(java.io.Reader reader, JexlInfo info) throws ParseException
- Throws:
ParseException
-
JexlScript
public final ASTJexlScript JexlScript() throws ParseException
Statements- Throws:
ParseException
-
Statement
public final void Statement() throws ParseException
- Throws:
ParseException
-
Block
public final void Block() throws ParseException
- Throws:
ParseException
-
ExpressionStatement
public final void ExpressionStatement() throws ParseException
- Throws:
ParseException
-
IfStatement
public final void IfStatement() throws ParseException
- Throws:
ParseException
-
WhileStatement
public final void WhileStatement() throws ParseException
- Throws:
ParseException
-
ForeachStatement
public final void ForeachStatement() throws ParseException
- Throws:
ParseException
-
ReturnStatement
public final void ReturnStatement() throws ParseException
- Throws:
ParseException
-
Expression
public final void Expression() throws ParseException
Expression syntax- Throws:
ParseException
-
Assignment
public final void Assignment() throws ParseException
- Throws:
ParseException
-
Var
public final void Var() throws ParseException
- Throws:
ParseException
-
DeclareVar
public final void DeclareVar() throws ParseException
- Throws:
ParseException
-
LValueVar
public final void LValueVar() throws ParseException
- Throws:
ParseException
-
ConditionalExpression
public final void ConditionalExpression() throws ParseException
Conditional & relational- Throws:
ParseException
-
ConditionalOrExpression
public final void ConditionalOrExpression() throws ParseException
- Throws:
ParseException
-
ConditionalAndExpression
public final void ConditionalAndExpression() throws ParseException
- Throws:
ParseException
-
InclusiveOrExpression
public final void InclusiveOrExpression() throws ParseException
- Throws:
ParseException
-
ExclusiveOrExpression
public final void ExclusiveOrExpression() throws ParseException
- Throws:
ParseException
-
AndExpression
public final void AndExpression() throws ParseException
- Throws:
ParseException
-
EqualityExpression
public final void EqualityExpression() throws ParseException
- Throws:
ParseException
-
RelationalExpression
public final void RelationalExpression() throws ParseException
- Throws:
ParseException
-
AdditiveExpression
public final void AdditiveExpression() throws ParseException
Arithmetic- Throws:
ParseException
-
AdditiveOperator
public final void AdditiveOperator() throws ParseException
- Throws:
ParseException
-
MultiplicativeExpression
public final void MultiplicativeExpression() throws ParseException
- Throws:
ParseException
-
UnaryExpression
public final void UnaryExpression() throws ParseException
- Throws:
ParseException
-
Identifier
public final void Identifier(boolean top) throws ParseException
Identifier & Literals- Overrides:
Identifierin classJexlParser- Parameters:
top- whether the identifier is beginning an l/r value- Throws:
ParseException- subclasses may throw this
-
StringIdentifier
public final void StringIdentifier() throws ParseException
- Throws:
ParseException
-
Literal
public final void Literal() throws ParseException
- Throws:
ParseException
-
NullLiteral
public final void NullLiteral() throws ParseException
- Throws:
ParseException
-
BooleanLiteral
public final void BooleanLiteral() throws ParseException
- Throws:
ParseException
-
IntegerLiteral
public final void IntegerLiteral() throws ParseException
- Throws:
ParseException
-
FloatLiteral
public final void FloatLiteral() throws ParseException
- Throws:
ParseException
-
StringLiteral
public final void StringLiteral() throws ParseException
- Throws:
ParseException
-
ArrayLiteral
public final void ArrayLiteral() throws ParseException
- Throws:
ParseException
-
MapLiteral
public final void MapLiteral() throws ParseException
- Throws:
ParseException
-
MapEntry
public final void MapEntry() throws ParseException
- Throws:
ParseException
-
EmptyFunction
public final void EmptyFunction() throws ParseException
Functions & Methods- Throws:
ParseException
-
SizeFunction
public final void SizeFunction() throws ParseException
- Throws:
ParseException
-
Function
public final void Function() throws ParseException
- Throws:
ParseException
-
Method
public final void Method() throws ParseException
- Throws:
ParseException
-
AnyMethod
public final void AnyMethod() throws ParseException
- Throws:
ParseException
-
SizeMethod
public final void SizeMethod() throws ParseException
- Throws:
ParseException
-
Constructor
public final void Constructor() throws ParseException
- Throws:
ParseException
-
PrimaryExpression
public final void PrimaryExpression() throws ParseException
References- Throws:
ParseException
-
ArrayAccess
public final void ArrayAccess() throws ParseException
- Throws:
ParseException
-
DotReference
public final void DotReference() throws ParseException
- Throws:
ParseException
-
Reference
public final void Reference() throws ParseException
- Throws:
ParseException
-
ReferenceExpression
public final void ReferenceExpression() throws ParseException
ReferenceExpression is a subclass of ArrayAccess- Throws:
ParseException
-
ReInit
public void ReInit(java.io.InputStream stream)
Reinitialise.
-
ReInit
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
Reinitialise.
-
ReInit
public void ReInit(java.io.Reader stream)
Reinitialise.
-
ReInit
public void ReInit(ParserTokenManager tm)
Reinitialise.
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.- Overrides:
getTokenin classJexlParser
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
trace_enabled
public final boolean trace_enabled()
Trace enabled.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-