Class GroovySourceAST

java.lang.Object
antlr.BaseAST
antlr.CommonAST
org.codehaus.groovy.antlr.GroovySourceAST
All Implemented Interfaces:
antlr.collections.AST, Serializable, Comparable, SourceInfo

public class GroovySourceAST extends antlr.CommonAST implements Comparable, SourceInfo
We have an AST subclass so we can track source information. Very odd that ANTLR doesn't do this by default.
See Also:
  • Constructor Details

    • GroovySourceAST

      public GroovySourceAST()
    • GroovySourceAST

      public GroovySourceAST(antlr.Token t)
  • Method Details

    • 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(antlr.Token t)
      Specified by:
      initialize in interface antlr.collections.AST
      Overrides:
      initialize in class antlr.CommonAST
    • setLast

      public void setLast(antlr.Token last)
    • getLineLast

      public int getLineLast()
      Description copied from interface: SourceInfo
      get ending line
      Specified by:
      getLineLast in interface SourceInfo
      Returns:
      the ending line
    • setLineLast

      public void setLineLast(int lineLast)
      Description copied from interface: SourceInfo
      set ending line
      Specified by:
      setLineLast in interface SourceInfo
      Parameters:
      lineLast - the line
    • getColumnLast

      public int getColumnLast()
      Description copied from interface: SourceInfo
      get ending column
      Specified by:
      getColumnLast in interface SourceInfo
      Returns:
      the ending column
    • setColumnLast

      public void setColumnLast(int colLast)
      Description copied from interface: SourceInfo
      set ending column
      Specified by:
      setColumnLast in interface SourceInfo
      Parameters:
      colLast - the column
    • setLine

      public void setLine(int line)
      Description copied from interface: SourceInfo
      set start line
      Specified by:
      setLine in interface SourceInfo
      Parameters:
      line - the line
    • getLine

      public int getLine()
      Description copied from interface: SourceInfo
      get start line
      Specified by:
      getLine in interface antlr.collections.AST
      Specified by:
      getLine in interface SourceInfo
      Overrides:
      getLine in class antlr.BaseAST
      Returns:
      the starting line
    • setColumn

      public void setColumn(int column)
      Description copied from interface: SourceInfo
      set start column
      Specified by:
      setColumn in interface SourceInfo
      Parameters:
      column - the column
    • getColumn

      public int getColumn()
      Description copied from interface: SourceInfo
      get starting column
      Specified by:
      getColumn in interface antlr.collections.AST
      Specified by:
      getColumn in interface SourceInfo
      Overrides:
      getColumn in class antlr.BaseAST
      Returns:
      the starting column
    • setSnippet

      public void setSnippet(String snippet)
    • getSnippet

      public String getSnippet()
    • compareTo

      public int compareTo(Object object)
      Specified by:
      compareTo in interface Comparable
    • childAt

      public GroovySourceAST childAt(int position)
    • childOfType

      public GroovySourceAST childOfType(int type)
    • childrenOfType

      public List<GroovySourceAST> childrenOfType(int type)