[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Purity of yyerror etc.
From: |
Akim Demaille |
Subject: |
Re: Purity of yyerror etc. |
Date: |
04 Nov 2002 08:29:53 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
| > 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.
Yes, I know all this, but I preferred have it language-portable from
the beginning. Plus, you can have more complex parameters, such as
%parse-param { ast_t ast[] } { ast }.
| 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.
Yes, that's sure. Well, if you really prefer the lighter syntax,
let's go for it.