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
f3d39151
Commit
f3d39151
authored
May 04, 2017
by
Alexander Weigl
Browse files
add fileheaders, clone() -> copy()
parent
9f9ffbe3
Pipeline
#10204
passed with stage
in 2 minutes and 19 seconds
Changes
49
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
f3d39151
...
...
@@ -3,16 +3,20 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
edu.kit.formal
</groupId>
<artifactId>
S
cript
P
arser
</artifactId>
<artifactId>
proofs
cript
p
arser
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
ScriptParser
</name>
<name>
ProofScriptParser
</name>
<description>
A parser and AST for the proof script language.
</description>
<url>
https://git.scc.kit.edu/sarah.grebing/ProofScriptParser
</url>
<developers>
<developer>
<name>
Sarah Grebing
</name>
<email>
sarah.grebing@ira.uka.de
</email>
<organization>
Karlruhe Institute of Technology
</organization>
</developer>
...
...
@@ -31,8 +35,8 @@
<name>
Application-oriented Formal Verification
</name>
<url>
http://formal.iti.kit.edu
</url>
</organization>
<inceptionYear>
2017
</inceptionYear>
<inceptionYear>
2017
</inceptionYear>
<licenses>
<license>
...
...
src/main/java/edu/kit/formal/proofscriptparser/ASTChanger.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.*
;
import
java.util.ArrayList
;
...
...
src/main/java/edu/kit/formal/proofscriptparser/ASTTraversal.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.*
;
/**
...
...
src/main/java/edu/kit/formal/proofscriptparser/DefaultASTVisitor.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.*
;
/**
...
...
@@ -83,3 +107,4 @@ public class DefaultASTVisitor<T> implements Visitor<T> {
return
null
;
}
}
src/main/java/edu/kit/formal/proofscriptparser/Facade.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.ASTNode
;
import
edu.kit.formal.proofscriptparser.ast.ProofScript
;
import
org.antlr.v4.runtime.*
;
...
...
src/main/java/edu/kit/formal/proofscriptparser/NotWelldefinedException.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.Expression
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
src/main/java/edu/kit/formal/proofscriptparser/PrettyPrinter.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.*
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
src/main/java/edu/kit/formal/proofscriptparser/TransformAst.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.*
;
import
org.antlr.v4.runtime.ParserRuleContext
;
import
org.antlr.v4.runtime.tree.ErrorNode
;
...
...
src/main/java/edu/kit/formal/proofscriptparser/Visitable.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
/**
* An interface for all classes that can be visited by {@link Visitor}.
*
...
...
src/main/java/edu/kit/formal/proofscriptparser/Visitor.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ast.*
;
/**
...
...
src/main/java/edu/kit/formal/proofscriptparser/ast/ASTNode.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser.ast
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.Visitable
;
import
edu.kit.formal.proofscriptparser.Visitor
;
import
org.antlr.v4.runtime.ParserRuleContext
;
...
...
@@ -11,7 +35,7 @@ import java.util.Optional;
* @version 1 (27.04.17)
*/
public
abstract
class
ASTNode
<
T
extends
ParserRuleContext
>
implements
Visitable
,
C
loneable
{
implements
Visitable
,
C
opyable
<
ASTNode
<
T
>>
{
protected
T
ruleContext
;
protected
Position
startPosition
=
new
Position
();
protected
Position
endPosition
=
new
Position
();
...
...
@@ -54,6 +78,6 @@ public abstract class ASTNode<T extends ParserRuleContext>
* @return a fresh substree of the AST that is equal to this.
*/
@Override
public
abstract
ASTNode
<
T
>
c
lone
();
public
abstract
ASTNode
<
T
>
c
opy
();
}
src/main/java/edu/kit/formal/proofscriptparser/ast/AssignmentStatement.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser.ast
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ScriptLanguageParser
;
import
edu.kit.formal.proofscriptparser.Visitor
;
import
lombok.*
;
...
...
@@ -31,8 +55,12 @@ public class AssignmentStatement
}
@Override
public
AssignmentStatement
clone
()
{
return
new
AssignmentStatement
(
lhs
.
clone
(),
rhs
.
clone
(),
type
);
public
AssignmentStatement
copy
()
{
AssignmentStatement
s
=
new
AssignmentStatement
();
s
.
lhs
=
lhs
.
copy
();
s
.
rhs
=
rhs
.
copy
();
s
.
type
=
type
;
return
s
;
}
/**
...
...
src/main/java/edu/kit/formal/proofscriptparser/ast/BinaryExpression.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser.ast
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.NotWelldefinedException
;
import
edu.kit.formal.proofscriptparser.Visitor
;
import
lombok.Data
;
...
...
@@ -32,8 +56,8 @@ public class BinaryExpression extends Expression<ParserRuleContext> {
* {@inheritDoc}
*/
@Override
public
BinaryExpression
c
lone
()
{
BinaryExpression
be
=
new
BinaryExpression
(
left
.
c
lone
(),
operator
,
right
.
c
lone
());
public
BinaryExpression
c
opy
()
{
BinaryExpression
be
=
new
BinaryExpression
(
left
.
c
opy
(),
operator
,
right
.
c
opy
());
return
be
;
}
...
...
src/main/java/edu/kit/formal/proofscriptparser/ast/BooleanLiteral.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser.ast
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.NotWelldefinedException
;
import
edu.kit.formal.proofscriptparser.Visitor
;
import
lombok.*
;
...
...
@@ -45,7 +69,7 @@ public class BooleanLiteral extends Literal {
* {@inheritDoc}
*/
@Override
public
BooleanLiteral
c
lone
()
{
public
BooleanLiteral
c
opy
()
{
return
new
BooleanLiteral
(
value
,
token
);
}
...
...
src/main/java/edu/kit/formal/proofscriptparser/ast/CallStatement.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser.ast
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ScriptLanguageParser
;
import
edu.kit.formal.proofscriptparser.Visitor
;
import
lombok.*
;
...
...
@@ -38,7 +62,7 @@ public class CallStatement extends Statement<ScriptLanguageParser.ScriptCommandC
* {@inheritDoc}
*/
@Override
public
CallStatement
c
lone
()
{
return
new
CallStatement
(
command
,
parameters
.
c
lone
());
public
CallStatement
c
opy
()
{
return
new
CallStatement
(
command
,
parameters
.
c
opy
());
}
}
src/main/java/edu/kit/formal/proofscriptparser/ast/CaseStatement.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser.ast
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ScriptLanguageParser
;
import
edu.kit.formal.proofscriptparser.Visitor
;
import
lombok.AllArgsConstructor
;
...
...
@@ -27,7 +51,7 @@ public class CaseStatement extends Statement<ScriptLanguageParser.CasesListConte
/**
* {@inheritDoc}
*/
@Override
public
CaseStatement
c
lone
()
{
return
new
CaseStatement
(
guard
.
c
lone
(),
body
.
c
lone
());
@Override
public
CaseStatement
c
opy
()
{
return
new
CaseStatement
(
guard
.
c
opy
(),
body
.
c
opy
());
}
}
src/main/java/edu/kit/formal/proofscriptparser/ast/CasesStatement.java
View file @
f3d39151
package
edu.kit.formal.proofscriptparser.ast
;
/*-
* #%L
* ProofScriptParser
* %%
* Copyright (C) 2017 Application-oriented Formal Verification
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
import
edu.kit.formal.proofscriptparser.ScriptLanguageParser
;
import
edu.kit.formal.proofscriptparser.Visitor
;
import
lombok.Data
;
...
...
@@ -27,11 +51,11 @@ public class CasesStatement extends Statement<ScriptLanguageParser.CasesListCont
/**
* {@inheritDoc}
*/
@Override
public
CasesStatement
c
lone
()
{
@Override
public
CasesStatement
c
opy
()
{
CasesStatement
c
=
new
CasesStatement
();
cases
.
forEach
(
caseStatement
->
c
.
cases
.
add
(
caseStatement
.
c
lone
()));
cases
.
forEach
(
caseStatement
->
c
.
cases
.
add
(
caseStatement
.
c
opy
()));
if
(
defaultCase
!=
null
)
c
.
defaultCase
=
defaultCase
.
c
lone