octave-maintainers
[Top][All Lists]
Advanced

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

@ ( ARG_LIST ) STATEMENT syntax


From: John W. Eaton
Subject: @ ( ARG_LIST ) STATEMENT syntax
Date: Wed, 4 Aug 2004 17:24:25 -0400

I started working on the

  @ ( ARG_LIST ) STATEMENT

syntax.  It is not as simple as I originally thought.  The first thing
I realized is that the function body can be a single statement or
expression (in Octave's parser, that is a "statement" non-terminal),
not just an expression.  But that is not a big problem.  The real
trouble is that my changes to the parser result in 114 shift/reduce
conflicts and 15 reduce/reduce conflicts (up from just 11 shift/reduce
conflicts)!  I think they are all actually OK in that the action that
the parser takes when it encounters an ambiguity in the grammer is the
action we want.  But it is not very satisfying.  The reason for the
ambiguity appears to be either the result of allowing assignments as
expressions or that this stupid new syntax has no marker for
the end of the statement or expression.  If it were just something
like

  @ ( arg_list ) statement end

then all the additional conflicts would disappear.  And then it would
be obvious that we could just as easily write

  @ ( arg_list ) STATEMENT_LIST end

still without adding additional ambiguities to the grammar, AND the
whole thing would be much more flexible and powerful.

$#@"&address@hidden@()$!!!!

jwe



reply via email to

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