Hi guys,

The program below is converted into C, compled and runs!

var byte d

forever loop
   d=d+1
   ;@j2c printf("%d\n", d);
end loop

Note that I use ';@j2c' (like ;@jallib) as a tag to pass a comment (in
JAL terms) to the convertor. For now, the convertor has no control
options itself and passes the code to the C source. And for the ones
interesed, the generated code (mainly comment ;) is below.

There is still a long way ahead before the convertor supports all JAL
features, but completing the full path - although with a simple
program - is a major milestone!

Joep

// Jal -> C code converter
#include <stdio.h>

int main(int argc, int **argv) {
         // CgStatement
         // VAR (4, VAR)
            // CgVar
             unsigned char
             d;
         // CgStatement
         // forever (22, L_FOREVER)
            // CgForever
             for (;;) {
                  // CgStatement
                  // = (15, ASSIGN)
                     // CgAssign
                     d  = // CgAssign identifier
                        // CgExpression
                        ( // start subexpr
                           // CgExpression
                           d // constant or identifier
                        )+( // tostring
                           // CgExpression
                           1 // constant or identifier
                        ) // end subexpr
                  ; // end of assign
                  // CgStatement
                  // ;@j2c printf("%d\n", d); (10, J2C_COMMENT)
                    printf("%d\n", d);
            }
} // end of main
// Jal -> C END

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to