next up previous
Next: Programs Up: The ALLCOT syntax Previous: Statements

Arithmetic and boolean expressions

Here is a grammar for the arithmetic expressions and boolean expressions of ALLCOT.

ArithmeticExpression $ \longmapsto$ E
E $ \longmapsto$ E + T
E $ \longmapsto$ E - T
E $ \longmapsto$ T rem T
E $ \longmapsto$ T
T $ \longmapsto$ T * F
T $ \longmapsto$ F
F $ \longmapsto$ ( E )
F $ \longmapsto$ num
F $ \longmapsto$ id
F $ \longmapsto$ AttributeCall
BooleanExpression $ \longmapsto$ B
B $ \longmapsto$ E = E
B $ \longmapsto$ E $ \bf {\sim}=$ E
B $ \longmapsto$ E $ \bf <$ E
B $ \longmapsto$ E $ \bf <=$ E
B $ \longmapsto$ B and B
B $ \longmapsto$ B or B
B $ \longmapsto$ ( B )
B $ \longmapsto$ not B
B $ \longmapsto$ AttributeCall
The meaning of operators +, -, rem, *, =, $ \bf <$, $ \bf <=$, and, or and not are as usual. The operator $ \bf {\sim}=$ stands for the different predicate. The terminal num stands for integer values.


next up previous
Next: Programs Up: The ALLCOT syntax Previous: Statements
Marc Moreno Maza
2004-12-01