This will output the steps the parser does (reduce, shift, fallback,...) but 
not the syntax tree.

-----Urspr?ngliche Nachricht-----
Von: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-bounces at mailinglists.sqlite.org] Im Auftrag von Domingo 
Alvarez Duarte
Gesendet: Montag, 18. J?nner 2016 15:55
An: SQLite mailing list
Betreff: Re: [sqlite] Wish list: allow developers use the power ofsqliteparser

Thank you for your reply !

It seems that we already have something done, after your suggestion I looked at 
the sqlite3 sources and found this function:

#ifndef NDEBUG
/*
** Turn parser tracing on by giving a stream to which to write the trace
** and a prompt to preface each trace message.  Tracing is turned off
** by making either argument NULL
**
** Inputs:
** <ul>
** <li> A FILE* to which trace output should be written.
**      If NULL, then tracing is turned off.
** <li> A prefix string written at the beginning of every
**      line of trace output.  If NULL, then tracing is
**      turned off.
** </ul>
**
** Outputs:
** None.
*/
void sqlite3ParserTrace(FILE *TraceFILE, char *zTracePrompt){
  yyTraceFILE = TraceFILE;
  yyTracePrompt = zTracePrompt;
  if( yyTraceFILE==0 ) yyTracePrompt = 0;
  else if( yyTracePrompt==0 ) yyTraceFILE = 0; } #endif /* NDEBUG */


Maybe it can be a possible answer for the original question ?

Anyone used it ?

What's it's output like ?

Cheers !


>  Mon Jan 18 2016 3:36:05 pm CET CET from "Simon Slavin"
><slavins at bigfraud.org>  Subject: Re: [sqlite] Wish list: allow
>developers use the power ofsqliteparser
>
>  On 18 Jan 2016, at 2:20pm, Domingo Alvarez Duarte
><sqlite-mail at dev.dadbiz.es> wrote:
>
>
>>Can we have something that do not remove your freedom and can provide
>>a way  to reuse the parser power ?
>>

>  In the amalgamation source code you will find
>
> /*
> ** The interface to the LEMON-generated parser */ SQLITE_PRIVATE void
> *sqlite3ParserAlloc(void*(*)(u64));
> SQLITE_PRIVATE void sqlite3ParserFree(void*, void(*)(void*));
> SQLITE_PRIVATE void sqlite3Parser(void*, int, Token, Parse*); #ifdef
> YYTRACKMAXSTACKDEPTH SQLITE_PRIVATE int sqlite3ParserStackPeak(void*);
> #endif
>
> If you remove the PRIVATE from these declarations, you can call the
>functions yourself and have access to the same parser that SQLite uses.
>
> Simon
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
>
>





_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick
Software Engineer
Scientific Games International GmbH
FN 157284 a, HG Wien
Klitschgasse 2-4, A-1130 Vienna, Austria
Tel: +43 1 80100 0
E-Mail: hick at scigames.at

This communication (including any attachments) is intended for the use of the 
intended recipient(s) only and may contain information that is confidential, 
privileged or legally protected. Any unauthorized use or dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please immediately notify the sender by return e-mail message and 
delete all copies of the original communication. Thank you for your cooperation.


Reply via email to