use of kalang.ast.ErrorousExpr in project kalang by kasonyang.
the class AstBuilder method visitExpression.
protected ExprNode visitExpression(ExpressionContext expression) {
Object node = visit(expression);
if (node instanceof ExprNode) {
return (ExprNode) node;
} else {
ExprNode expr;
if (node instanceof AstNode) {
expr = new ErrorousExpr((AstNode) node);
} else {
expr = new ErrorousExpr();
}
this.diagnosisReporter.report(Diagnosis.Kind.ERROR, "not an expression", expression);
return expr;
}
}
Aggregations