/* (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 || ",")* ")"; }