On 19 Ott, 21:04, "news.rz.uni-karlsruhe.de" <u...@[EMAIL PROTECTED]
> wrote:
> Three questions:
>
> I need a parser which can do the following....
>
> 1.) getting called from my java program like parse( String MyString ) (
can
> be done by changing the main routine in *.jj file, ok ).
You can program your class in the .jj file as you prefer, provided
that you follow the JavaCC grammar.
Please, mind that, generally input output are not carried out by any
explicit argument. Instead input is associated to the grammar at
initialization time.
When you create the singleton grammar instance you have to specify a
Reader that, in turn, can be obtained from a String.
Please, refer to
3.2 How do I read from a string instead of a file?
http://www.engr.mun.ca/~theo/JavaCC-FAQ/javacc-faq-moz.htm#tth_sEc3.2
to get an example about how to read from a string.
Sorry if I do not answer to the questions for point 2), but I'm a
beginner yet.
Ciao
Cesare


|