Commit 1c4e67af authored by Alexander Weigl's avatar Alexander Weigl

fix some test cases, clean up a little bit

parent 68ec6cce
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -25,12 +25,13 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -25,12 +25,13 @@ package edu.kit.iti.formal.psdbg.parser.ast;
import edu.kit.iti.formal.psdbg.parser.Visitable; import edu.kit.iti.formal.psdbg.parser.Visitable;
import edu.kit.iti.formal.psdbg.parser.Visitor; import edu.kit.iti.formal.psdbg.parser.Visitor;
import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.val;
import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.ParserRuleContext;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import java.util.Arrays;
import java.util.Objects; import java.util.Objects;
/** /**
...@@ -47,7 +48,9 @@ public abstract class ASTNode<T extends ParserRuleContext> ...@@ -47,7 +48,9 @@ public abstract class ASTNode<T extends ParserRuleContext>
/** /**
* *
*/ */
@Getter @Setter @Nullable @Getter
@Setter
@Nullable
protected ASTNode parent; protected ASTNode parent;
/** /**
...@@ -116,7 +119,7 @@ public abstract class ASTNode<T extends ParserRuleContext> ...@@ -116,7 +119,7 @@ public abstract class ASTNode<T extends ParserRuleContext>
@Override @Override
public abstract ASTNode<T> copy(); public abstract ASTNode<T> copy();
public boolean isAncestor(ASTNode node){ public boolean isAncestor(ASTNode node) {
ASTNode n = this; ASTNode n = this;
do { do {
if (n.equals(node)) if (n.equals(node))
...@@ -140,6 +143,17 @@ public abstract class ASTNode<T extends ParserRuleContext> ...@@ -140,6 +143,17 @@ public abstract class ASTNode<T extends ParserRuleContext>
return depth; return depth;
} }
public ASTNode[] getChildren() {
return new ASTNode[0];
}
public final ASTNode[] asList() {
val ary = getChildren();
val nry = Arrays.copyOf(ary, ary.length + 1);
nry[nry.length - 1] = this;
return nry;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
......
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -23,7 +23,6 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -23,7 +23,6 @@ package edu.kit.iti.formal.psdbg.parser.ast;
*/ */
import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser; import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser;
import edu.kit.iti.formal.psdbg.parser.Visitor; import edu.kit.iti.formal.psdbg.parser.Visitor;
import edu.kit.iti.formal.psdbg.parser.types.Type; import edu.kit.iti.formal.psdbg.parser.types.Type;
...@@ -74,6 +73,10 @@ public class AssignmentStatement ...@@ -74,6 +73,10 @@ public class AssignmentStatement
return type != null; return type != null;
} }
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getLhs(), getRhs()};
}
@Override @Override
public boolean eq(ASTNode o) { public boolean eq(ASTNode o) {
......
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -47,6 +47,11 @@ public class BinaryExpression extends Expression<ParserRuleContext> { ...@@ -47,6 +47,11 @@ public class BinaryExpression extends Expression<ParserRuleContext> {
this.right = right; this.right = right;
} }
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getLeft(), getRight()};
}
@Override @Override
public <T> T accept(Visitor<T> visitor) { public <T> T accept(Visitor<T> visitor) {
return visitor.visit(this); return visitor.visit(this);
......
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -23,7 +23,6 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -23,7 +23,6 @@ package edu.kit.iti.formal.psdbg.parser.ast;
*/ */
import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser; import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser;
import edu.kit.iti.formal.psdbg.parser.Visitor; import edu.kit.iti.formal.psdbg.parser.Visitor;
import lombok.*; import lombok.*;
...@@ -58,6 +57,11 @@ public class CallStatement extends Statement<ScriptLanguageParser.ScriptCommandC ...@@ -58,6 +57,11 @@ public class CallStatement extends Statement<ScriptLanguageParser.ScriptCommandC
return visitor.visit(this); return visitor.visit(this);
} }
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getParameters()};
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
......
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -44,14 +44,21 @@ public abstract class CaseStatement extends Statement<ScriptLanguageParser.Cases ...@@ -44,14 +44,21 @@ public abstract class CaseStatement extends Statement<ScriptLanguageParser.Cases
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override public <T> T accept(Visitor<T> visitor) { @Override
public <T> T accept(Visitor<T> visitor) {
return visitor.visit(this); return visitor.visit(this);
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override public abstract CaseStatement copy(); @Override
public abstract CaseStatement copy();
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getBody()};
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
...@@ -63,5 +70,4 @@ public abstract class CaseStatement extends Statement<ScriptLanguageParser.Cases ...@@ -63,5 +70,4 @@ public abstract class CaseStatement extends Statement<ScriptLanguageParser.Cases
return getBody().eq(that.getBody()); return getBody().eq(that.getBody());
} }
} }
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -25,10 +25,7 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -25,10 +25,7 @@ package edu.kit.iti.formal.psdbg.parser.ast;
import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser; import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser;
import edu.kit.iti.formal.psdbg.parser.Visitor; import edu.kit.iti.formal.psdbg.parser.Visitor;
import lombok.Getter; import lombok.*;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -41,22 +38,37 @@ import java.util.List; ...@@ -41,22 +38,37 @@ import java.util.List;
@Getter @Getter
@RequiredArgsConstructor @RequiredArgsConstructor
public class CasesStatement extends Statement<ScriptLanguageParser.CasesStmtContext> { public class CasesStatement extends Statement<ScriptLanguageParser.CasesStmtContext> {
@NonNull private final List<CaseStatement> cases = new ArrayList<>(); @NonNull
private final List<CaseStatement> cases = new ArrayList<>();
// @NonNull private Statements defaultCase = new Statements(); // @NonNull private Statements defaultCase = new Statements();
@NonNull @NonNull
private DefaultCaseStatement defCaseStmt = new DefaultCaseStatement(); private DefaultCaseStatement defCaseStmt = new DefaultCaseStatement();
@Override
public ASTNode[] getChildren() {
if (defCaseStmt == null)
return (ASTNode[]) cases.toArray();
else {
val ret = new ASTNode[cases.size() + (defCaseStmt != null ? 1 : 0)];
System.arraycopy(cases.toArray(), 0, ret, 0, cases.size());
ret[ret.length - 1] = defCaseStmt;
return ret;
}
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override public <T> T accept(Visitor<T> visitor) { @Override
public <T> T accept(Visitor<T> visitor) {
return visitor.visit(this); return visitor.visit(this);
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override public CasesStatement copy() { @Override
public CasesStatement copy() {
CasesStatement c = new CasesStatement(); CasesStatement c = new CasesStatement();
cases.forEach(caseStatement -> c.cases.add(caseStatement.copy())); cases.forEach(caseStatement -> c.cases.add(caseStatement.copy()));
// if (defaultCase != null) // if (defaultCase != null)
...@@ -76,7 +88,7 @@ public class CasesStatement extends Statement<ScriptLanguageParser.CasesStmtCont ...@@ -76,7 +88,7 @@ public class CasesStatement extends Statement<ScriptLanguageParser.CasesStmtCont
CasesStatement that = (CasesStatement) o; CasesStatement that = (CasesStatement) o;
for (int i = 0; i < cases.size(); i++) { for (int i = 0; i < cases.size(); i++) {
if(!cases.get(i).eq(that.cases.get(i))) if (!cases.get(i).eq(that.cases.get(i)))
return false; return false;
} }
......
...@@ -19,7 +19,7 @@ public class ClosesCase extends CaseStatement { ...@@ -19,7 +19,7 @@ public class ClosesCase extends CaseStatement {
* A close subscript() {bodyscript} expression * A close subscript() {bodyscript} expression
* *
* @param closesGuard the script that is exectued in order to determine whether goal would clos. This proof is pruned afterwards * @param closesGuard the script that is exectued in order to determine whether goal would clos. This proof is pruned afterwards
* @param body the actual script that is then executed when closesscript was successful and pruned * @param body the actual script that is then executed when closesscript was successful and pruned
*/ */
public ClosesCase(Statements closesGuard, Statements body) { public ClosesCase(Statements closesGuard, Statements body) {
this.body = body; this.body = body;
...@@ -55,4 +55,9 @@ public class ClosesCase extends CaseStatement { ...@@ -55,4 +55,9 @@ public class ClosesCase extends CaseStatement {
return getClosesGuard() != null ? getClosesGuard().eq(that.getClosesGuard()) : that.getClosesGuard() == null; return getClosesGuard() != null ? getClosesGuard().eq(that.getClosesGuard()) : that.getClosesGuard() == null;
} }
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getClosesGuard(), getBody()};
}
} }
package edu.kit.iti.formal.psdbg.parser.ast; package edu.kit.iti.formal.psdbg.parser.ast;
/*- /*-
* #%L * #%L
* ProofScriptParser * ProofScriptParser
* %% * %%
* Copyright (C) 2017 Application-oriented Formal Verification * Copyright (C) 2017 Application-oriented Formal Verification
* %% * %%
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L% * #L%
*/ */
import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser; import edu.kit.iti.formal.psdbg.parser.ScriptLanguageParser;
import lombok.*; import lombok.*;
import org.antlr.v4.runtime.ParserRuleContext;
/** /**
* @author Alexander Weigl * @author Alexander Weigl
...@@ -39,11 +38,13 @@ public abstract class ConditionalBlock ...@@ -39,11 +38,13 @@ public abstract class ConditionalBlock
extends Statement<ScriptLanguageParser.ConditionalBlockContext> { extends Statement<ScriptLanguageParser.ConditionalBlockContext> {
@Getter @Getter
@Setter @Setter
@NonNull protected Statements body = new Statements(); @NonNull
protected Statements body = new Statements();
@Getter @Getter
@Setter @Setter
@NonNull protected Expression condition = BooleanLiteral.TRUE; @NonNull
protected Expression condition = BooleanLiteral.TRUE;
@Override @Override
public boolean eq(ASTNode o) { public boolean eq(ASTNode o) {
...@@ -56,4 +57,8 @@ public abstract class ConditionalBlock ...@@ -56,4 +57,8 @@ public abstract class ConditionalBlock
return getBody() != null ? getBody().eq(that.getBody()) : that.getBody() == null; return getBody() != null ? getBody().eq(that.getBody()) : that.getBody() == null;
} }
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getCondition(), getBody()};
}
} }
...@@ -8,7 +8,6 @@ import lombok.Setter; ...@@ -8,7 +8,6 @@ import lombok.Setter;
@Getter @Getter
@Setter @Setter
public class DefaultCaseStatement extends Statement<ScriptLanguageParser.StmtListContext> { public class DefaultCaseStatement extends Statement<ScriptLanguageParser.StmtListContext> {
protected Statements body; protected Statements body;
public DefaultCaseStatement() { public DefaultCaseStatement() {
...@@ -55,6 +54,12 @@ public class DefaultCaseStatement extends Statement<ScriptLanguageParser.StmtLis ...@@ -55,6 +54,12 @@ public class DefaultCaseStatement extends Statement<ScriptLanguageParser.StmtLis
result = 31 * result + getBody().hashCode(); result = 31 * result + getBody().hashCode();
return result; return result;
} }
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getBody()};
}
} }
......
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -57,4 +57,8 @@ public class ForeachStatement extends UnconditionalBlock { ...@@ -57,4 +57,8 @@ public class ForeachStatement extends UnconditionalBlock {
fs.setRuleContext(this.ruleContext); fs.setRuleContext(this.ruleContext);
return fs; return fs;
} }
}
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getBody()};
}}
...@@ -48,4 +48,8 @@ public class GuardedCaseStatement extends CaseStatement { ...@@ -48,4 +48,8 @@ public class GuardedCaseStatement extends CaseStatement {
return getGuard().eq(that.getGuard()); return getGuard().eq(that.getGuard());
} }
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{getGuard(), getBody()};
}
} }
...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast; ...@@ -10,12 +10,12 @@ package edu.kit.iti.formal.psdbg.parser.ast;
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public * You should have received a copy of the GNU General Public
* License along with this program. If not, see * License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>. * <http://www.gnu.org/licenses/gpl-3.0.html>.
...@@ -30,8 +30,6 @@ import edu.kit.iti.formal.psdbg.parser.types.SimpleType; ...@@ -30,8 +30,6 @@ import edu.kit.iti.formal.psdbg.parser.types.SimpleType;
import edu.kit.iti.formal.psdbg.parser.types.TermType; import edu.kit.iti.formal.psdbg.parser.types.TermType;
import edu.kit.iti.formal.psdbg.parser.types.Type; import edu.kit.iti.formal.psdbg.parser.types.Type;
import lombok.Data; import lombok.Data;
import lombok.Getter;
import lombok.Setter;
/** /**
* A match expression contains an argument and a uses clause. * A match expression contains an argument and a uses clause.
...@@ -43,13 +41,15 @@ import lombok.Setter; ...@@ -43,13 +41,15 @@ import lombok.Setter;
public class MatchExpression extends Expression<ScriptLanguageParser.MatchPatternContext> { public class MatchExpression extends Expression<ScriptLanguageParser.MatchPatternContext> {
//private Signature signature = new Signature(); //private Signature signature = new Signature();
private Expression pattern; private Expression pattern;
@Getter
@Setter
private boolean isDerivable; private boolean isDerivable;
@Getter @Deprecated
@Setter
private Expression derivableTerm; private Expression derivableTerm;
@Override
public ASTNode[] getChildren() {
return new ASTNode[]{pattern};
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
...@@ -95,8 +95,4 @@ public class MatchExpression extends Expression<ScriptLanguageParser.MatchPatter ...@@ -95,8 +95,4 @@ public class MatchExpression extends Expression<ScriptLanguageParser.MatchPatter
public int getPrecedence() { public int getPrecedence() {
return Operator.MATCH.precedence(); return Operator.MATCH.precedence();
} }
public void setPattern(Expression pattern) {
this.pattern = pattern;
}
}