Commit 929daa1f authored by baueko's avatar baueko
Browse files

added missing files

parent 96dbcea0
package de.in.tum.www2.cup.analysis;
import java.util.LinkedList;
import java.util.List;
import java_cup.runtime.ComplexSymbolFactory.Location;
public class JavaDeclarationsTreeElement {
List<Pair> variables;
Location end;
List<JavaDeclarationsTreeElement> children;
JavaDeclarationsTreeElement parent;
public JavaDeclarationsTreeElement(Location end, JavaDeclarationsTreeElement parent) {
this.end = end;
this.parent = parent;
}
public JavaDeclarationsTreeElement getParent() {
return parent;
}
public void addDeclaration(String name, Location start) {
if (variables == null) {
variables = new LinkedList<>();
}
variables.add(new Pair(name, start));
}
public JavaDeclarationsTreeElement addChild(JavaDeclarationsTreeElement child) {
if (children == null) {
children = new LinkedList<>();
}
children.add(child);
return child;
}
class Pair {
String name;
Location start;
public Pair(String name, Location start) {
this.name = name;
this.start = start;
}
@Override
public String toString() {
return "<" + name + ", " + start + ">";
}
}
// TODO Fix Output
@Override
public String toString() {
return "\nvars: " + variables + "\nchilds: " + children + "\nendPos:" + end;
}
}
\ No newline at end of file
package de.in.tum.www2.cup.analysis;
public class JavaVariableVisitor extends Visitor<Object> {
}
Supports Markdown
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