Force path expression parsing consume all data
[yangtools.git] / yang / yang-data-impl / src / main / antlr4 / org / opendaylight / yangtools / yang / data / impl / leafref / LeafRefPathParser.g4
1 parser grammar LeafRefPathParser;
2
3 options {
4     tokenVocab = LeafRefPathLexer;
5 }
6
7 path_arg : (absolute_path | relative_path) EOF;
8
9 absolute_path : (SLASH node_identifier (path_predicate)*)+;
10
11 relative_path : (DOTS SLASH)* descendant_path;
12
13 descendant_path : node_identifier ((path_predicate)* absolute_path)?;
14
15 path_predicate : LEFT_SQUARE_BRACKET SEP? path_equality_expr SEP? RIGHT_SQUARE_BRACKET;
16
17 path_equality_expr : node_identifier SEP? EQUAL SEP? path_key_expr;
18
19 path_key_expr : current_function_invocation SEP? SLASH SEP? rel_path_keyexpr;
20
21 rel_path_keyexpr : (DOTS SEP? SLASH SEP?)* (node_identifier SEP? SLASH SEP?)* node_identifier;
22
23 node_identifier : (prefix COLON)? identifier;
24
25 current_function_invocation : CURRENT_KEYWORD SEP? LEFT_PARENTHESIS SEP? RIGHT_PARENTHESIS;
26
27 prefix : identifier;
28
29 identifier: IDENTIFIER | CURRENT_KEYWORD;
30