next up previous
Next: Constraint Up: Data Previous: Variable

Expression

Expressions are built on top of constants and variables using a rich set of operators, including standard boolean operators, arithmetic operators, and comparison operators. Also, standard `.' and `[]' operators are used to access respectively fields in structured variables, or elements in arrays. In addition, we define a cast-operator allowing to convert, for instance, pid or enum values to integers (and back) and the active operator to test the activity of clocks. Finally, conditional expressions are allowed too.


xxxxxxxxxxxxxxxxxxexpression ::=  

const $\vert$
variable-id $\vert$ fpar-id $\vert$
expression . field-id $\vert$ expression [ expression ] $\vert$
function-id ( $[$ expression { , expression }$^*$ $]$ ) $\vert$
un-op expression $\vert$
expression bin-op expression $\vert$
cast-op expression $\vert$
expression $?$ expression $:$ expression $\vert$
( expression )

un-op ::=
not $\vert$
active $\vert$
$+$ $\vert$ $-$

bin-op ::=
or $\vert$ and $\vert$
$=$ $\vert$ $<>$ $\vert$ $<$ $\vert$ $<=$ $\vert$ $>=$ $\vert$ $>$ $\vert$
$+$ $\vert$ $-$ $\vert$ $*$ $\vert$ $/$ $\vert$ $\%$

cast-op ::=
{ type-id $\vert$ process-id $\vert$ signalroute-id }


next up previous
Next: Constraint Up: Data Previous: Variable