After the project is setup, the FWD "conversion front end" is run. This is the part of FWD that preprocesses and parses the application code and schemata. It does not run "conversion" to Java, it is just turning the source code and schemata into an Abstract Syntax Tree (AST) form suitable for using automated tools. The Code Analytics needs to process using these ASTs. The "front end" is can be interchangeably referred to as "parsing".
Parse the Code and Schemata¶
This section assumes you have used the sample project as a template. In that project, there is an Apache Ant
build.xml that provides multiple build targets which include parsing.
As noted above, this is referred to as the "front end" because it was originally created as part of the automated conversion process. This front end is reused for the Code Analytics. In fact, the analytics tools must be run on freshly parsed ASTs, it cannot be run using the ASTs as they exist after the full conversion process. This is why it is important to have an isolated run of the front end before running the processing that calculates the report results and statistics.
When you are getting the application code parsed for the first time, it is best to just run the parsing by itself. This is because for larger applications, it is expected that there will be some issues to be resolved. Running the "front end" by itself will avoid other processing (the report calculations) which are useless if the project is not parsing properly. Make sure to review the output of the parsing run to see if there are any errors and resolve those errors before running the report calculation targets.
Before you try to parse, it is very important to carefully review the section on Avoiding Common Parsing Mistakes. Planning properly and carefully following the guidelines will save time.
The project template for
build.xml includes two targets that allow running just the conversion front end:
|| Execute the parse phase of the conversion process, using a pattern as input. This will use the specification mode (
|| Execute the parse phase of the conversion process, using the file named 'file-cvt-list.txt' (located in the project directory) as input. This will use the filename list in a text file mode (
To run parsing by itself:
cd ~/app_name ant convert.front
c: cd c:\app_name ant convert.front
Change the target from
convert.front.list to use the
-f (filename list in a text file) mode. Review the output of the parsing carefully.
To understand the full details on the process, see these chapters from the Conversion Handbook:
© 2004-2021 Golden Code Development Corporation. ALL RIGHTS RESERVED.