java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.parser.StringParser
edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.parser.JexlParser
Direct Known Subclasses:
Parser

public class JexlParser extends StringParser
The base class for parsing, manages the parameter/local variable frame.
  • Field Details

    • frame

      protected JexlEngine.Scope frame
      The map of named registers aka script parameters. Each parameter is associated to a register and is materialized as an offset in the registers array used during evaluation.
  • Constructor Details

    • JexlParser

      public JexlParser()
  • Method Details

    • setFrame

      public void setFrame(JexlEngine.Scope theFrame)
      Sets the frame to use bythis parser.

      This is used to allow parameters to be declared before parsing.

      Parameters:
      theFrame - the register map
    • getFrame

      public JexlEngine.Scope getFrame()
      Gets the frame used by this parser.

      Since local variables create new named registers, it is important to regain access after parsing to known which / how-many registers are needed.

      Returns:
      the named register map
    • checkVariable

      public String checkVariable(ASTIdentifier identifier, String image)
      Checks whether an identifier is a local variable or argument, ie stored in a register.
      Parameters:
      identifier - the identifier
      image - the identifier image
      Returns:
      the image
    • declareVariable

      public void declareVariable(ASTVar identifier, String image)
      Declares a local variable.

      This method creates an new entry in the named register map.

      Parameters:
      identifier - the identifier used to declare
      image - the variable name
    • Identifier

      public void Identifier(boolean top) throws ParseException
      Default implementation does nothing but is overriden by generated code.
      Parameters:
      top - whether the identifier is beginning an l/r value
      Throws:
      ParseException - subclasses may throw this
    • Identifier

      public final void Identifier() throws ParseException
      Throws:
      ParseException
    • getToken

      public Token getToken(int index)