[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Purity of yyerror etc.
From: |
Paul Eggert |
Subject: |
Re: Purity of yyerror etc. |
Date: |
Sun, 3 Nov 2002 22:28:15 -0800 (PST) |
> From: Akim Demaille <address@hidden>
> Date: 03 Nov 2002 17:50:15 +0100
>
> There is one issue I'm not happy with: the syntax of %parse-param and
> %lex-param. I would much prefer keeping { }, and maybe < > for
> relations with the language underneath (currenly only C), and " " for
> Bison string tokens. So maybe something like:
>
> %parse-param { ast_t *ast } {ast}
>
> or
>
> %parse-param <ast> { ast_t *ast }
I like the idea of using {}. But how about this simpler syntax instead?
%parse-param { ast_t *ast }
The parameter declaration consists of the C code within {}. At first,
Bison can support only C declarations of the usual form, where the
declared identifier comes at the end. If we need to add support later
for full C syntax, we can; but I suspect we won't need to, since it's
always easy to rephrase C declarations to put the declared identifier
at the end.
This syntax avoids the need for duplicating the declared identifier
("ast" in this case), and it makes the %parse-param directive easier
to explain and read.