Ok.  No problem I can take care of the memory issues.

That being said, I've run into a huge roadblock.  I'm using flex which
produces lex.yy.c which includes <errno.h> and <unistd.h>.  Since I'm
working in WinCE (eVC 4.2) neither of these includes exist.  Sigh.  I
think I'm hosed.  If I build my lexer with flex++, it still includes
<unistd.h> and <iostream.h>.

Has anyone had any luck with flex and wince?  Can you recommend another
lexer?

RW

Ron Wilson, Senior Engineer, MPR Associates, 518.831.7546

-----Original Message-----
From: Joe Wilson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 20, 2007 11:15 PM
To: sqlite-users@sqlite.org
Subject: RE: [sqlite] a few lemon questions

--- "Wilson, Ron" <[EMAIL PROTECTED]> wrote:
> 1. My non-terminal token destructors are not getting called.  The
> terminal destructors work fine, but none of my terminal tokens need
> destruction.  Two of my non-terminals definitely require destruction.
I
> have properly defined the %destructor and instrumented the destructor
> code with std::cout << "in destructor" << std::endl;.  They are simply
> not being called.  Ever. 

The destruction of well-formed parsed tree objects is your
responsibility.

See the comment below in the generated code as to the conditions when 
the destructor is called. If you use the symbol in the C code action
of the rule, the destructor will not be invoked. (It wouldn't be a
useful
feature if the destructor was called unconditionally by each action!)

Looking at lemon.c for the { C code }, I think it skips C/C++ code 
comments and quoted characters and strings when searching for rule 
symbols. Clever stuff.

parse.y:

 372 %type select {Select*}
 373 %destructor select {sqlite3SelectDelete($$);}

the generated parse.c file:

/* The following function deletes the value associated with a
** symbol.  The symbol can be either a terminal or nonterminal.
** "yymajor" is the symbol code, and "yypminor" is a pointer to
** the value.
*/
static void yy_destructor(YYCODETYPE yymajor, YYMINORTYPE *yypminor){
  switch( yymajor ){
    /* Here is inserted the actions which take place when a
    ** terminal or non-terminal is destroyed.  This can happen
    ** when the symbol is popped from the stack during a
    ** reduce or during error processing or when a parser is
    ** being destroyed before it is finished parsing.
    **
    ** Note: during a reduce, the only symbols destroyed are those
    ** which appear on the RHS of the rule, but which are not used
    ** inside the C code.
    */
    case 155:
    case 189:
    case 206:
#line 373 "parse.y"
{sqlite3SelectDelete((yypminor->yy219));}





 
________________________________________________________________________
____________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

------------------------------------------------------------------------
-----
To unsubscribe, send email to [EMAIL PROTECTED]
------------------------------------------------------------------------
-----


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to