Since I'd already worked out the translations needed for C name spaces and data spaces, the next thing was to translate the usage of a stack for handling parameters to the C paradigm of passing parameters with named scoped variables. The VFM that the Forth code assumes is there, is removed from the code by putting it into the translation. Values which get pushed to the stack in the code are now kept on a stack as text during the translation. If, during the translation, there is an inherent stack operation such as DUP, the text on the data stack is duplicated. The action that was supposed to be done by the stack primitive of the VFM is done during the translation.
Values accumulate on the stack until they are required by consumers or transformers.
Since Forth assumes two stacks, data and return, there are two stacks in the translation which mimic the movement of information in the source code. Text from the source is accumulated on the stacks until it is needed and then finally output to the output file. In this example, the 8 is recognized in the translation by the default rule as a number and is pushed onto the data stack. The next word parsed, is recognized by a specific rule as data and it gets pushed to the data stack as well. Its action is to output the text values from the data stack in the right order with the added C syntax.