Commit bf35f666 authored by Mihai Herda's avatar Mihai Herda
Browse files

Merge branch 'master' of git.scc.kit.edu:py8074/dibugger

parents 119d9aa3 891d7a02
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/antlr-4.7-complete.jar"/>
<classpathentry kind="lib" path="lib/byte-buddy-1.7.10.jar"/>
<classpathentry kind="lib" path="lib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/mockito-core-2.15.4.jar"/>
<classpathentry kind="lib" path="lib/objenesis.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>dibugger</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties> <properties>
<entry key="maxFuncCalls">100</entry> <entry key="configFileLoc"></entry>
<entry key="configFileLoc"/>
<entry key="maxWhileIterations">100</entry> <entry key="maxWhileIterations">100</entry>
<entry key="language">English</entry> <entry key="language">English</entry>
<entry key="maxFuncCalls">100</entry>
</properties> </properties>
#this example prints line count for all found files
total=0
find . -type f -name "*.java" | while read FILE; do
#you see use grep instead wc ! for properly counting
count=$(grep -c ^ < "$FILE")
echo "$FILE has $count lines"
total=total+count #in bash, you can convert this for another shell
done
echo TOTAL LINES COUNTED: $total
package dibugger.debuglogic.antlrparser; package dibugger.debuglogic.antlrparser;
public class ActuallyHelpfulSyntaxException extends RuntimeException { public class ActuallyHelpfulSyntaxException extends RuntimeException {
private static final long serialVersionUID = 336836889541520387L;
public ActuallyHelpfulSyntaxException(String message) { public ActuallyHelpfulSyntaxException(String message) {
super(message); super(message);
......
...@@ -6,7 +6,6 @@ import java.util.List; ...@@ -6,7 +6,6 @@ import java.util.List;
import java.util.ListIterator; import java.util.ListIterator;
import java.util.Map; import java.util.Map;
import dibugger.debuglogic.antlrparser.ActuallyHelpfulSyntaxException;
import dibugger.debuglogic.exceptions.DIbuggerLogicException; import dibugger.debuglogic.exceptions.DIbuggerLogicException;
import dibugger.debuglogic.exceptions.SyntaxException; import dibugger.debuglogic.exceptions.SyntaxException;
import dibugger.debuglogic.interpreter.ConditionalBreakpoint; import dibugger.debuglogic.interpreter.ConditionalBreakpoint;
......
package dibugger.debuglogic.debugger; package dibugger.debuglogic.debugger;
import java.util.List;
/** /**
* abstract class for suggesting watch expressions and conditional breakpoints. * abstract class for suggesting watch expressions and conditional breakpoints.
* *
......
package dibugger.debuglogic.debugger; package dibugger.debuglogic.debugger;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
......
...@@ -12,7 +12,7 @@ import dibugger.debuglogic.exceptions.IdentifierNotFoundException; ...@@ -12,7 +12,7 @@ import dibugger.debuglogic.exceptions.IdentifierNotFoundException;
* *
*/ */
public final class ArrayAccessRelationalTerm extends Term { public final class ArrayAccessRelationalTerm extends Term {
private final int DIM; // private final int DIM;
private Term indexA; private Term indexA;
private Term indexB; private Term indexB;
private Term indexC; private Term indexC;
...@@ -26,7 +26,7 @@ public final class ArrayAccessRelationalTerm extends Term { ...@@ -26,7 +26,7 @@ public final class ArrayAccessRelationalTerm extends Term {
* @param index * @param index
*/ */
public ArrayAccessRelationalTerm(String identifier, Term index) { public ArrayAccessRelationalTerm(String identifier, Term index) {
DIM = 1; // DIM = 1;
this.indexA = index; this.indexA = index;
// Dummy indices // Dummy indices
this.indexB = new ConstantTerm(new IntValue(0)); this.indexB = new ConstantTerm(new IntValue(0));
...@@ -44,7 +44,7 @@ public final class ArrayAccessRelationalTerm extends Term { ...@@ -44,7 +44,7 @@ public final class ArrayAccessRelationalTerm extends Term {
* @param secondIndex * @param secondIndex
*/ */
public ArrayAccessRelationalTerm(String identifier, Term firstIndex, Term secondIndex) { public ArrayAccessRelationalTerm(String identifier, Term firstIndex, Term secondIndex) {
DIM = 2; // DIM = 2;
this.indexA = firstIndex; this.indexA = firstIndex;
this.indexB = secondIndex; this.indexB = secondIndex;
// Dummy index // Dummy index
...@@ -61,7 +61,7 @@ public final class ArrayAccessRelationalTerm extends Term { ...@@ -61,7 +61,7 @@ public final class ArrayAccessRelationalTerm extends Term {
* @param thirdIndex * @param thirdIndex
*/ */
public ArrayAccessRelationalTerm(String identifier, Term firstIndex, Term secondIndex, Term thirdIndex) { public ArrayAccessRelationalTerm(String identifier, Term firstIndex, Term secondIndex, Term thirdIndex) {
DIM = 3; // DIM = 3;
this.indexA = firstIndex; this.indexA = firstIndex;
this.indexB = secondIndex; this.indexB = secondIndex;
this.indexC = thirdIndex; this.indexC = thirdIndex;
......
...@@ -12,7 +12,7 @@ import dibugger.debuglogic.exceptions.IdentifierNotFoundException; ...@@ -12,7 +12,7 @@ import dibugger.debuglogic.exceptions.IdentifierNotFoundException;
* *
*/ */
public final class ArrayAccessTerm extends Term { public final class ArrayAccessTerm extends Term {
private final int DIM; // private final int DIM;
private Term indexA; private Term indexA;
private Term indexB; private Term indexB;
private Term indexC; private Term indexC;
...@@ -25,7 +25,7 @@ public final class ArrayAccessTerm extends Term { ...@@ -25,7 +25,7 @@ public final class ArrayAccessTerm extends Term {
* @param index * @param index
*/ */
public ArrayAccessTerm(String identifier, Term index) { public ArrayAccessTerm(String identifier, Term index) {
DIM = 1; // DIM = 1;
this.indexA = index; this.indexA = index;
// Dummy indices // Dummy indices
this.indexB = new ConstantTerm(new IntValue(0)); this.indexB = new ConstantTerm(new IntValue(0));
...@@ -43,7 +43,7 @@ public final class ArrayAccessTerm extends Term { ...@@ -43,7 +43,7 @@ public final class ArrayAccessTerm extends Term {
* @param secondIndex * @param secondIndex
*/ */
public ArrayAccessTerm(String identifier, Term firstIndex, Term secondIndex) { public ArrayAccessTerm(String identifier, Term firstIndex, Term secondIndex) {
DIM = 2; // DIM = 2;
this.indexA = firstIndex; this.indexA = firstIndex;
this.indexB = secondIndex; this.indexB = secondIndex;
// Dummy index // Dummy index
...@@ -60,7 +60,7 @@ public final class ArrayAccessTerm extends Term { ...@@ -60,7 +60,7 @@ public final class ArrayAccessTerm extends Term {
* @param thirdIndex * @param thirdIndex
*/ */
public ArrayAccessTerm(String identifier, Term firstIndex, Term secondIndex, Term thirdIndex) { public ArrayAccessTerm(String identifier, Term firstIndex, Term secondIndex, Term thirdIndex) {
DIM = 3; // DIM = 3;
this.indexA = firstIndex; this.indexA = firstIndex;
this.indexB = secondIndex; this.indexB = secondIndex;
this.indexC = thirdIndex; this.indexC = thirdIndex;
......
...@@ -9,7 +9,7 @@ import dibugger.debuglogic.exceptions.WrongTypeArgumentException; ...@@ -9,7 +9,7 @@ import dibugger.debuglogic.exceptions.WrongTypeArgumentException;
public class ArrayDeclaration extends Command { public class ArrayDeclaration extends Command {
private final int DIM; // private final int DIM;
private String identifier; private String identifier;
private Term sizeA; // length of the first dimension private Term sizeA; // length of the first dimension
private Term sizeB; private Term sizeB;
...@@ -17,7 +17,7 @@ public class ArrayDeclaration extends Command { ...@@ -17,7 +17,7 @@ public class ArrayDeclaration extends Command {
public ArrayDeclaration(GenerationController controller, int linenumber, String identifier, Term size) { public ArrayDeclaration(GenerationController controller, int linenumber, String identifier, Term size) {
super(controller, linenumber); super(controller, linenumber);
DIM = 1; // DIM = 1;
this.sizeA = size; this.sizeA = size;
// Dummy indices // Dummy indices
this.sizeB = new ConstantTerm(new IntValue(1)); this.sizeB = new ConstantTerm(new IntValue(1));
...@@ -29,7 +29,7 @@ public class ArrayDeclaration extends Command { ...@@ -29,7 +29,7 @@ public class ArrayDeclaration extends Command {
public ArrayDeclaration(GenerationController controller, int linenumber, String identifier, Term firstsize, public ArrayDeclaration(GenerationController controller, int linenumber, String identifier, Term firstsize,
Term secondsize) { Term secondsize) {
super(controller, linenumber); super(controller, linenumber);
DIM = 2; // DIM = 2;
this.sizeA = firstsize; this.sizeA = firstsize;
this.sizeB = secondsize; this.sizeB = secondsize;
// Dummy index // Dummy index
...@@ -40,7 +40,7 @@ public class ArrayDeclaration extends Command { ...@@ -40,7 +40,7 @@ public class ArrayDeclaration extends Command {
public ArrayDeclaration(GenerationController controller, int linenumber, String identifier, Term firstsize, public ArrayDeclaration(GenerationController controller, int linenumber, String identifier, Term firstsize,
Term secondsize, Term thirdsize) { Term secondsize, Term thirdsize) {
super(controller, linenumber); super(controller, linenumber);
DIM = 3; // DIM = 3;
this.sizeA = firstsize; this.sizeA = firstsize;
this.sizeB = secondsize; this.sizeB = secondsize;
this.sizeC = thirdsize; this.sizeC = thirdsize;
......
...@@ -14,8 +14,8 @@ public class ArrayDeclarationAssignment extends Command { ...@@ -14,8 +14,8 @@ public class ArrayDeclarationAssignment extends Command {
private String identifier; private String identifier;
private Term values; private Term values;
private Term sizeA; // length of the first dimension private Term sizeA; // length of the first dimension
private Term sizeB; // private Term sizeB;
private Term sizeC; // private Term sizeC;
private int linenumber; private int linenumber;
public ArrayDeclarationAssignment(GenerationController controller, int linenumber, String identifier, Term size, public ArrayDeclarationAssignment(GenerationController controller, int linenumber, String identifier, Term size,
...@@ -23,9 +23,9 @@ public class ArrayDeclarationAssignment extends Command { ...@@ -23,9 +23,9 @@ public class ArrayDeclarationAssignment extends Command {
super(controller, linenumber); super(controller, linenumber);
this.sizeA = size; this.sizeA = size;
// Dummy indices // Dummy indices
this.sizeB = new ConstantTerm(new IntValue(1)); // this.sizeB = new ConstantTerm(new IntValue(1));
this.sizeC = this.sizeB; // maybe you could make this more efficient by // this.sizeC = this.sizeB; // maybe you could make this more efficient by
// using one global 0 Term // using one global 0 Term
this.identifier = identifier; this.identifier = identifier;
this.linenumber = linenumber; this.linenumber = linenumber;
this.values = values; this.values = values;
......
...@@ -5,13 +5,12 @@ import java.util.List; ...@@ -5,13 +5,12 @@ import java.util.List;
import dibugger.debuglogic.exceptions.DIbuggerLogicException; import dibugger.debuglogic.exceptions.DIbuggerLogicException;
import dibugger.debuglogic.exceptions.IdentifierNotFoundException; import dibugger.debuglogic.exceptions.IdentifierNotFoundException;
import dibugger.debuglogic.exceptions.WrongArgumentException;
import dibugger.debuglogic.exceptions.WrongTypeArgumentException; import dibugger.debuglogic.exceptions.WrongTypeArgumentException;
import dibugger.debuglogic.exceptions.WrongTypeAssignmentException; import dibugger.debuglogic.exceptions.WrongTypeAssignmentException;
public class ArrayElementAssignment extends Command { public class ArrayElementAssignment extends Command {
private final int DIM; // private final int DIM;
private String identifier; private String identifier;
private Term indexA; // index in the first dimension private Term indexA; // index in the first dimension
private Term indexB; private Term indexB;
...@@ -21,7 +20,7 @@ public class ArrayElementAssignment extends Command { ...@@ -21,7 +20,7 @@ public class ArrayElementAssignment extends Command {
public ArrayElementAssignment(GenerationController controller, int linenumber, String identifier, Term index, public ArrayElementAssignment(GenerationController controller, int linenumber, String identifier, Term index,
Term value) { Term value) {
super(controller, linenumber); super(controller, linenumber);
DIM = 1; // DIM = 1;
this.indexA = index; this.indexA = index;
// Dummy indices // Dummy indices
this.indexB = new ConstantTerm(new IntValue(0)); this.indexB = new ConstantTerm(new IntValue(0));
...@@ -34,7 +33,7 @@ public class ArrayElementAssignment extends Command { ...@@ -34,7 +33,7 @@ public class ArrayElementAssignment extends Command {
public ArrayElementAssignment(GenerationController controller, int linenumber, String identifier, Term firstIndex, public ArrayElementAssignment(GenerationController controller, int linenumber, String identifier, Term firstIndex,
Term secondIndex, Term value) { Term secondIndex, Term value) {
super(controller, linenumber); super(controller, linenumber);
DIM = 2; // DIM = 2;
this.indexA = firstIndex; this.indexA = firstIndex;
this.indexB = secondIndex; this.indexB = secondIndex;
// Dummy index // Dummy index
...@@ -46,7 +45,7 @@ public class ArrayElementAssignment extends Command { ...@@ -46,7 +45,7 @@ public class ArrayElementAssignment extends Command {
public ArrayElementAssignment(GenerationController controller, int linenumber, String identifier, Term firstIndex, public ArrayElementAssignment(GenerationController controller, int linenumber, String identifier, Term firstIndex,
Term secondIndex, Term thirdIndex, Term value) { Term secondIndex, Term thirdIndex, Term value) {
super(controller, linenumber); super(controller, linenumber);
DIM = 3; // DIM = 3;
this.indexA = firstIndex; this.indexA = firstIndex;
this.indexB = secondIndex; this.indexB = secondIndex;
this.indexC = thirdIndex; this.indexC = thirdIndex;
...@@ -57,7 +56,7 @@ public class ArrayElementAssignment extends Command { ...@@ -57,7 +56,7 @@ public class ArrayElementAssignment extends Command {
@Override @Override
public List<TraceState> run() throws DIbuggerLogicException { public List<TraceState> run() throws DIbuggerLogicException {
Scope scope = this.controller.getCurrentScope(); Scope scope = this.controller.getCurrentScope();
TermValue value = this.value.evaluate(scope); // TermValue value = this.value.evaluate(scope);
Type type = scope.getTypeOf(this.identifier); Type type = scope.getTypeOf(this.identifier);
// check if variable exists // check if variable exists
......
package dibugger.debuglogic.interpreter; package dibugger.debuglogic.interpreter;
import java.util.List;
/** /**
* Represents a Binary Condition, which is a Term with two Operands evaluating * Represents a Binary Condition, which is a Term with two Operands evaluating
* to a boolean * to a boolean
......
...@@ -3,8 +3,6 @@ package dibugger.debuglogic.interpreter; ...@@ -3,8 +3,6 @@ package dibugger.debuglogic.interpreter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.antlr.v4.runtime.tree.ParseTree;
import dibugger.debuglogic.antlrparser.WlangBaseVisitor; import dibugger.debuglogic.antlrparser.WlangBaseVisitor;
import dibugger.debuglogic.antlrparser.WlangParser.ArglistContext; import dibugger.debuglogic.antlrparser.WlangParser.ArglistContext;
import dibugger.debuglogic.antlrparser.WlangParser.ArgumentContext; import dibugger.debuglogic.antlrparser.WlangParser.ArgumentContext;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment