Class VisitorsGenerator

java.lang.Object
EDU.purdue.jtb.generate.VisitorsGenerator

public class VisitorsGenerator extends Object
Class VisitorsGenerator contains methods to generate: CODEJAVA
  • the different IXxxVisitor interfaces and DepthFirstXxxVisitor classes files,
  • the signature files.

Class maintains a state, and is not supposed to be run in parallel threads (on the same grammar). It does not generate the files in parallel.

TODO add test runs on generated default visitors
  • Constructor Details

  • Method Details

    • genDepthFirstVisitorFile

      public int genDepthFirstVisitorFile(VisitorInfo aVi, File aVisitorDir) throws IOException
      Generates a DepthFirstXxxVisitor (class source) file.
      Parameters:
      aVi - - a VisitorInfo defining the visitor to generate
      aVisitorDir - - the visitor directory File
      Returns:
      OK_RC or FILE_EXISTS_RC
      Throws:
      IOException - if IO problem
    • genIVisitorFile

      public int genIVisitorFile(VisitorInfo aVi, File aVisitorDir) throws IOException
      Generates an IXxxVisitor (interface source) file.
      Parameters:
      aVi - - a VisitorInfo defining the visitor to generate
      aVisitorDir - - the visitor directory File
      Returns:
      OK_RC or FILE_EXISTS_RC
      Throws:
      IOException - - if IO problem
    • genSigAnnFile

      public int genSigAnnFile(File aSignatureDir) throws IOException
      Generates the NodeFieldsSignature (annotation source) file.
      Parameters:
      aSignatureDir - - the signature directory File
      Returns:
      OK_RC or FILE_EXISTS_RC
      Throws:
      IOException - - if IO problem
    • genSigAnnProcFile

      public int genSigAnnProcFile(File aSignatureDir) throws IOException
      Generates the ControlSignatureProcessor (annotation processor source) file.
      Parameters:
      aSignatureDir - - the signature directory File
      Returns:
      OK_RC or FILE_EXISTS_RC
      Throws:
      IOException - - if IO problem