bison-patches
[Top][All Lists]
Advanced

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

Re: FYI: default %printer/%destructor


From: Joel E. Denny
Subject: Re: FYI: default %printer/%destructor
Date: Fri, 24 Nov 2006 12:30:18 -0500 (EST)

On Thu, 23 Nov 2006, Paul Eggert wrote:

> > I still wonder if ISO EBNF is the right language.  Aren't most 
> > Lex and Yacc users more familiar with notations like "(...)*", "(...)?", 
> > and "(...)+"?
> 
> Yes, quite likely.  I wouldn't be a slave to ISO EBNF (particularly
> since we're already incompatible with it :-), but it can't hurt to be
> inspired by it.

Then we need not fuss over [] being for options anymore.

> > The argument there isn't about the choice of "/" or "#" or "()" or "[]".  
> > It's about the choice of "!" (or "-" in the current discussion) to mean 
> > nothing.  I prefer the empty string to mean nothing.
> 
> OK, how about this idea?  If rules use the syntax S$A to mean that the
> symbol S has a value that can be called $A within an action, then
> let's use plain S to mean the symbol doesn't have a value.

What about default names?  Must the user write?

  grammar$grammar: rules$rules decls$decls epilogue$epilogue {
    $grammar = new_grammar ($rule, $decls, $epilogue);
  }
  ;

I prefer:

  grammar: rules decls epilogue {
    $grammar = new_grammar ($rule, $decls, $epilogue);
  }
  ;

Also, why $ now instead of #?  $ makes it look like it works for values 
and not locations.




reply via email to

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