Re: [antlr-interest] Ter, Would you mind looking at ....
- danreo@... wrote:
>Ok, I did a fast hack on it.
> Hello Ter:
> Would you mind looking at the Pascal grammer in the
> This grammer will not take and run the test cases
> given within the example code.
> It will run thru the Antlr generator and compile in Javac.
> But won't run the first testcase.
1) set AST generation to true,
2) changed the file name comparison to convert the extension
to lower case before comparison. ( otherwise it would work
in MS environ where upper==lower, but not in Unix.
3) Put in a tree action so that you can see the tree generated.
after building, type in
% java PascalParser -showtree P_0_1.PAS
However I am a little confused abot what you are trying
to do with this. I hope you realize that this will not
generate or execute the parsed object. It has no
interpreter , or executable code generator. It will
only parse and get out. So when it says parsing,
that is all you will get. Unless there are errors in
the pascal source code......
I have not looked at this example before. It appears
to be very cleanly written. ( And I noticed written
by another Turk.. like myself....)
Anyway, if you want to pursue this, I will help you. But
you wil have to put in the treewalker/interpreter.
tinybasic is an example of an interpreter. as far
as I know it is the only one that does interpretation
other than the calcAST example....