Hi,
I am building a language translator, that must convert input from
source languages to a language neutral format in XML. This XML must be
read by the target language translator and produce the output in the
target language. I am thinking of using a hashed map to handle
translations but am have trouble in deciding on the schema in which the
XML must be stored
The application must work as follows...
{c translator} <---| X M L | <---{vb translator}
int i; stored in Dim i as Integer
printf("%d",i); neutral format Print i
Proposed XML format:
<translate>
<action index=1>i</action>
<action index=2>i</action>
</translate>
the index attribute of the XML tag action will refer to a hash table
that will aid in translations thus
__________________________________________________ ________________
| index | c | vb |
|================================================= =================|
| 1 | int $token | Dim $token as Integer |
| 2 | printf("%d",$token) | print $token |
================================================== =================
Is the XML format and translation method I propose sufficient. Please
consider that the conversion is 100% possible (meaning my translator
excludes C's asm, pointers etc.)