See the other responses from Ivar and myself - I think your use of the 
variable name "input" is the problem.  If you're still experiencing 
issues, can you send the entire grammar and your test harness?  (I could 
not get the antlr-generated code from the grammar you included to 
compile without modifications.)

-Jared

Su Zhang wrote:
> I even can not get a constant value after the clause ,like 
> "retval.start = input.LT(1); System.out.println("result");" when I 
> call the function there is not any return value, but when I change the 
> format like this" System.out.println("result");retval.start = 
> input.LT(1);", I can get the output in console, do you or anybody know 
> why this happened, and what the LT(1) is doing?
>  
>  
> thank you!
>        
>
> 2008/11/24 Jared Bunting <[EMAIL PROTECTED] 
> <mailto:[EMAIL PROTECTED]>>
>
>     Look at the definition of that return class.  It should have a
>     field "t" that is a String.  That is your return value.
>
>     On Sun, Nov 23, 2008 at 11:49 PM, Su Zhang <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
>
>         yes, i have, it has a prog_return class in the code, but it
>         isnot the String type,do you know how can I take the value as
>         a string out of the code?
>
>         2008/11/23 Terence Parr <[EMAIL PROTECTED]
>         <mailto:[EMAIL PROTECTED]>>
>
>
>             On Nov 23, 2008, at 7:47 PM, Su Zhang wrote:
>
>                 Hi all,
>
>                 I wrote a returns [String s] in my rules in order to
>                 get a return value, but when I call the function
>                 generated by the exact rule in the main function,
>                 there is not any return value, and the type of return
>                 value is not a String, and the value includes a tree
>                 structure,etc, but I define it as a string in the
>                 antlrworks, does anybody know what's the problem in my
>                 project? how can i get the return String I defined? I
>                 am almost crazy about this annoying problem,
>                 here is a part of my grammar:
>
>
>             hi. have you looked at the generated code?  It should have
>             a t in the object returned from that rule.
>
>             Ter
>
>
>
>
>         -- 
>         Su Zhang
>         PHD Candidate
>         Computer Information and Science
>         Kansas State University
>
>
>         List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
>         Unsubscribe:
>         
> http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address
>
>
>
>
>
>
> -- 
> Su Zhang
> PHD Candidate
> Computer Information and Science
> Kansas State University

List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" 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/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to