bison-patches
[Top][All Lists]
Advanced

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

Re: <reductions>


From: Joel E. Denny
Subject: Re: <reductions>
Date: Tue, 16 Oct 2007 19:04:29 -0400 (EDT)

On Tue, 16 Oct 2007, Wojciech Polak wrote:

> On 2007-10-14 at 15:53 -0400, Joel E. Denny wrote:
> 
> > >     <nonterminals>
> > >       <nonterminal type="9" symbol="$accept">
> ... 
> > >       </nonterminal>
> > >     </nonterminals>
> > >   </grammar>
> > 
> > > It seems to me that the "symbol" attribute above ought to be "name", and 
> > > "type" ought to be "number".
> > 
> > Wojciech, what do you think about changing these attribute names?
> > In my mind, a nonterminal or terminal *is* a symbol.  It doesn't
> > *have* a symbol attribute.  It does have a "name".
> 
> Sure, I know both are symbols.
> For grammar/rules/rule/rhs/ I made a "symbol" element with a "class"
> attribute (nonterminal|terminal) and "name" as this element value.
> I guess this is the form you would like to see in grammar/terminals
> and ->/nonterminals.

I like that terminal and nonterminal are different elements with, 
potentially, a different set of attributes.  For example, terminal may 
need an "alias" attribute.  I just meant to point out that "symbol" as an 
attribute doesn't make sense.  It should be "name".

> Now, I'm trying to recall why I chose grammar/terminals/terminal
> and grammar/nonterminals/nonterminal and it seems that the only
> reason was to maintain a certain logic in the naming, so that the
> element named in plural (<terminals>) contains several elements named
> in singular (<terminal>), etc.

This seems fine to me.




reply via email to

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