org.apache.commons.jexl3.parser
Class Parser

java.lang.Object
  extended by org.apache.commons.jexl3.parser.StringParser
      extended by org.apache.commons.jexl3.parser.JexlParser
          extended by org.apache.commons.jexl3.parser.Parser
All Implemented Interfaces:
ParserConstants, ParserTreeConstants

public final class Parser
extends JexlParser
implements ParserTreeConstants, ParserConstants


Field Summary
 Token jj_nt
          Next token.
protected  JJTParserState jjtree
           
 Token token
          Current token.
 ParserTokenManager token_source
          Generated Token Manager.
 
Fields inherited from interface org.apache.commons.jexl3.parser.ParserTreeConstants
JJTADDNODE, JJTAMBIGUOUS, JJTANDNODE, JJTANNOTATEDSTATEMENT, JJTANNOTATION, JJTARGUMENTS, JJTARRAYACCESS, JJTARRAYLITERAL, JJTASSIGNMENT, JJTBITWISEANDNODE, JJTBITWISECOMPLNODE, JJTBITWISEORNODE, JJTBITWISEXORNODE, JJTBLOCK, JJTBREAK, JJTCONSTRUCTORNODE, JJTCONTINUE, JJTDIVNODE, JJTEMPTYFUNCTION, JJTEMPTYMETHOD, JJTEQNODE, JJTERNODE, JJTEWNODE, JJTEXTENDEDLITERAL, JJTFALSENODE, JJTFOREACHSTATEMENT, JJTFUNCTIONNODE, JJTGENODE, JJTGTNODE, JJTIDENTIFIER, JJTIDENTIFIERACCESS, JJTIFSTATEMENT, JJTJEXLLAMBDA, JJTJEXLSCRIPT, JJTJXLTLITERAL, JJTLENODE, JJTLTNODE, JJTMAPENTRY, JJTMAPLITERAL, JJTMETHODNODE, JJTMODNODE, JJTMULNODE, JJTNENODE, JJTNEWNODE, jjtNodeName, JJTNOTNODE, JJTNRNODE, JJTNSWNODE, JJTNULLLITERAL, JJTNUMBERLITERAL, JJTORNODE, JJTRANGENODE, JJTREFERENCE, JJTREFERENCEEXPRESSION, JJTRETURNSTATEMENT, JJTSETADDNODE, JJTSETANDNODE, JJTSETDIVNODE, JJTSETLITERAL, JJTSETMODNODE, JJTSETMULTNODE, JJTSETORNODE, JJTSETSUBNODE, JJTSETXORNODE, JJTSIZEFUNCTION, JJTSIZEMETHOD, JJTSTRINGLITERAL, JJTSUBNODE, JJTSWNODE, JJTTERNARYNODE, JJTTRUENODE, JJTUNARYMINUSNODE, JJTVAR, JJTVOID, JJTWHILESTATEMENT
 
Fields inherited from interface org.apache.commons.jexl3.parser.ParserConstants
and, AND, and_assign, ANNOTATION, assign, BREAK, COLON, COMMA, CONTINUE, DEFAULT, DIGIT, div, div_assign, DOT, DOT_ID, DOT_IDENTIFIER, eeq, ELIPSIS, ELSE, ELVIS, EMPTY, ene, EOF, eq, FALSE, FLOAT_LITERAL, FOR, FUNCTION, ge, gt, IDENTIFIER, IF, INTEGER_LITERAL, JXLT_LITERAL, LAMBDA, LBRACKET, LCURLY, le, LETTER, LPAREN, lt, minus, minus_assign, mod, mod_assign, mult, mult_assign, NAN_LITERAL, ne, NEW, not, NULL, or, OR, or_assign, plus, plus_assign, PRAGMA, QMARK, range, RBRACKET, RCURLY, REGISTER, REGISTERS, req, RETURN, rne, RPAREN, SEMICOL, seq, SIZE, sne, STRING_LITERAL, tilda, tokenImage, TRUE, VAR, WHILE, xor, xor_assign
 
Constructor Summary
Parser(InputStream stream)
          Constructor with InputStream.
Parser(InputStream stream, String encoding)
          Constructor with InputStream and supplied encoding
Parser(ParserTokenManager tm)
          Constructor with generated Token Manager.
Parser(Reader stream)
          Constructor.
 
Method Summary
 void AdditiveExpression()
          Arithmetic
 void AndExpression()
           
 void AnnotatedStatement()
           
 void Annotation()
           
 void Arguments()
           
 void ArrayAccess()
           
 void ArrayLiteral()
           
 void AssignmentExpression()
           
 void Block()
           
 void BooleanLiteral()
           
 void Break()
           
 void ConditionalAndExpression()
           
 void ConditionalExpression()
          Conditional & relational
 void ConditionalOrExpression()
           
 void Constructor()
           
 void Continue()
           
 void DeclareVar()
           
 void disable_tracing()
          Disable tracing.
 void EmptyMethod()
          Functions & Methods
 void enable_tracing()
          Enable tracing.
 void EqualityExpression()
           
 void ExclusiveOrExpression()
           
 void Expression()
          Expression syntax
 void ExpressionStatement()
           
 void ExtendedLiteral()
           
 void FloatLiteral()
           
 void ForeachStatement()
           
 void ForEachVar()
           
 void FunctionCall()
           
 void FunctionCallLookahead()
           
 ParseException generateParseException()
          Generate ParseException.
 Token getNextToken()
          Get the next Token.
 Token getToken(int index)
          Get the specific Token.
 void Identifier(boolean top)
          Identifier & Literals
 void IdentifierAccess()
          References
 void IfStatement()
           
 void InclusiveOrExpression()
           
 void IntegerLiteral()
           
 ASTJexlScript JexlExpression(Scope frame)
           
 ASTJexlScript JexlScript(Scope frame)
          Statements
 void JxltLiteral()
           
 void Lambda()
           
 void LambdaLookahead()
           
 void Literal()
           
 void MapEntry()
           
 void MapLiteral()
           
 void MemberAccess()
           
 void MemberExpression()
           
 void MethodCall()
           
 void MultiplicativeExpression()
           
 void NaNLiteral()
           
 void NullLiteral()
           
 void Parameter()
           
 void Parameters()
           
 ASTJexlScript parse(JexlInfo info, String jexlSrc, Scope scope, boolean registers, boolean expr)
           
 void Pragma()
           
 void pragmaKey(LinkedList<String> lstr)
           
 Object pragmaValue()
           
 void PrimaryExpression()
           
 void ReferenceExpression()
           
 void ReInit(InputStream stream)
          Reinitialise.
 void ReInit(InputStream stream, String encoding)
          Reinitialise.
 void ReInit(ParserTokenManager tm)
          Reinitialise.
 void ReInit(Reader stream)
          Reinitialise.
 void RelationalExpression()
           
 void ReturnStatement()
           
 void SetLiteral()
           
 void SizeMethod()
           
 void Statement()
           
 void StringIdentifier()
           
 void StringLiteral()
           
 void UnaryExpression()
           
 void ValueExpression()
           
 void Var()
           
 void WhileStatement()
           
 
Methods inherited from class org.apache.commons.jexl3.parser.JexlParser
allowRegisters, checkVariable, declareParameter, declarePragma, declareVariable, getFrame, Identifier, popFrame, pushFrame, setFrame, throwParsingException
 
Methods inherited from class org.apache.commons.jexl3.parser.StringParser
buildString, escapeString, readString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jjtree

protected JJTParserState jjtree

token_source

public ParserTokenManager token_source
Generated Token Manager.


token

public Token token
Current token.


jj_nt

public Token jj_nt
Next token.

Constructor Detail

Parser

public Parser(InputStream stream)
Constructor with InputStream.


Parser

public Parser(InputStream stream,
              String encoding)
Constructor with InputStream and supplied encoding


Parser

public Parser(Reader stream)
Constructor.


Parser

public Parser(ParserTokenManager tm)
Constructor with generated Token Manager.

Method Detail

parse

public ASTJexlScript parse(JexlInfo info,
                           String jexlSrc,
                           Scope scope,
                           boolean registers,
                           boolean expr)

JexlScript

public final ASTJexlScript JexlScript(Scope frame)
                               throws ParseException
Statements

Throws:
ParseException

JexlExpression

public final ASTJexlScript JexlExpression(Scope frame)
                                   throws ParseException
Throws:
ParseException

Annotation

public final void Annotation()
                      throws ParseException
Throws:
ParseException

AnnotatedStatement

public final void AnnotatedStatement()
                              throws ParseException
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

ReturnStatement

public final void ReturnStatement()
                           throws ParseException
Throws:
ParseException

Continue

public final void Continue()
                    throws ParseException
Throws:
ParseException

Break

public final void Break()
                 throws ParseException
Throws:
ParseException

ForeachStatement

public final void ForeachStatement()
                            throws ParseException
Throws:
ParseException

ForEachVar

public final void ForEachVar()
                      throws ParseException
Throws:
ParseException

Var

public final void Var()
               throws ParseException
Throws:
ParseException

DeclareVar

public final void DeclareVar()
                      throws ParseException
Throws:
ParseException

Pragma

public final void Pragma()
                  throws ParseException
Throws:
ParseException

pragmaKey

public final void pragmaKey(LinkedList<String> lstr)
                     throws ParseException
Throws:
ParseException

pragmaValue

public final Object pragmaValue()
                         throws ParseException
Throws:
ParseException

Expression

public final void Expression()
                      throws ParseException
Expression syntax

Throws:
ParseException

AssignmentExpression

public final void AssignmentExpression()
                                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

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:
Identifier in class JexlParser
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

NaNLiteral

public final void NaNLiteral()
                      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

JxltLiteral

public final void JxltLiteral()
                       throws ParseException
Throws:
ParseException

ExtendedLiteral

public final void ExtendedLiteral()
                           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

SetLiteral

public final void SetLiteral()
                      throws ParseException
Throws:
ParseException

EmptyMethod

public final void EmptyMethod()
                       throws ParseException
Functions & Methods

Throws:
ParseException

SizeMethod

public final void SizeMethod()
                      throws ParseException
Throws:
ParseException

Arguments

public final void Arguments()
                     throws ParseException
Throws:
ParseException

FunctionCallLookahead

public final void FunctionCallLookahead()
                                 throws ParseException
Throws:
ParseException

FunctionCall

public final void FunctionCall()
                        throws ParseException
Throws:
ParseException

Constructor

public final void Constructor()
                       throws ParseException
Throws:
ParseException

Parameter

public final void Parameter()
                     throws ParseException
Throws:
ParseException

Parameters

public final void Parameters()
                      throws ParseException
Throws:
ParseException

LambdaLookahead

public final void LambdaLookahead()
                           throws ParseException
Throws:
ParseException

Lambda

public final void Lambda()
                  throws ParseException
Throws:
ParseException

IdentifierAccess

public final void IdentifierAccess()
                            throws ParseException
References

Throws:
ParseException

ArrayAccess

public final void ArrayAccess()
                       throws ParseException
Throws:
ParseException

MemberAccess

public final void MemberAccess()
                        throws ParseException
Throws:
ParseException

ReferenceExpression

public final void ReferenceExpression()
                               throws ParseException
Throws:
ParseException

PrimaryExpression

public final void PrimaryExpression()
                             throws ParseException
Throws:
ParseException

MethodCall

public final void MethodCall()
                      throws ParseException
Throws:
ParseException

MemberExpression

public final void MemberExpression()
                            throws ParseException
Throws:
ParseException

ValueExpression

public final void ValueExpression()
                           throws ParseException
Throws:
ParseException

ReInit

public void ReInit(InputStream stream)
Reinitialise.


ReInit

public void ReInit(InputStream stream,
                   String encoding)
Reinitialise.


ReInit

public void ReInit(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:
getToken in class JexlParser

generateParseException

public ParseException generateParseException()
Generate ParseException.


enable_tracing

public final void enable_tracing()
Enable tracing.


disable_tracing

public final void disable_tracing()
Disable tracing.



Copyright © 2001–2017 The Apache Software Foundation. All rights reserved.