提交 84990ad6 编写于 作者: A Andy Clement

Parser error message improvements: grammar tweak to disallow 0xF00G (was...

Parser error message improvements: grammar tweak to disallow 0xF00G (was treated as number then property reference - even without a dot)
上级 7d114a1a
......@@ -46,9 +46,14 @@ tokens {
// applies only to the lexer:
@lexer::header {package org.springframework.expression.spel.generated;}
@members {
// For collecting info whilst processing rules that can be used in messages
protected Stack<String> paraphrase = new Stack<String>();
}
@rulecatch {
catch(RecognitionException e) {
//reportError(e);
reportError(e);
throw e;
}
}
......@@ -70,9 +75,12 @@ expression :
parenExpr : LPAREN! expression RPAREN!;// (ROGUE! | RPAREN!);
logicalOrExpression : logicalAndExpression (OR^ logicalAndExpression)*;
logicalOrExpression
// possible extra info we could use for better error messages
: logicalAndExpression (OR^ logicalAndExpression)*;
logicalAndExpression : relationalExpression (AND^ relationalExpression)*;
logicalAndExpression
: relationalExpression (AND^ relationalExpression)*;
relationalExpression : sumExpression (relationalOperator^ sumExpression)?;
......@@ -121,17 +129,22 @@ startNode
// | attribute
;
node:
( methodOrProperty
node
: ((DOT dottedNode) | nonDottedNode)+;
nonDottedNode
: indexer;
dottedNode
:
((methodOrProperty
| functionOrVar
| indexer
| projection
| selection
| firstSelection
| lastSelection
| exprList
| DOT
)+
))
;
functionOrVar
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册