- Qaqao_compiler_script ::
Sequential_list{Qaqao_script_message}
- Qaqao_script_message ::
- Import_message ::
-
Tuple [“import”
Concurrent_list (Tuple [“objects”
‘«’
Concurrent_list (Identifier)] |
Tuple [“packages”
‘«’
Concurrent_list (Identifier)])]
The outer list must contain one or two elements:
a single tuple beginning with the string “objects”,
and/or a single tuple beginning with the string “packages”.
- Export_message ::
-
Tuple [“export”
Concurrent_list (Tuple [“objects”
‘«’
Concurrent_list (Simple-identifier)] |
Tuple [“to-packages”
‘«’
Concurrent_list (Identifier)])]
The outer list must contain exactly two elements:
a single tuple beginning with the string “objects”
and a single tuple beginning with the string “to-packages”.
- Interface_message ::
-
Tuple [“interface”
Concurrent_list (Tuple [“declarations”
‘«’
Concurrent_list (Declaration_statement)])]
The outer list must contain exactly one element:
a single tuple beginning with the string “declarations”.
- Implement_message ::
-
Tuple [“implement”
Concurrent_list (Tuple [“declarations”
‘«’
Concurrent_list (Declaration_statement)] |
Tuple [“definitions”
‘«’
Concurrent_list (Definition_statement)])]
The outer list must contain one or two elements:
an optional tuple beginning with the string “declarations”,
and a single tuple beginning with the string “definitions”.
- Definition_statement ::
-
Tuple [“define” Bound_expression
“as” Statement]
2.1.2 Qaqao Statements
- Statement ::
BreakFromLoopIf_statement
- Declaration_statement ::
-
Tuple [Declarative_expression
Simple_expression]
- Binding_statement ::
-
Tuple [Bound_expression
‘«’ Expression]
- Send_statement ::
-
Tuple [Bound_expression
‘←’ Bound_expression]
- Receive_statement ::
-
Tuple [Expression
‘→’ Bound_expression]
- SendReceive_statement ::
-
Tuple [Bound_expression
‘←’ Bound_expression
‘→’ Bound_expression]
- Local_statement ::
-
Tuple [“local” Statement]
- Sequential_statement ::
-
Sequential_list {Statement}
- Concurrent_statement ::
-
Concurrent_list (Statement)
- If_statement ::
-
Tuple [“if” Simple_expression
“thenDo” Statement
(“elseIf” Simple_expression
“thenDo” Statement)*
(“elseDo” Statement)?]
- Case_statement ::
-
Tuple [“case” Simple_expression
“of”
Concurrent_list (Tuple
[“when” Concurrent_list (Simple_expression)
“do” Statement])
(“elseDo” Statement)?]
- Loop_statement ::
-
Tuple [“loop”
Sequential_statement]
- ForEach_statement ::
-
Tuple [“forEach” Simple_identifier
“in” Expression
“do” Statement]
- ForAll_statement ::
-
Tuple [“forAll” Simple_identifier
“in” Expression
“do” Statement]
- BreakFromLoopIf_statement ::
-
Tuple [“breakFromLoopIf”
Simple_expression]
NOTE: A BreakFromLoopIf statement is only allowed in the body
of a Loop or a ForEach statement.
At least one such statement must occur in the body of every Loop
statement, outside the body of any nested loop (including ForAll
loops.
2.1.3 Qaqao Expressions
- Expression ::
- Simple_expression ::
- Declaration_expression ::
-
Tuple [Declarative_expression
Simple_expression]
- Send_expression ::
-
Tuple [Bound_expression
‘←’ Bound_expression]
- Let_expression ::
-
Tuple [“let” Statement
“in” Expression]
- Sequence_expression ::
-
Sequential_list {Expression}
- Vector_expression ::
-
Concurrent_list (Expression)
- If_expression ::
-
Tuple [“if” Simple_expression
“then” Expression
(“elseIf” Simple_expression
“then” Expression)*
“else” Expression]
- Case_expression ::
-
Tuple [“case” Simple_expression
“of”
Concurrent_list (Tuple
[“when” Concurrent_list (Simple_expression)
“yield” Expression])
“elseYield” Expression]
- ForEach_expression ::
-
Tuple [“forEach” Simple_identifier
“in” Expression
“yield” Expression]
- ForAll_expression ::
-
Tuple [“forAll” Simple_identifier
“in” Expression
“yield” Expression]
- Infix_expression ::
-
Tuple [Operator* Expression
(Operator+ Expression)*]
- Declarative_expression ::
-
Declarative_parameter_expression
- Declarative_parameter_expression ::
-
Tuple [Simple_identifier
Concurrent_list (Parameter_declaration_expression)]
- Parameter_declaration_expression ::
-
Tuple [Simple_identifier Simple_expression
(“default” Expression)?]
- Bound_expression ::
-
Bound_parameter_expression
- Bound_parameter_expression ::
-
Tuple [Simple_identifier
Concurrent_list (Parameter_binding_Expression)]
- Parameter_binding_expression ::
-
Tuple [Simple_identifier
‘«’ Expression]
- Identifier ::
-
2.1.4 Infix Expressions
Standard Qaqao Operators
| Category |
Operator |
Unicode |
Operation |
Associativity |
| Parenthetical |
⌈ ⌉
⌊ ⌋
〈 〉 |
&u+2308 &u+2309
&u+230A &u+230B
&u+2329 &u+232A |
ceiling
floor
absolute value |
parenthetical |
| Sign |
− |
&u+2212 |
negate |
prefix |
| Exponential |
↑ |
&u+2191 |
exponentiate |
right |
| Multiplicative |
× ÷ % |
&u+00D7 &u+00F7 &u+0025 |
multiply divide remainder |
left |
| Additive |
+ − |
&u+002B &u+2212 |
add subtract |
left |
| Shifting |
↞ ↠ |
&u+219E &u+21A0 |
shift left shift right |
left |
| Comparative |
≡ = ≠ < ≤ > ≥ |
&u+2261 &u+003D &u+2260 &u+003C
&u+2264 &u+003E &u+2265 |
identical to equal to not equal to less than
less than or equal to greater than
greater than or equal to |
none |
| Negative |
¬ |
&u+00AC |
not |
prefix |
| Conjunctive |
∧ |
&u+2227 |
and |
left |
| Disjunctive |
∨ |
&u+2228 |
or |
left |
Qaqao Language Definition, section 2.2, version 0.34α
© J. Andrew Holey, 2009
email: jholey@csbsju.edu