能解析@xxx ,@xx.xx 这种表达式
grammar Expr;
expression :
'(' expression ')' # parens
| expression 'and' expression # andOp
| expression 'or' expression # orOp
| AT_VARNAME comparison_op NUMBER # comparison
| AT_VARNAME comparison_op STRING # comparison
| AT_VARNAME comparison_op VARNAME # comparison
| AT_VARNAME contains_op VARNAME # comparison
| AT_VARNAME contains_op NUMBER # comparison
| AT_VARNAME contains_op STRING # comparison
| AT_VARNAME comparison_op AT_VARNAME # comparison
| VARNAME comparison_op NUMBER # comparison
| VARNAME comparison_op STRING # comparison
| NUMBER comparison_op NUMBER # comparison
| STRING comparison_op STRING # comparison
| VARNAME comparison_op VARNAME # comparison
| VARNAME contains_op VARNAME # comparison
| VARNAME contains_op NUMBER # comparison
| VARNAME contains_op STRING # comparison
| STRING contains_op STRING # comparison
;
comparison_op : '<' | '<=' | '>' | '>=' | '==' | '!=';
contains_op: 'contains' | 'notcontains';
AT_VARNAME : '@' [a-zA-Z_0-9.]* VARNAME;
STRING : '\'' ( '\\' . | '\\\'' | ~[\\'] )* '\'';
NUMBER : '-'? [0-9]+ ('.' [0-9]+)?;
VARNAME : [a-zA-Z_][a-zA-Z_0-9]*;
WS : [ \t\r\n]+ -> skip; // 忽略空白字符
fragment Letter: [a-zA-Z];
fragment Digit: [0-9];
fragment ChineseCharacter: [\u4e00-\u9fa5];