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 @@
<modelVersion>4.0.0</modelVersion>
<groupId>edu.kit.formal</groupId>
<artifactId>ScriptParser</artifactId>
<artifactId>proofscriptparser</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>
......
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;
......
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.*;
/**
......
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;
}
}
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.*;
......
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;
......
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;
......
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;
......
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}.
*
......
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.*;
/**
......
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, Cloneable {
implements Visitable, Copyable<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> clone();
public abstract ASTNode<T> copy();
}
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;
}
/**
......
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 clone() {
BinaryExpression be = new BinaryExpression(left.clone(), operator, right.clone());
public BinaryExpression copy() {
BinaryExpression be = new BinaryExpression(left.copy(), operator, right.copy());
return be;
}
......
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 clone() {
public BooleanLiteral copy() {
return new BooleanLiteral(value, token);
}
......
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 clone() {
return new CallStatement(command, parameters.clone());
public CallStatement copy() {
return new CallStatement(command, parameters.copy());
}
}
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 clone() {
return new CaseStatement(guard.clone(), body.clone());
@Override public CaseStatement copy() {
return new CaseStatement(guard.copy(), body.copy());
}
}
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 clone() {
@Override public CasesStatement copy() {
CasesStatement c = new CasesStatement();
cases.forEach(caseStatement -> c.cases.add(caseStatement.clone()));
cases.forEach(caseStatement -> c.cases.add(caseStatement.copy()));
if (defaultCase != null)
c.defaultCase = defaultCase.clone();
c.defaultCase = defaultCase.copy();
return c;
}
}
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