Commit 0810f729 authored by Clemens Pflaum's avatar Clemens Pflaum
Browse files

fixed minor errors

parent 293af80a
...@@ -6,7 +6,7 @@ public class NoOpErrorReporter implements IErrorReporter ...@@ -6,7 +6,7 @@ public class NoOpErrorReporter implements IErrorReporter
public void report(ErrorType type, ErrorSource source, ErrorCode errorCode, public void report(ErrorType type, ErrorSource source, ErrorCode errorCode,
String message, Position start, Position end) String message, Position start, Position end)
{ {
System.out.println("Noop: you have an Error: \n" + System.out.println("NoOp: you have an Error: \n" +
"start:"+start+" end:"+end+" " + message); "start:"+start+" end:"+end+" " + message);
} }
......
...@@ -3,7 +3,6 @@ package de.in.tum.www2.cup.ast; ...@@ -3,7 +3,6 @@ package de.in.tum.www2.cup.ast;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List;
import org.eclipse.jdt.core.dom.ASTVisitor; import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.FieldDeclaration; import org.eclipse.jdt.core.dom.FieldDeclaration;
...@@ -29,7 +28,6 @@ public class BindingCollector extends ASTVisitor { ...@@ -29,7 +28,6 @@ public class BindingCollector extends ASTVisitor {
@Override @Override
public boolean visit(FieldDeclaration node) { public boolean visit(FieldDeclaration node) {
System.out.println("buhu");
for (Iterator iter = node.fragments().iterator(); iter.hasNext();) { for (Iterator iter = node.fragments().iterator(); iter.hasNext();) {
VariableDeclarationFragment fragment = (VariableDeclarationFragment) iter.next(); VariableDeclarationFragment fragment = (VariableDeclarationFragment) iter.next();
IVariableBinding binding= (IVariableBinding) fragment.resolveBinding(); IVariableBinding binding= (IVariableBinding) fragment.resolveBinding();
......
...@@ -92,6 +92,8 @@ public abstract class CodeBlock extends AbstractNode { ...@@ -92,6 +92,8 @@ public abstract class CodeBlock extends AbstractNode {
for (IProblem problem : problems) { for (IProblem problem : problems) {
// Adding 2 here is a hack: "{:" // Adding 2 here is a hack: "{:"
// TODO: Position needs line and column number // TODO: Position needs line and column number
int start = problem.getSourceStart() - dummyClassOffset + cupOffset + 2;
int end = problem.getSourceEnd() - dummyClassOffset + cupOffset + 2;
errMan.Warning(ErrorSource.Parser, problem.getMessage(), errMan.Warning(ErrorSource.Parser, problem.getMessage(),
Position.fromOffset(problem.getSourceStart() - dummyClassOffset + cupOffset + 2), Position.fromOffset(problem.getSourceStart() - dummyClassOffset + cupOffset + 2),
Position.fromOffset(problem.getSourceEnd() - dummyClassOffset + cupOffset + 2)); Position.fromOffset(problem.getSourceEnd() - dummyClassOffset + cupOffset + 2));
......
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