bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Do not allow identifiers that start with a negative number.


From: Paul Eggert
Subject: Re: [PATCH] Do not allow identifiers that start with a negative number.
Date: Tue, 18 Jan 2011 11:11:20 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 01/15/11 22:28, Alex Rozenman wrote:
> Currently I am very busy with other tasks. Please allow me couple of days to 
> review it.

One other thought, while we're on the subject.  Currently we are handling
bracketed constructs, such a [x], [y], and [z] in this rule:

  foo[x]: foo[y] '+' foo[z];

in a combination of C and lex.  That is, the "[x]" is a single token
in the grammar for Bison grammars, and there's a long bit of C+lex code to
allow things like "[x /*hello*/]" while disallowing things like "[x 
/*hello*/y]".
This is not good.  We have a nice compiler-compiler, and we're not using it,
but instead we have a sortof-parser in C and lex.

We should parse these bracketed constructs with a Bison grammar, so that
"[", "x", and "]" are all single tokens, and so that the grammar tells us
which things are allowed in brackets.

I suspect that the reason it's done the way it is, is because of the old
backward-compatibility concern with rules that do not end in ';'.  But
there's no reason to cater to these backward-compatibility concerns with
this new construct.  No grammars should use this new construct, without
also putting ';' at the end of every rule.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]