An AltaRica description is a list of declarations of domains, constant values and nodes. As a rule of thumb in AltaRica, an object can not be used before its declaration.
Reserved words and symbols
The following words and punctuation symbols are reserved by the AltaRica language:
- Reserved keywords:
and assert bool case const domain edon else event extern false flow if imply init integer max min mod node not or param param_set sig sort state struct sub sync tcurts then trans true
- Reserved symbols:
? |- -> { } != <= >= < > = := | & => ; , . ( ) [ ] + - * ~ /
The AltaRica language is case insensitive for AltaRica keywords.
Comments
C/C++ comment styles are permitted; below are some examples:
1 /* a C like comment on one line */ 2 3 /* Another comment. 4 * Note that C comments cannot be nested 5 */ 6 7 // This is a C++ like comment. It starts with the two backslashes 8 // and terminates at the end of the line
Identifiers
The language supports two kinds of identifiers:
- Either the ones used in programming languages (except that ‘ and ^ characters are allowed) i.e. those matching the following regexp:
[a-zA-Z_][a-zA-Z_0-9'^]*
- Or any string surrounded by single (‘) or double (“) quotes:
'[^']+' | "[^"]*"
Expressions
AltaRica permits many kind of expressions:
- Comparisons:
=
,!=
,<=
,>=
,<
,>
,min
,max
- Arithmetic operations:
+
,*
,/
,mod
- Boolean operators:
and
(&
),or
(|
),not
(~
),imply
(=>
) - If-Then-Else:
(
a?
b:
c)
or equivalently(if
athen
belse
c)
- Case statement:
case {
cond1:
value1,
cond2:
value2, ...,
condn:
valuen, else
defvalue}