next up previous
Next: Actual parameters Up: Avoiding conflicts in the parser Previous: The return statement

Allowing ArithmeticExpression to be a Statement

For function returning an arithmetic or a boolean expression like
equal?(x: %, y: %): Boolean == (x.n) = (y.n); 
it may be useful to add the rule
Statement $ \longmapsto$ RightValue
where RightValue is now defined by
RightValue $ \longmapsto$ FunctionCall
RightValue $ \longmapsto$ ArithmeticExpression
RightValue $ \longmapsto$ BooleanExpression
You may also refuse the above function definition and prefer
equal?(x: %, y: %): Boolean == return ((x.n) = (y.n)); 
as in JAVA.


next up previous
Next: Actual parameters Up: Avoiding conflicts in the parser Previous: The return statement
Marc Moreno Maza
2004-12-01