Commit f3d39151 authored by Alexander Weigl's avatar Alexander Weigl

add fileheaders, clone() -> copy()

parent 9f9ffbe3
Pipeline #10204 passed with stage
in 2 minutes and 19 seconds
...@@ -3,16 +3,20 @@ ...@@ -3,16 +3,20 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>edu.kit.formal</groupId> <groupId>edu.kit.formal</groupId>
<artifactId>ScriptParser</artifactId> <artifactId>proofscriptparser</artifactId>
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<packaging>jar</packaging> <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> <url>https://git.scc.kit.edu/sarah.grebing/ProofScriptParser</url>
<developers> <developers>
<developer> <developer>
<name>Sarah Grebing</name> <name>Sarah Grebing</name>
<email>sarah.grebing@ira.uka.de</email>
<organization>Karlruhe Institute of Technology</organization> <organization>Karlruhe Institute of Technology</organization>
</developer> </developer>
...@@ -31,8 +35,8 @@ ...@@ -31,8 +35,8 @@
<name>Application-oriented Formal Verification</name> <name>Application-oriented Formal Verification</name>
<url>http://formal.iti.kit.edu</url> <url>http://formal.iti.kit.edu</url>
</organization> </organization>
<inceptionYear>2017</inceptionYear>
<inceptionYear>2017</inceptionYear>
<licenses> <licenses>
<license> <license>
......
package edu.kit.formal.proofscriptparser; 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 edu.kit.formal.proofscriptparser.ast.*;
import java.util.ArrayList; import java.util.ArrayList;
......
package edu.kit.formal.proofscriptparser; 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 edu.kit.formal.proofscriptparser.ast.*;
/** /**
......
package edu.kit.formal.proofscriptparser; 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 edu.kit.formal.proofscriptparser.ast.*;
/** /**
...@@ -83,3 +107,4 @@ public class DefaultASTVisitor<T> implements Visitor<T> { ...@@ -83,3 +107,4 @@ public class DefaultASTVisitor<T> implements Visitor<T> {
return null; return null;
} }
} }
package edu.kit.formal.proofscriptparser; 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.ASTNode;
import edu.kit.formal.proofscriptparser.ast.ProofScript; import edu.kit.formal.proofscriptparser.ast.ProofScript;
import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.*;
......
package edu.kit.formal.proofscriptparser; 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 edu.kit.formal.proofscriptparser.ast.Expression;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Data; import lombok.Data;
......
package edu.kit.formal.proofscriptparser; 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 edu.kit.formal.proofscriptparser.ast.*;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
......
package edu.kit.formal.proofscriptparser; 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 edu.kit.formal.proofscriptparser.ast.*;
import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ErrorNode; import org.antlr.v4.runtime.tree.ErrorNode;
......
package edu.kit.formal.proofscriptparser; 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}. * An interface for all classes that can be visited by {@link Visitor}.
* *
......
package edu.kit.formal.proofscriptparser; 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 edu.kit.formal.proofscriptparser.ast.*;
/** /**
......
package edu.kit.formal.proofscriptparser.ast; 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.Visitable;
import edu.kit.formal.proofscriptparser.Visitor; import edu.kit.formal.proofscriptparser.Visitor;
import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.ParserRuleContext;
...@@ -11,7 +35,7 @@ import java.util.Optional; ...@@ -11,7 +35,7 @@ import java.util.Optional;
* @version 1 (27.04.17) * @version 1 (27.04.17)
*/ */
public abstract class ASTNode<T extends ParserRuleContext> public abstract class ASTNode<T extends ParserRuleContext>
implements Visitable, Cloneable { implements Visitable, Copyable<ASTNode<T>> {
protected T ruleContext; protected T ruleContext;
protected Position startPosition = new Position(); protected Position startPosition = new Position();
protected Position endPosition = new Position(); protected Position endPosition = new Position();
...@@ -54,6 +78,6 @@ public abstract class ASTNode<T extends ParserRuleContext> ...@@ -54,6 +78,6 @@ public abstract class ASTNode<T extends ParserRuleContext>
* @return a fresh substree of the AST that is equal to this. * @return a fresh substree of the AST that is equal to this.
*/ */
@Override @Override
public abstract ASTNode<T> clone(); public abstract ASTNode<T> copy();
} }
package edu.kit.formal.proofscriptparser.ast; 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.ScriptLanguageParser;
import edu.kit.formal.proofscriptparser.Visitor; import edu.kit.formal.proofscriptparser.Visitor;
import lombok.*; import lombok.*;
...@@ -31,8 +55,12 @@ public class AssignmentStatement ...@@ -31,8 +55,12 @@ public class AssignmentStatement
} }
@Override @Override
public AssignmentStatement clone() { public AssignmentStatement copy() {
return new AssignmentStatement(lhs.clone(), rhs.clone(), type); AssignmentStatement s = new AssignmentStatement();
s.lhs = lhs.copy();
s.rhs = rhs.copy();
s.type = type;
return s;
} }
/** /**
......
package edu.kit.formal.proofscriptparser.ast; 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.NotWelldefinedException;
import edu.kit.formal.proofscriptparser.Visitor; import edu.kit.formal.proofscriptparser.Visitor;
import lombok.Data; import lombok.Data;
...@@ -32,8 +56,8 @@ public class BinaryExpression extends Expression<ParserRuleContext> { ...@@ -32,8 +56,8 @@ public class BinaryExpression extends Expression<ParserRuleContext> {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public BinaryExpression clone() { public BinaryExpression copy() {
BinaryExpression be = new BinaryExpression(left.clone(), operator, right.clone()); BinaryExpression be = new BinaryExpression(left.copy(), operator, right.copy());
return be; return be;
} }
......
package edu.kit.formal.proofscriptparser.ast; 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.NotWelldefinedException;
import edu.kit.formal.proofscriptparser.Visitor; import edu.kit.formal.proofscriptparser.Visitor;
import lombok.*; import lombok.*;
...@@ -45,7 +69,7 @@ public class BooleanLiteral extends Literal { ...@@ -45,7 +69,7 @@ public class BooleanLiteral extends Literal {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public BooleanLiteral clone() { public BooleanLiteral copy() {
return new BooleanLiteral(value, token); return new BooleanLiteral(value, token);
} }
......
package edu.kit.formal.proofscriptparser.ast; 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.ScriptLanguageParser;
import edu.kit.formal.proofscriptparser.Visitor; import edu.kit.formal.proofscriptparser.Visitor;
import lombok.*; import lombok.*;
...@@ -38,7 +62,7 @@ public class CallStatement extends Statement<ScriptLanguageParser.ScriptCommandC ...@@ -38,7 +62,7 @@ public class CallStatement extends Statement<ScriptLanguageParser.ScriptCommandC
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public CallStatement clone() { public CallStatement copy() {
return new CallStatement(command, parameters.clone()); return new CallStatement(command, parameters.copy());
} }
} }
package edu.kit.formal.proofscriptparser.ast; 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.ScriptLanguageParser;
import edu.kit.formal.proofscriptparser.Visitor; import edu.kit.formal.proofscriptparser.Visitor;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -27,7 +51,7 @@ public class CaseStatement extends Statement<ScriptLanguageParser.CasesListConte ...@@ -27,7 +51,7 @@ public class CaseStatement extends Statement<ScriptLanguageParser.CasesListConte
/** /**
* {@inheritDoc} * {@inheritDoc}
*/