Commit cef9b784 authored by Alexander Weigl's avatar Alexander Weigl

some bug fixes and relaxation in the grammar

parent 903f952b
......@@ -86,8 +86,8 @@ casesStmt
;
casesList
: CASE expression COLON INDENT stmtList DEDENT casesList*
| DEFAULT COLON INDENT stmtList DEDENT
: CASE expression COLON? INDENT stmtList DEDENT casesList*
| DEFAULT COLON? INDENT stmtList DEDENT
;
forEachStmt
......@@ -99,7 +99,7 @@ theOnlyStmt
;
scriptCommand
: ID (ID '=' expression)* SEMICOLON
: ID ((ID '=')? expression)* SEMICOLON
;
callStmt
......
......@@ -2,7 +2,6 @@ package edu.kit.formatl.proofscriptparser.ast;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.Token;
import org.graalvm.compiler.nodes.calc.IntegerDivRemNode;
import java.util.Optional;
......@@ -11,7 +10,7 @@ import java.util.Optional;
* @version 1 (28.04.17)
*/
public abstract class Literal extends ASTNode<ParserRuleContext> {
protected Optional<Token> token;
Optional<Token> token;
public Optional<Token> getToken() {
return token;
......
package edu.kit.formatl.proofscriptparser.ast;
import edu.kit.formal.proofscriptparser.ScriptLanguageParser;
import org.graalvm.compiler.core.match.MatchPattern;
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