Class VisitorsGenerator


  • public class VisitorsGenerator
    extends java.lang.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
    • Method Detail

      • genDepthFirstVisitorFile

        public int genDepthFirstVisitorFile​(VisitorInfo aVi,
                                            java.io.File aVisitorDir)
                                     throws java.io.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:
        java.io.IOException - if IO problem
      • genIVisitorFile

        public int genIVisitorFile​(VisitorInfo aVi,
                                   java.io.File aVisitorDir)
                            throws java.io.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:
        java.io.IOException - - if IO problem
      • genSigAnnFile

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

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