Commit 40f6b28e authored by Johannes Roith's avatar Johannes Roith

Adding back my changes.

parent 7b124570
......@@ -240,9 +240,11 @@ parser code {:
Object info)
{
done_parsing();
if (info instanceof Symbol) errMan.Fatal(message+ "\nCan't recover from previous error(s), giving up.",(Symbol)info);
else errMan.Fatal(message + "\nCan't recover from previous error(s), giving up.",cur_token);
System.exit(1);
if (info instanceof Symbol)
errMan.Fatal(message+ "\nCan't recover from previous error(s), giving up.",(Symbol)info);
else
errMan.Fatal(message + "\nCan't recover from previous error(s), giving up.",cur_token);
throw new ParserAbortException();
}
public void report_error(String message, Object info)
......
......@@ -5,6 +5,7 @@ import java.io.FileInputStream;
import de.in.tum.www2.cup.ast.*;
import de.in.tum.www2.cup.internal.Parser;
import de.in.tum.www2.cup.internal.ParserAbortException;
public class CupParser
{
......@@ -29,7 +30,12 @@ public class CupParser
public ParserResult parse() throws Exception {
if (result != null)
return result;
parser.parse();
try {
parser.parse();
} catch (ParserAbortException e) {
this.context = null;
return null;
}
result = parser.getResult();
return result;
}
......
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