[antlr-interest] how can i get a return string from the parser

Su Zhang westlifezs at gmail.com
Sun Nov 23 12:38:28 PST 2008


Hi Gavin

but the class cannot be applied by the outside source, right? then how can
get the value out of the program? i mean i want to call the function in the
main function, yet it is generated in the internal class of the parser
class, right? then how can i get this value in the main fuction?

thank you

Su
2008/11/23 Gavin Lambert <antlr at mirality.co.nz>

> At 06:52 24/11/2008, Su Zhang wrote:
>
>> My program needs a string from Parser, but there is not any function
>> provided in the public class parser, how can I get the string outside? I
>> mean I want to get the string generated from the rules of antlr(functions in
>> parser), and I have written  "returns[String s]" to indicate that I need the
>> value, but how can i get the String? does anybody familiar with this kind of
>> problem?
>>
>
> It's a return value.  That means it's actually returned from the parser
> method.  (Depending on your grammar, it might be returned directly or inside
> a structure.  Examine the generated code.)
>
>


-- 
Su Zhang
PHD Candidate
Computer Information and Science
Kansas State University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081123/9454d320/attachment.html 


More information about the antlr-interest mailing list