Class UserFilesGenerator
java.lang.Object
EDU.purdue.jtb.generate.UserFilesGenerator
Class
UserFilesGenerator contains methods to generate: CODEJAVA
- the (grammar) user nodes classes (genUserXxx, using
UserClassInfo), - the hook interface and empty class files (genXxxEnterExitHook).
Class maintains a state, and is not supposed to be run in parallel threads (on the same grammar); however it internally uses different threads (streams) to generate the different user classes in parallel.
TESTCASE some to add-
Constructor Summary
ConstructorsConstructorDescriptionUserFilesGenerator(JTBOptions aJopt, CommonCodeGenerator aCcg, List<UserClassInfo> aClasses) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintgenEmtpyEnterExitHookFile(File aHookDir) Generates the genEmtpyEnterExitHookFile (class source) file.intgenIEnterExitHookFile(File aHookDir) Generates the IEnterExitHook (interface source) file.intgenUserNodesFiles(File aNodesDir) Generates user nodes (classes source) files.voidOutputs the formatted nodes classes list.
-
Constructor Details
-
UserFilesGenerator
Constructor. Creates the syntaxtree and hook directories if they do not exist.- Parameters:
aJopt- - the JTB optionsaCcg- - theCommonCodeGeneratoraClasses- - the list ofUserClassInfoclasses instances
-
-
Method Details
-
outputFormattedNodesClassesList
Outputs the formatted nodes classes list.- Parameters:
aPw- - a PrintWriter to output on
-
genUserNodesFiles
-
genIEnterExitHookFile
Generates the IEnterExitHook (interface source) file.- Parameters:
aHookDir- - the hook directory File- Returns:
- OK_RC or FILE_EXISTS_RC
- Throws:
IOException- - if IO problem
-
genEmtpyEnterExitHookFile
Generates the genEmtpyEnterExitHookFile (class source) file.- Parameters:
aHookDir- - the nodes directory File- Returns:
- OK_RC or FILE_EXISTS_RC
- Throws:
IOException- - if IO problem
-