Commit cef9b784 authored by Alexander Weigl's avatar Alexander Weigl
Browse files

some bug fixes and relaxation in the grammar

parent 903f952b
...@@ -86,8 +86,8 @@ casesStmt ...@@ -86,8 +86,8 @@ casesStmt
; ;
casesList casesList
: CASE expression COLON INDENT stmtList DEDENT casesList* : CASE expression COLON? INDENT stmtList DEDENT casesList*
| DEFAULT COLON INDENT stmtList DEDENT | DEFAULT COLON? INDENT stmtList DEDENT
; ;
forEachStmt forEachStmt
...@@ -99,7 +99,7 @@ theOnlyStmt ...@@ -99,7 +99,7 @@ theOnlyStmt
; ;
scriptCommand scriptCommand
: ID (ID '=' expression)* SEMICOLON : ID ((ID '=')? expression)* SEMICOLON
; ;
callStmt callStmt
......
...@@ -2,7 +2,6 @@ package edu.kit.formatl.proofscriptparser.ast; ...@@ -2,7 +2,6 @@ package edu.kit.formatl.proofscriptparser.ast;
import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.Token;
import org.graalvm.compiler.nodes.calc.IntegerDivRemNode;
import java.util.Optional; import java.util.Optional;
...@@ -11,7 +10,7 @@ import java.util.Optional; ...@@ -11,7 +10,7 @@ import java.util.Optional;
* @version 1 (28.04.17) * @version 1 (28.04.17)
*/ */
public abstract class Literal extends ASTNode<ParserRuleContext> { public abstract class Literal extends ASTNode<ParserRuleContext> {
protected Optional<Token> token; Optional<Token> token;
public Optional<Token> getToken() { public Optional<Token> getToken() {
return token; return token;
......
package edu.kit.formatl.proofscriptparser.ast; package edu.kit.formatl.proofscriptparser.ast;
import edu.kit.formal.proofscriptparser.ScriptLanguageParser; import edu.kit.formal.proofscriptparser.ScriptLanguageParser;
import org.graalvm.compiler.core.match.MatchPattern;
import java.util.Map; import java.util.Map;
......
script fc() {
cases {
case x = y {
print a;
}
default {
print `blubb`;
}
}
}
\ No newline at end of file
script justArithm(x:int, y:int) {
z : int := x + y;
}
\ No newline at end of file
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