[antlr-interest] philosophy about translation
Jim O'Connor
Jim.O'Connor at microfocus.com
Fri Oct 6 08:08:52 PDT 2006
Hi All,
Cool discussion. How does the concept of a generic language or
AST fit? The generic AST is the universe of all possible language
constructs.
Andy has the transformations like
>>ADD v1 TO v2. --> v2 += v1;
>>ADD v1 v2 TO v3 v4. --> v3 += v1 + v2; v4 += v1 + v2
>>ADD v1 TO v2 GIVING v3. --> v3 = v1 + v2;
This concentrates on transforming COBOL to Java. (Ha, ha, "I don't want
JOBOL!")
The generic language would add another step:
COBOL -> generic language -> JAVA. In the general case, any specific
language -> generic language. Generic language -> any specific
language.
ADD v1 to v2 ->
(G_ASSIGNMENT (MOD_VAR v2) (OPER_ADD (REF_VAR v1) (REF_VAR v2)))
The "COBOL to generic process" focuses on the "make generic" process. I
can't make JOBOL because I'm making generic. The "generic to JAVA"
makes classes, main methods, file reads etc... from generic.
What if a generic construct cannot be handled by a specific language?
This is tough question. It is an easier question than "How do I
translate a Java class to COBOL?"
I'll stop there for now.
Generic language == textual object code??
Jim
Microfocus Revolve
More information about the antlr-interest
mailing list