The conversion file is fairly straight forward in the majority of its syntax. There are a few reserved symbols. These symbols are #, [, ]. It should also be noted that everything in the file is case sensitive. Every new statement must be on its own line. The hash (#) is used to denote a comment line. The file itself is divided up into 5 sections: comments, keywords, operators, specifics, types. Each of these sections are required. The comments section is where the comment conversion information is placed. The keyword section has the keyword conversion. Operators has the operator conversion. And, yes, the types section holds the type conversions. The specifics section holds information that is unique to that language, such as file separation. The conversion information is done simply be giving the pseudocode followed by a space and it's language equivalent. For example in a C++ file you would see:
[keywords]
and &&
for the conversion of the pseudocode keyword and. Sometimes conversions are not a simple issue of substitution but require more effort or may not even be used in that language at all. For such situations we have special keywords for the conversion file. The conversion files themselves have an extension of gcf.
`: This back tick will place a space in it's place after the conversion.
ADD_SCOPE: This will place the contents of the string at the end of the line in it's place after the conversion.
AT_FRONT: This will place and combine the string that follows it at the front of a three string sequence. See table for further explanation.
AT_MID: This will place and combine the string that follows it at the middle of a three string sequence. See table for further explanation.
AT_BACK: This will place and combine the string that follows it at the back of a three string sequence. See table for further explanation.
BEGIN_SUBSCRIPT: This is the beginning sub-script character. This is needed because of the pseudocode uses the opening sub-script.
CLASS_NAME: This is will place the name of the class in its place.
DECLARATION_EXTENSION: This is the extension for a declaration file.
DEFINITION_EXTENSION: This is the extension for a definition file.
NEXT_LINE: This will place everything that follows it on the next line.
NOT_USED: This indicates that this pseudocode keyword is not used in the targeted language.
PREV_LINE: This will place everything that follows it up to either a comma or a closing parentheses on the previous line.
PARENT_CLASS: This will place the name of the parent class in its place.
SEND_TO_BACK: This will send the string that follows it to the end of the line in the conversion.
SEPARATE_CODE: This is a true or false value that indicates if a converted language separates their declarations and their implementations.
SINGLE_LINE_COMMENT: This is the single line comment in the pseudocode. This is needed because of the pseudocode uses the hash.
This table represents how to use the alignment tokens. In case you're wondering; yes, AT does stand for Alignment Token. When the ATs are used right, they can make powerful conversion take place. In the table that follows the alignment tokens are placed as they would be expected in the conversion file. The three strings from the pseudocode are identified as begin, middle, and end. These strings have been placed in their current order as they would be in the unconverted code. In our example the goal is to get the text to read: myFooBar.
| Begin String | Middle String | End String | |
| Foo | AT_FRONT | my | Bar |
| Bar | AT_MID | Foo | my |
| my | AT_BACK | Bar | Foo |