[sqlite] lemon problem with two versions of lempar.c

2015-04-16 Thread Neo Anderson
I am utilizing lemon in one of my Apple Store Apps. My parser works fine with 
the 'old' lempar.c found in source tree TRUNK/tool/.I also found a 
newer version in TRUNK/src, but when I compile myparser.c generated using this 
lempar.c, I got compilation errors:test.c:376:7: error: use of 
undeclared identifier 'NEVER' if( NEVER(pParser-yyidx0) ) 
return 0;How can I solve this error? BTW, does this newer lempar.c 
benefit my parser more than the old one?



[sqlite] lemon problem with two versions of lempar.c

2015-04-15 Thread Richard Hipp
On 4/15/15, Neo Anderson  wrote:
> I am utilizing lemon in one of my Apple Store Apps. My parser works fine
> with the 'old' lempar.c found in source tree TRUNK/tool/.I also
> found a newer version in TRUNK/src, but when I compile myparser.c generated
> using this lempar.c, I got compilation errors:test.c:376:7: error:
> use of undeclared identifier 'NEVER' if(
> NEVER(pParser-yyidx0) ) return 0;How can I solve this error?
> BTW, does this newer lempar.c benefit my parser more than the old one?
>   

Use the one in tool/lempar.c.  The template in src/lempar.c contains
SQLite-specific modifications.
https://www.sqlite.org/src/fdiff?sbs=1=01ca97f8=7274c97
-- 
D. Richard Hipp
drh at sqlite.org


Re: [sqlite] Lemon problem

2007-11-18 Thread Téragone
Hello,

I finally find the bug. In fact that was many bugs.

- Grammar rule order.
- Input string not reseted properly.

Thank you.

David
On Nov 18, 2007 10:30 AM, Joe Wilson <[EMAIL PROTECTED]> wrote:

> It's most likely your bug. Just add some debug prints in your grammar
> and tokenizer to see what's going on.
> See also: ParseTrace() in http://www.hwaci.com/sw/lemon/lemon.html
>
> --- Téragone <[EMAIL PROTECTED]> wrote:
> > I have a problem with a rule of a small calculator which accept
> variables :
> >
> > assignment(A) ::= VARIABLE(C) EQUAL expr(B).
> >
> > I can set variable with simple value or expression like :
> > a=2
> > b=2+3
> >
> > but when I try :
> > c=a+b
> >
> > The result is put in variable b instead of c.
> >
> > Is it my bug or a Lemon bug ?
>
>
>
>
>  
> 
> Be a better pen pal.
> Text or chat with friends inside Yahoo! Mail. See how.
> http://overview.mail.yahoo.com/
>
>
> -
> To unsubscribe, send email to [EMAIL PROTECTED]
>
> -
>
>


Re: [sqlite] Lemon problem

2007-11-18 Thread Joe Wilson
It's most likely your bug. Just add some debug prints in your grammar 
and tokenizer to see what's going on.
See also: ParseTrace() in http://www.hwaci.com/sw/lemon/lemon.html

--- Téragone <[EMAIL PROTECTED]> wrote:
> I have a problem with a rule of a small calculator which accept variables :
> 
> assignment(A) ::= VARIABLE(C) EQUAL expr(B).
> 
> I can set variable with simple value or expression like :
> a=2
> b=2+3
> 
> but when I try :
> c=a+b
> 
> The result is put in variable b instead of c.
> 
> Is it my bug or a Lemon bug ?



  

Be a better pen pal. 
Text or chat with friends inside Yahoo! Mail. See how.  
http://overview.mail.yahoo.com/

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



[sqlite] Lemon problem

2007-11-18 Thread Téragone
Hello,

I have a problem with a rule of a small calculator which accept variables :

assignment(A) ::= VARIABLE(C) EQUAL expr(B).

I can set variable with simple value or expression like :
a=2
b=2+3

but when I try :
c=a+b

The result is put in variable b instead of c.

Is it my bug or a Lemon bug ?

Thank you,
David