Language Translation by Transformation

Two sets of transformations, followed by a relatively simple printing program, can be used to perform source-to-source transformation from one language to another.

Restructuring:


( (setq ?x (+ ?x ?y))   (incf ?x ?y) )

Output Syntax:


((aref ?x ?y)       ("" ?x "[" ?y "]"))
((go ?x)            ("goto " ?x))
((setq ?x ?y)       ("" ?x " = " ?y))
((incf ?x)          ("++" ?x))
((incf ?x ?y)       ("" ?x " += " ?y))
((return ?x)        ("return " ?x))
((while ?p . ?s)    ("while ( " ?p " ) "
                       #\Tab #\Return
                       (progn . ?s)))

Contents    Page-10    Prev    Next    Page+10    Index