Class JQLAST

  • All Implemented Interfaces:
    antlr.collections.AST, Serializable

    public class JQLAST
    extends antlr.CommonAST
    This class represents a node in the intermediate representation (AST) used by the query compiler. It provides - line info - column info - type info (object of class util.type.Type): the semantic analysis calculates the type of an expression and adds this info to each node. - RetrieveDesc info - value: this allows to add an arbitrary value to a node. This is used in compile time calulation of constant expression.
    Version:
    0.1
    Author:
    Michael Bouschen
    See Also:
    Serialized Form
    • Field Detail

      • line

        protected int line
      • column

        protected int column
      • jqlType

        protected Type jqlType
      • value

        protected Object value
    • Constructor Detail

      • JQLAST

        public JQLAST()
      • JQLAST

        public JQLAST​(int type,
                      String text,
                      Type jqlType)
      • JQLAST

        public JQLAST​(int type,
                      String text,
                      Type jqlType,
                      Object value)
      • JQLAST

        public JQLAST​(antlr.Token t)
      • JQLAST

        public JQLAST​(JQLAST ast)
    • Method Detail

      • initialize

        public void initialize​(int type)
      • initialize

        public void initialize​(int type,
                               String text)
        Specified by:
        initialize in interface antlr.collections.AST
        Overrides:
        initialize in class antlr.CommonAST
      • initialize

        public void initialize​(antlr.Token t)
        Specified by:
        initialize in interface antlr.collections.AST
        Overrides:
        initialize in class antlr.CommonAST
      • initialize

        public void initialize​(int type,
                               String text,
                               Type jqlType)
      • initialize

        public void initialize​(int type,
                               String text,
                               Type jqlType,
                               Object value)
      • initialize

        public void initialize​(antlr.collections.AST ast)
        Specified by:
        initialize in interface antlr.collections.AST
        Overrides:
        initialize in class antlr.CommonAST
      • initialize

        public void initialize​(JQLAST ast)
      • setLine

        public void setLine​(int line)
      • getLine

        public int getLine()
        Specified by:
        getLine in interface antlr.collections.AST
        Overrides:
        getLine in class antlr.BaseAST
      • setColumn

        public void setColumn​(int column)
      • getColumn

        public int getColumn()
        Specified by:
        getColumn in interface antlr.collections.AST
        Overrides:
        getColumn in class antlr.BaseAST
      • setJQLType

        public void setJQLType​(Type jqlType)
      • getJQLType

        public Type getJQLType()
      • setRetrieveDesc

        public void setRetrieveDesc​(RetrieveDesc rd)
      • setValue

        public void setValue​(Object value)
      • getValue

        public Object getValue()
      • toString

        public String toString()
        Returns a string representation of this JQLAST w/o child nodes.
        Specified by:
        toString in interface antlr.collections.AST
        Overrides:
        toString in class antlr.BaseAST
        Returns:
        a string representation of the object.
      • getTreeRepr

        public String getTreeRepr​(String title)
        Returns a full string representation of this JQLAST. The returned string starts with the specified title string, followed by the string representation of this ast, followed by the string representation of the child ast nodes of this ast. The method dumps each ast node on a separate line. Child ast nodes are indented. The method calls toString to dump a single node w/o children.
        Returns:
        string representation of this ast including children.
      • getRetrieveDescRepr

        public static String getRetrieveDescRepr​(RetrieveDesc rd)
        Returns a string representation of the spceified RetrieveDesc.