[antlr-interest] Re: Constructors

jsrs701 jsrs701 at yahoo.com
Mon Jun 10 12:23:46 PDT 2002


--- In antlr-interest at y..., Ric Klaren <klaren at c...> wrote:
> On Sun, Jun 09, 2002 at 09:50:51PM -0000, johnclarke72 wrote:
> > I know how to define extra methods within my grammar but how can 
I 
> > write my own Constructors within a grammar. Essentially I want to 
add 
> Just add them:
> 
> header { // headerstuff }
> 
> { // for c++ this goes into the generated .cpp file
> // extra constructor implementation
> MyParser::MyParser( .. .. .. )
> {
> }
> 
> }
> class MyParser extends Parser;
> {
> // for java the implementation goes here as well (i think)
> MyParser( .. .. .. .. );
> 
> }


If you haven't already, be sure to check out 
http://www.antlr.org/doc/cpp-runtime.html#_template and read it over 
very carefully!


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list