-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathTupleExpressions.mc4
More file actions
40 lines (34 loc) · 1.1 KB
/
Copy pathTupleExpressions.mc4
File metadata and controls
40 lines (34 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// (c) https://github.com/MontiCore/monticore
package de.monticore.expressions;
/* This is a MontiCore stable grammar.
* Adaptations -- if any -- are conservative. */
import de.monticore.expressions.*;
/**
* This grammar defines tuple expressions, e.g.
* ("Hello", 1) , (1, 3, "world", 7.9f)
*
* Tuples expressions are ordered lists of at least two expressions
* enclosed in brackets.
* These are inspired by functional languages like Haskell
* and correspond to tuple types.
*
* This grammar is part of a hierarchy of expressions, which can be found
* under
* https://github.com/MontiCore/monticore/blob/dev/monticore-grammar/
* src/main/grammars/de/monticore/expressions/Expressions.md
*
*/
component grammar TupleExpressions
extends ExpressionsBasis {
/** ASTTupleExpression represents tuple expressions.
*
* Tuple expression are a tuple of expressions.
* The type is the tuple of the types of the expressions in the tuple.
*
* Example:
* (1.1f, -2.0f)
*/
TupleExpression implements Expression =
"(" Expression "," (Expression || ",")+ ")"
;
}