Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
sarah.grebing
ProofScriptParser
Commits
cef9b784
Commit
cef9b784
authored
Apr 28, 2017
by
Alexander Weigl
Browse files
some bug fixes and relaxation in the grammar
parent
903f952b
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/main/antlr4/edu/kit/formal/proofscriptparser/ScriptLanguage.g4
View file @
cef9b784
...
...
@@ -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
...
...
src/main/java/edu/kit/formatl/proofscriptparser/ast/Literal.java
View file @
cef9b784
...
...
@@ -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
;
...
...
src/main/java/edu/kit/formatl/proofscriptparser/ast/MatchExpression.java
View file @
cef9b784
package
edu.kit.formatl.proofscriptparser.ast
;
import
edu.kit.formal.proofscriptparser.ScriptLanguageParser
;
import
org.graalvm.compiler.core.match.MatchPattern
;
import
java.util.Map
;
...
...
src/test/resources/edu/kit/formal/proofscriptparser/scripts/fullcases.txt
0 → 100644
View file @
cef9b784
script fc() {
cases {
case x = y {
print a;
}
default {
print `blubb`;
}
}
}
\ No newline at end of file
src/test/resources/edu/kit/formal/proofscriptparser/scripts/justarithmetic.txt
0 → 100644
View file @
cef9b784
script justArithm(x:int, y:int) {
z : int := x + y;
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment