Hi guys,
I committed the first testable version of the translator, in which you can:
- define a variable
- assign a value to the variable
- use a forever loop
- create all possible expressions with the operators:
AMP
ASTERIX
BANG
CARET
EQUAL
GREATER
GREATER_EQUAL
LEFT_SHIFT
LESS
LESS_EQUAL
MINUS
NOT_EQUAL
OR
PERCENT
PLUS
RIGHT_SHIFT
SLASH
Feel free to check if 'all complex expressions' work.
For those on windows, I checked in jalparser.exe, so you don't need to
build the app. Just put your test code in test.jal like:
var byte c, d,e
c = 10
e = 5
d=c/e
;@j2c printf("%d\n", d);
and then execute 'maketest.bat', which requires a gcc compiler and
(temporary) perl to be installed (install strawberry perl and you have
both). Your target program is test.exe.
As you might have guessed, ;@j2c is the prefix for c-code. printf
prints text, based on a format string. %d prints a decimal value of an
int (byte, word) and you should supply an actual value for each %d,
so:
;@j2c printf("d: %d, c: %d e: %d\n", d, c, e);
prints the value of all three variables, with the text label before it
and a comma after.
If you find a test-case that does not have the expected output, send me:
- test.jal
- test.txt (yes, TXT. this is the raw output of the parser, from which
the perl script extract the actual c code)
- a note saying what the code should produce and what it actually produced.
Joep
--
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.