Class EJBQLAST

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

    public class EJBQLAST
    extends antlr.CommonAST
    implements Cloneable
    An instance of this class represents a node of the intermediate representation (AST) used by the query compiler. It stores per node:
    • token type info
    • token text
    • line info
    • column info
    • type info the semantic analysis calculates the type of an expression and adds this info to each node.
    Author:
    Michael Bouschen
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int column
      The column info
      protected int line
      The line info
      protected Object typeInfo
      The type info
      • Fields inherited from class antlr.BaseAST

        down, right
    • Constructor Summary

      Constructors 
      Constructor Description
      EJBQLAST()
      No args constructor.
      EJBQLAST​(int type, String text, Object typeInfo)
      Constructor taking token type, text and type info.
      EJBQLAST​(EJBQLAST ast)
      Copy constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Object clone()
      Creates and returns a copy of this object.
      int getColumn()  
      int getLine()  
      String getTreeRepr​(String title)
      Returns a full string representation of this JQLAST.
      Object getTypeInfo()  
      void initialize​(int type, String text, Object typeInfo)  
      void initialize​(antlr.collections.AST _ast)  
      void initialize​(antlr.Token t)  
      void setColumn​(int column)  
      void setLine​(int line)  
      void setTypeInfo​(Object typeInfo)  
      String toString()
      Returns a string representation of this EJBQLAST w/o child ast nodes.
      • Methods inherited from class antlr.CommonAST

        getText, getType, initialize, setText, setType
      • Methods inherited from class antlr.BaseAST

        addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
    • Field Detail

      • line

        protected int line
        The line info
      • column

        protected int column
        The column info
      • typeInfo

        protected transient Object typeInfo
        The type info
    • Constructor Detail

      • EJBQLAST

        public EJBQLAST()
        No args constructor.
      • EJBQLAST

        public EJBQLAST​(int type,
                        String text,
                        Object typeInfo)
        Constructor taking token type, text and type info.
      • EJBQLAST

        public EJBQLAST​(EJBQLAST ast)
        Copy constructor.
    • Method Detail

      • 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,
                               Object typeInfo)
      • initialize

        public void initialize​(antlr.collections.AST _ast)
        Specified by:
        initialize in interface antlr.collections.AST
        Overrides:
        initialize in class antlr.CommonAST
      • 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
      • setTypeInfo

        public void setTypeInfo​(Object typeInfo)
      • getTypeInfo

        public Object getTypeInfo()
      • toString

        public String toString()
        Returns a string representation of this EJBQLAST w/o child ast 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.
      • clone

        protected Object clone()
                        throws CloneNotSupportedException
        Creates and returns a copy of this object. The returned EJBQLAST shares the same state as this object, meaning the fields type, text, line, column, and typeInfo have the same values. But it is not bound to any tree structure, thus the child is null and the sibling is null.
        Overrides:
        clone in class Object
        Returns:
        a clone of this instance.
        Throws:
        CloneNotSupportedException