Class ANTLRUtils

java.lang.Object
edu.udel.cis.vsl.abc.util.IF.ANTLRUtils

public class ANTLRUtils extends Object
  • Constructor Details

    • ANTLRUtils

      public ANTLRUtils()
  • Method Details

    • printTree

      public static void printTree(PrintStream out, org.antlr.runtime.tree.Tree tree)
      Pretty-prints a parse tree.
      Parameters:
      out - the stream to which output should be sent
      tree - the tree to print. May be null.
    • source

      public static void source(PrintStream out, String filename) throws IOException
      Applies method source to the file with the given filename.
      Parameters:
      out - a PrintStream to which the output is sent
      filename - name of a file
      Throws:
      IOException
    • source

      public static void source(PrintStream out, File file) throws IOException
      Prints the original text file to the give output stream, unaltered.
      Parameters:
      out - a PrintStream to which the output is sent
      file - the file to read
      Throws:
      IOException - if an I/O exception occurs while reading the file
    • print

      public static void print(PrintStream out, org.antlr.runtime.TokenSource ts)
      Prints all tokens from the token source.
      Parameters:
      out - where to print
      ts - token source
    • lex

      public static void lex(PrintStream out, ANTLRUtils.LexerFactory lf, String filename) throws IOException
      Throws:
      IOException