Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
first draft
  • Loading branch information
lausdahl committed Jan 25, 2020
1 parent 10616eb commit d260197
Show file tree
Hide file tree
Showing 4 changed files with 465 additions and 126 deletions.
19 changes: 14 additions & 5 deletions ast/src/main/resources/maestrov2.astv2
Expand Up @@ -28,7 +28,7 @@ Abstract Syntax Tree

specification {-> package='org.maestro.ast.specification'}
= {language} [name]:identifier [functions]:type.function*
| {simulation} [body]:stm*
| {simulation} [body]:stm
;

exp {-> package='org.maestro.ast.expression'}
Expand All @@ -37,19 +37,28 @@ exp {-> package='org.maestro.ast.expression'}
| {intLiteral} [value]:java_Integer
| {stringLiteral} [value]:java_String
| {identifier} [value]:java_String
| {tupleIdentifier} [value]:identifier*
| {booleanLiteral} [value]:java_Boolean
| {load} [uri]:exp.stringLiteral [importName]:identifier
| {apply} [root]:exp [functionName]:identifier [args]:exp*
| {seqComp} [members]:exp*
| #binary
;

#binary {-> package='org.maestro.ast.expression'
| [left]:exp
| [right]:exp }
= {lessThan}
| {addition}
;

stm {-> package='org.maestro.ast.statements'}
= {unload} [fmu]:identifier
= {load} [uri]:exp.stringLiteral [importName]:identifier [target]:tupleIdentifier
| {unload} [fmu]:identifier
| {assignment} [target]:identifier [exp]:exp
| {variableDeclaration} [type]:type [name]:identifier [initializer]:exp
| {import} [name]:identifier
| {while} [exp]:exp [statement]:block
| {if} [exp]:exp [thenStm]:block [elseStm]:block
| {while} [condition]:exp [body]:stm
| {if} [exp]:exp [thenStm]:stm [elseStm]:stm
| {block} [body]:stm*
;

Expand Down
121 changes: 0 additions & 121 deletions test-program/src/main/java/Main.java

This file was deleted.

0 comments on commit d260197

Please sign in to comment.