use of antlrGenerated.L42Parser.NudeEContext in project L42 by ElvisResearchGroup.
the class Parser method parse.
public static synchronized Expression parse(String fileName, String s) {
String old = Parser.fileName;
Parser.fileName = fileName;
try {
checkForTab(s);
checkForBalancedParenthesis(s);
s = replaceORoundWithTab(s);
NudeEContext ctxResult = parseCtx(s);
Expression result = ctxResult.accept(new ToAst());
return result;
} finally {
Parser.fileName = old;
}
}
use of antlrGenerated.L42Parser.NudeEContext in project L42 by ElvisResearchGroup.
the class Parser method parseCtx.
private static NudeEContext parseCtx(String s) {
LoggedPrintStream lpsErr = LoggedPrintStream.create(System.err);
System.setErr(lpsErr);
try {
NudeEContext ctxResult = getParser(s).nudeE();
if (lpsErr.buf.length() != 0) {
throw new ParseCancellationException("\n\n------------------------------------\nCurrent file: " + Parser.fileName + "\nParsing error:\n" + lpsErr.buf.toString());
}
return ctxResult;
} finally {
System.setErr(lpsErr.underlying);
}
}
Aggregations