Class TreeDumperGenerator


  • public class TreeDumperGenerator
    extends java.lang.Object
    Class TreeDumperGenerator generates the TreeDumper visitor which simply prints all the tokens in the tree at the locations given in their beginLine and beginColumn member variables.
    Similar to UserFilesGenerator class. CODEJAVA

    This visitor is supposed to be run once and not supposed to be run in parallel threads (on the same grammar).

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String outFilename
      The visitor source file name
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generateTreeDumper()
      Generates the tree dumper visitor source in its file.
      int saveToFile()
      Saves the current buffer in the output file (global variable).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • outFilename

        public static final java.lang.String outFilename
        The visitor source file name
        See Also:
        Constant Field Values
    • Constructor Detail

      • TreeDumperGenerator

        public TreeDumperGenerator​(JTBOptions aJopt,
                                   Messages aMess)
        Constructor. Will create the visitors directory if it does not exist.
        Parameters:
        aJopt - - the JTB options
        aMess - - the messages handler
    • Method Detail

      • saveToFile

        public int saveToFile()
                       throws java.io.IOException
        Saves the current buffer in the output file (global variable).
        Returns:
        OK_RC or FILE_EXISTS_RC
        Throws:
        java.io.IOException - if IO problem
      • generateTreeDumper

        public void generateTreeDumper()
        Generates the tree dumper visitor source in its file.