Commit 7c7ee465 authored by Sebastian Pretscher's avatar Sebastian Pretscher

Merge branch 'master' of git@github.com:jroith/cup-eclipse.git

parents 3e9e12df 1f23a380
......@@ -94,6 +94,7 @@ import java_cup.runtime.ComplexSymbolFactory.ComplexSymbol;
import java.util.Hashtable;
import java.util.Stack;
import java.util.List;
import java.util.LinkedList;
import java.util.ArrayList;
import de.in.tum.www2.cup.*;
import de.in.tum.www2.cup.ast.*;
......@@ -241,7 +242,10 @@ parser code {:
}
/* override error routines */
protected Lexer lexer;
@Override
public void report_fatal_error(
String message,
Object info)
......@@ -254,6 +258,7 @@ parser code {:
throw new ParserAbortException();
}
@Override
public void report_error(String message, Object info)
{
if (info instanceof Symbol)
......@@ -261,6 +266,16 @@ parser code {:
else
errMan.Error(ErrorSource.Parser, message, (ComplexSymbol) cur_token);
}
@Override
protected void report_expected_token_ids() {
List<Integer> ids = expected_token_ids();
LinkedList<String> list = new LinkedList<String>();
for (Integer expected : ids)
list.add(symbl_name_from_id(expected));
String msg = "instead expected token classes are " + list;
errMan.Error(ErrorSource.Parser, msg);
}
:};
/*---------------------------------------------------------------- */
......
......@@ -100,6 +100,10 @@ public class ErrorManager
Error(ErrorSource.Unknown, msg, null, null);
}
public void Error(ErrorSource source, String msg) {
Error(source, msg, null, null);
}
public void Error(ErrorSource source, String msg, Position start) {
Error(source, msg, start, null);
}
......
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