On Sat, Jul 26, 2014 at 11:10 AM, Sylvain Pointeau <
sylvain.point...@gmail.com> wrote:

> Hello,
>
> I would like to know if %wildcard is an undocumented feature on purpose, is
> this safe to use it?
>

Historical note:  I wrote Lemon back in the 80s (on a Sun3, IIRC) because
the $1,$2,$3 notation of Yacc wasn't working for me and also because Yacc
wanted the parser to call the lexer, not the other way around, and because
it was difficult to stop memory leaks in Yacc when there was a syntax
error.  There was a companion LL(1) parser generator called "Lime" which
has been lost.   Lemon was originally a bunch of separate source files,
many of which were automatically generated.  But at some point I
concatenated them all together into the single "lemon.c" file.  All that
happened prior to the beginning of SQLite.  Anyhow, the current lemon.c
code is a mess, for which I apologize.  But it does mostly work, so I've
never gotten around to rewriting it from scratch, which is what it
desperately needs.

The %wildcard token matches any token that cannot be matched by another
rule in the current context.

I had to add the %wildcard feature to the parser generator when we added
virtual tables to SQLite back in 2006 - in order to support the full text
search extension.  The virtual table syntax allows one put any arbitrary
sequence of tokens as the argument, as long as parentheses match up.
Keywords, literals, operators - any tokens are allowed.  And the most
memory-efficient way to do that was to enhance the parser generate with
some special features to support it.  Hence:  "%wildcard".

The lack of documentation is probably just because we never got around to
it....


> if yes, could it be added in the documentation?
>

Do you have a patch :-)


>
> ps: I am pretty impressed by lemon, I am really having fun.
>
> Best regards,
> Sylvain
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to