Re: [sqlite] Report a warning bug about Lemon parser

2015-01-23 Thread Richard Hipp
On 1/22/15, Tang Tianyong  wrote:
> Hi, yy_destructor function can not suppress warning about unused
> %extra_argument variable.

Sure it can.  Just add code to one of your destructors that references
the %extra_argument variable.  It doesn't have to actually do anything
with the variable.  If the variable is named "xyzzy" then it will
probably suffice to just say "(void)xyzzy;" inside one of your
destructors.

> My yy_destructor function that Lemon generated
> like this:
>
> ```
> static void yy_destructor(
>   yyParser *yypParser,/* The parser */
>   YYCODETYPE yymajor, /* Type code for object to destroy */
>   YYMINORTYPE *yypminor   /* The object to be destroyed */
> ){
>   COSStyleParseARG_FETCH;
>   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.
> */
> default:  break;   /* If no destructor action specified: do nothing */
>   }
> }
> ```
>
> --
> *By tan...@gmail.com *
> ___
> 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


[sqlite] Report a warning bug about Lemon parser

2015-01-23 Thread Tang Tianyong
Hi, yy_destructor function can not suppress warning about unused
%extra_argument variable. My yy_destructor function that Lemon generated
like this:

```
static void yy_destructor(
  yyParser *yypParser,/* The parser */
  YYCODETYPE yymajor, /* Type code for object to destroy */
  YYMINORTYPE *yypminor   /* The object to be destroyed */
){
  COSStyleParseARG_FETCH;
  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.
*/
default:  break;   /* If no destructor action specified: do nothing */
  }
}
```

-- 
*By tan...@gmail.com *
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users