[antlr-interest] ANTLR beginner problem

Oliver Drewien oliver.drewien at oracle.com
Tue Jul 10 03:20:53 PDT 2007


Hi,

So if I use System.out.println(output.toString()) I would expect:
; compute 3+4*5
ldc 3
ldc 4
ldc 5
imul
iadd

BUT I GOD:

; compute
istore  ;

If I use the statement System.out.println(output.toDebugString());  then
I got following output:

template-<assign([varNum, v, descr, id])@16>:chunks=[; compute ,  descr,
,  v,
, istore ,  varNum,  ; ,  id]attributes=[maxLocals=1,instructions=[;
compute 3+4*5
ldc 3
ldc 4
ldc 5
imul
iadd],maxStackDepth=4]

Any idea whats wrong with toString()? Or do you think something is wrong
with the code (see attachement)?

Thanks for helping an ANTLR beginner....

Oliver











-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ByteCode.stg
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20070710/e6b31c9e/attachment.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Franziska.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20070710/e6b31c9e/attachment-0001.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Gen.g
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20070710/e6b31c9e/attachment-0002.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Test.java
Url: http://www.antlr.org/pipermail/antlr-interest/attachments/20070710/e6b31c9e/attachment-0003.pl 


More information about the antlr-interest mailing list