-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathExpressionsBasis.mc4
More file actions
66 lines (52 loc) · 1.76 KB
/
Copy pathExpressionsBasis.mc4
File metadata and controls
66 lines (52 loc) · 1.76 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.expressions;
/* This is a MontiCore stable grammar.
* Adaptations -- if any -- are conservative. */
import de.monticore.literals.*;
import de.monticore.types.*;
import de.monticore.*;
/**
* This grammar defines core interfaces for expressions and the
* kinds of symbols necessary.
* A hierarchy of conservative extensions to this grammar realize
* these interfaces in various forms.
*
* The language developer may choose the subset of expressions
* of interest and combine these with the appropriate typing infrastructure
*
* This modularity of expressions and associated types greatly eases
* the reuse of type structures in languages similar to Java
*
*
* 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 ExpressionsBasis
extends MCBasics, MCLiteralsBasis {
/*=================================================================*/
/* Top level interface for all kinds of expressions
*/
interface Expression;
/*=================================================================*/
/**
* Various Forms of Names are allowed
* (we allow among others variable names, attribute names, rolenames
* and OCL e.g. also class names. These different forms of names
* prevent to use Name@SymbolForm)
*/
NameExpression implements Expression <350>
= Name;
/**
* Atomic Elements of Expressions: the Literals
*/
LiteralExpression implements Expression <340>
= Literal;
/**
* A list of expressions
*/
Arguments
= "(" (Expression || ",")* ")";
}