11 |
| | | | |
| | | | |
12 |
_InputDcl_ | ::= | **input** _ValueType_ Id [ `(` String `)` ] [ `=` _ConstExpr_ ] `;` |
_InputDcl_ | ::= | **input** _ValueType_ Id [ `(` String `)` ] [ `=` _ConstExpr_ ] `;` |
13 |
| | | | |
| | | | |
14 |
_ConstDcl_ | ::= | **const** _ValueType_ Id [ `=` _ConstExpr_ ] `;` |
_ConstDcl_ | ::= | **const** _ConcreteType_ Id [ `=` _ConstExpr_ ] `;` |
15 |
| | | | |
| | | | |
16 |
_GlobalVarDcl_ | ::= | _Type_ Id [ `=` _Expression_ ] `;` |
_GlobalVarDcl_ | ::= | _Type_ Id [ `=` _Expression_ ] `;` |
17 |
| | | | |
| | | | |
24 |
| | | | |
| | | | |
25 |
_StrandDcl_ | ::= | **strand** Id _Parameters_ `{` { _StateVarDcl_ } [ _Block_ ] { _MethodDcl_ } `}` |
_StrandDcl_ | ::= | **strand** Id _Parameters_ `{` { _StateVarDcl_ } [ _Block_ ] { _MethodDcl_ } `}` |
26 |
| | | | |
| | | | |
27 |
|
_StateVarDcl_ | ::= | _ConcreteType_ Id [ `=` _Expression_ ] `;` |
28 |
|
| | | | |
29 |
_MethodDcl_ | ::= | _MethodName_ _Block_ |
_MethodDcl_ | ::= | _MethodName_ _Block_ |
30 |
| | | | |
| | | | |
31 |
_MethodName_ | ::= | **initially** \| **update** \| **stabilize** |
_MethodName_ | ::= | **initially** \| **update** \| **stabilize** |
55 |
| | | | |
| | | | |
56 |
_AssignOp_ | ::= | `=` \| `+=` \| `-=` \| `*=` \| `/=` \| `%=` |
_AssignOp_ | ::= | `=` \| `+=` \| `-=` \| `*=` \| `/=` \| `%=` |
57 |
| | | | |
| | | | |
58 |
_Type_ | ::= | **image** `(` _ConstExpr_ `)` _Shape_ |
_Type_ | ::= | **field** `#` _Dimension_ `(` _ConstExpr_ `)` _Shape_ |
|
| \| | **field** `#` _Dimension_ `(` _ConstExpr_ `)` _Shape_ |
|
59 |
| \| | **kernel** `#` _Dimension_ |
| \| | **kernel** `#` _Dimension_ |
60 |
| \| | _ConcreteType_ |
| \| | _ValueType_ |
61 |
| | | | |
| | | | |
62 |
_Dimension_ | ::= | Int |
_Dimension_ | ::= | Int |
63 |
| | | | |
| | | | |
64 |
_ConcreteType_ | ::= | _PrimitiveType_ [ _SequenceDims_ ] |
_ValueType_ | ::= | **image** `(` _ConstExpr_ `)` _Shape_ |
65 |
|
| \| | _ConcreteType_ |
66 |
|
| | | | |
67 |
|
_ConcreteType_ | ::= | _PrimitiveType_ { _SequenceDims_ } |
68 |
| | | | |
| | | | |
69 |
_SequenceDims_ | ::= | |
_SequenceDims_ | ::= | |
70 |
| \| | `[` `]` |
| \| | `[` `]` |
162 |
* Constant expressions (_ConstExpr_) are restricted to have a concrete type (_ConcreteType_) |
* Constant expressions (_ConstExpr_) are restricted to have a concrete type (_ConcreteType_) |
163 |
and be can be evaluated statically. |
and be can be evaluated statically. |
164 |
|
|
165 |
|
* A sequence type can have at most one dynamic dimension (*e.g.*, `int [][3]` or |
166 |
|
`int [3][]`, but not `int[][]`). |
167 |
|
|
168 |
* When indexing a tensor or field (e.g., `e1[e2]`), the index expression must be a constant |
* When indexing a tensor or field (e.g., `e1[e2]`), the index expression must be a constant |
169 |
expression. |
expression. |
170 |
|
|