Skip to content

Commit

Permalink
Initial commit!
Browse files Browse the repository at this point in the history
  • Loading branch information
tammoippen committed Aug 26, 2015
0 parents commit 28842ef
Show file tree
Hide file tree
Showing 297 changed files with 17,061 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.settings/
target/
.idea/

.DS_Store
.project
.classpath
*~
*.iml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# NESTML - The NEST Modelling Language
235 changes: 235 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<!-- == PROJECT COORDINATES ============================================= -->

<groupId>nestml</groupId>
<artifactId>nestml-core</artifactId>
<version>0.0.3-SNAPSHOT</version>

<properties>

<!-- .. Libraries ..................................................... -->
<guava.version>18.0</guava.version>
<commons.cli.version>1.3</commons.cli.version>
<junit.version>4.11</junit.version>

<!-- Monticore versions and dependencies -->
<antlr.version>4.5</antlr.version>
<monticore.runtime>4.1.6</monticore.runtime>
<mc4.maven.generator>4.1.6</mc4.maven.generator>

<!-- .. Plugins ....................................................... -->
<compiler.plugin>3.2</compiler.plugin>
<release.plugin>2.5.1</release.plugin>
<source.plugin>2.4</source.plugin>

<!-- Classifiers -->
<grammars.classifier>grammars</grammars.classifier>
<symbols.classifier>symbols</symbols.classifier>
<models.classifier>models</models.classifier>

<!-- .. Misc .......................................................... -->
<java.version>1.8</java.version>
<wagon.provider.version>2.6</wagon.provider.version>
<logback.version>1.1.2</logback.version>
<groovy.version>2.3.7</groovy.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<!-- == PROJECT METAINFORMATION ========================================= -->

<name>nestml-core</name>
<url>http://lab11.se.rwth-aachen.de/nexus/service/local/repositories/se-sites/content/monticore/${project.version}/</url>
<inceptionYear>2013</inceptionYear>

<organization>
<name>Department of Software Engineering, RWTH Aachen University</name>
<url>http://www.se-rwth.de/</url>
</organization>

<mailingLists>
<mailingList>
<name>Developer</name>
<post>monticore-dev@se-rwth.de</post>
</mailingList>
</mailingLists>

<issueManagement>
<system>Trac</system>
<url>https://sselab.de/lab2/private/trac/MontiCore/</url>
</issueManagement>

<!-- == DEFAULT BUILD SETTINGS =========================================== -->

<!-- == DEFAULT BUILD SETTINGS =========================================== -->

<build>

<plugins>
<!-- MontiCore Configuration -->

<!-- MontiCore Generation -->
<plugin>
<groupId>de.monticore.mojo</groupId>
<artifactId>monticore-maven-plugin</artifactId>
<version>${mc4.maven.generator}</version>
<configuration>
<skip>false</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Other Configuration -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler.plugin}</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${release.plugin}</version>
<configuration>
<tagNameFormat>monticore-@{project.version}</tagNameFormat>
</configuration>
</plugin>

<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>${source.plugin}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- Create jar with all dependencies -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>

</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.nest.cli.NESTMLFrontend</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>assemble-all</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

</build>

<dependencies>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>

<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>${commons.cli.version}</version>
</dependency>


<!-- MontiCore Dependencies -->
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>${antlr.version}</version>
</dependency>

<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.runtime}</version>
</dependency>

<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.runtime}</version>
</dependency>

<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.runtime}</version>
<classifier>${grammars.classifier}</classifier>
</dependency>

<!-- .. Test Libraries ............................................... -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.runtime}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>

</dependencies>

</project>
93 changes: 93 additions & 0 deletions src/main/grammars/org/nest/NESTML.mc4
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (c) 2015 RWTH Aachen. All rights reserved.
*
* http://www.se-rwth.de/
*/
package org.nest;

grammar NESTML extends org.nest.SPL {

/** ASTNESTMLCompilationUnit represents the complete entire file with neuron and component models.
@attribute packageName The qualified name to artifact
@attribute Import List of imported elements
@attribute Neuron The neuron representation
@attribute Component The component representation
*/
NESTMLCompilationUnit = "package" packageName:QualifiedName
BLOCK_OPEN
(Import | NEWLINE)*
(Neuron | Component | NEWLINE)*
BLOCK_CLOSE;

/** ASTImport represents the import line. Can be the qualified name oder a wirldcard import.
@attribute qualifiedName The qualified name to artifact
@attribute star Optional wildcard
*/
Import = "import" QualifiedName ([star:".*"])? (";")?;

Neuron = "neuron" Name Body;

Component = "component" Name Body;

interface BodyElement;

Body = BLOCK_OPEN ( NEWLINE | BodyElement)* BLOCK_CLOSE;

USE_Stmt implements BodyElement = "use" name:QualifiedName "as" alias:Name;

Var_Block implements BodyElement =
(["state"]|["parameter"]|["internal"])
BLOCK_OPEN
(AliasDecl (";" AliasDecl)* (";")? | NEWLINE)*
BLOCK_CLOSE;

AliasDecl = ([hide:"-"])? (["alias"])? Declaration ("[" invariants:Expr (";" invariants:Expr)* "]")?;

Input implements BodyElement = "input"
BLOCK_OPEN
(InputLine | NEWLINE)*
BLOCK_CLOSE;

InputLine =
Name
("<" sizeParameter:Name ">")?
"<-" InputType*
(["spike"] | ["current"]);

InputType = (["inhibitory"] | ["excitatory"]);

Output implements BodyElement =
"output" BLOCK_OPEN (["spike"] | ["current"]) ;

Structure implements BodyElement = "structure"
BLOCK_OPEN
(StructureLine | NEWLINE)*
BLOCK_CLOSE;

StructureLine = compartments:QualifiedName ("-" compartments:QualifiedName)*;

// TODO model it better
Function implements BodyElement =
"function" Name "(" Parameters? ")" (returnType:QualifiedName | PrimitiveType)?
BLOCK_OPEN
Block
BLOCK_CLOSE;

// e.g. first: current time, second: min delay in ms
// e.g. first: current time, second: timestep in ms
Dynamics implements BodyElement = "dynamics" (MinDelay | TimeStep)
"(" Parameters? ")"
BLOCK_OPEN // Todo remove me. It is not the way for modular extension
Block
BLOCK_CLOSE;


MinDelay = "minDelay";

TimeStep = "timestep";

Parameters = Parameter ("," Parameter)*;

Parameter = Name type:QualifiedName;

}
Loading

0 comments on commit 28842ef

Please sign in to comment.