help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Token types with constructor


From: Laurence Finston
Subject: Re: Token types with constructor
Date: Sat, 28 Aug 2004 21:42:12 +0200
User-agent: IMHO/0.98.3+G (Webmail for Roxen)

> 2) I don't want to use new and delete in every rule (that is why I don't
> like to use pointers to Objects)

It's not necessary to use them in every rule.  It's necessary to use `new' 
when one needs a new temporary and `delete'
when one is finished with it.  It's also necessary to use `new' when creating
a persistent object, but in my application, these are not deleted in the
parser actions.

If you're creating objects dynamically, I think it's six-of-one, half-a-dozen
of the other (Jacke wie Hose) whether  you do so in the scanner or the parser.

If you want to see how I use this technique, my sources are available for
downloading from
http://savannah.gnu.org/cgi-bin/viewcvs/3dldf/3dldf/Group/CWEB/

The sources for the parser are in the files with names of the pattern "p*.w",
e.g., `parser.w', `pldfdcl.w', etc.
   
Laurence



reply via email to

[Prev in Thread] Current Thread [Next in Thread]