Commit 475e9b29 authored by Han Zhang's avatar Han Zhang
Browse files

Add package declaration to grammar definition && Update project version

parent 4a92b69f
Pipeline #289858 passed with stage
in 9 minutes and 41 seconds
......@@ -19,7 +19,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>cnn-arch</artifactId>
<version>0.3.5-SNAPSHOT</version>
<version>0.3.6-SNAPSHOT</version>
......
......@@ -14,7 +14,8 @@ grammar CNNArch extends de.monticore.CommonExpressions, de.monticore.lang.Math,
The complete file.
Use nonterminal Architecture for embedding in another language (e.g. EmbeddedMontiArc)
*/
symbol scope CNNArchCompilationUnit = "architecture"
symbol scope CNNArchCompilationUnit = ("package" package:(Name& || ".")+ ";")? // optional package declaration
"architecture"
name:Name
( "(" (ArchitectureParameter || ",")* ")" )? "{"
ioDeclarations:IODeclaration*
......
......@@ -17,6 +17,7 @@ import de.monticore.lang.monticar.cnnarch._visitor.CNNArchDelegatorVisitor;
import de.monticore.lang.monticar.cnnarch.predefined.AllPredefinedLayers;
import de.monticore.lang.monticar.cnnarch.predefined.AllPredefinedVariables;
import de.monticore.symboltable.*;
import de.se_rwth.commons.Names;
import de.se_rwth.commons.logging.Log;
import java.util.*;
......@@ -89,6 +90,8 @@ public class CNNArchSymbolTableCreator extends de.monticore.symboltable.CommonSy
List<ImportStatement> imports = new ArrayList<>();
this.compilationUnitPackage = Names.getQualifiedName(compilationUnit.getPackageList());
ArtifactScope artifactScope = new ArtifactScope(
Optional.empty(),
compilationUnitPackage,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment