Class JDOQLParser

  • All Implemented Interfaces:

    public class JDOQLParser
    extends AbstractParser
    Implementation of a parser for JDOQL query language. Generates Node tree(s) by use of the various parseXXX() methods.
    • Constructor Detail

      • JDOQLParser

        public JDOQLParser()
        Constructor for a JDOQL Parser.
    • Method Detail

      • allowSingleEquals

        public void allowSingleEquals​(boolean flag)
        Method to set whether "=" is allowed. It is valid in an UPDATE clause, but not in a WHERE clause, for example.
        flag - Whether to allow it
      • parse

        public Node parse​(String expression)
      • parseVariable

        public Node parseVariable​(String expression)
      • parseFrom

        public Node[] parseFrom​(String expression)
      • parseUpdate

        public Node[] parseUpdate​(String expression)
      • parseOrder

        public Node[] parseOrder​(String expression)
      • parseResult

        public Node[] parseResult​(String expression)
        The RESULT expression in JDOQL can include aggregates, fields, as well as aliases
        • myfield [AS] alias, myfield2"
        The Node tree for this would be
         [IDENTIFIER : myfield.
              [NAME : alias]],
         [IDENTIFIER : myfield2]
        Node tree(s) for the RESULT expression
      • parseTuple

        public Node[] parseTuple​(String expression)
      • parseVariables

        public Node[][] parseVariables​(String expression)
      • parseParameters

        public Node[][] parseParameters​(String expression)
      • processAdditiveExpression

        protected void processAdditiveExpression()
      • processMultiplicativeExpression

        protected void processMultiplicativeExpression()
      • processUnaryExpression

        protected void processUnaryExpression()
      • processPrimary

        protected void processPrimary()
        Parses the primary. First look for a literal (e.g. "text"), then an identifier(e.g. variable) In the next step, call a function, if executing a function, on the literal or the identifier found.
      • processLiteral

        protected boolean processLiteral()
        A literal is one value of any type. Supported literals are of types String, Floating Point, Integer, Character, Boolean and null e.g. 'J', "String", 1, 1.8, true, false, null.
        The parsed literal