All Downloads are FREE. Search and download functionalities are using the official Maven repository.

urfer.jsurfer-simple.1.2.4.source-code.JsonPath.g4 Maven / Gradle / Ivy

There is a newer version: 1.2.5
Show newest version
grammar JsonPath;

@header {
package org.jsfr.json.compiler;
}

path: '$' (searchChild|search|childNode|childrenNode|index|indexes|slicing|filter|anyChild|anyIndex|any)* EOF;
searchChild: '..' KEY;
search: '..' ;
anyChild: '.*' ;
anyIndex: '[*]' ;
any: '*' ;
childNode: '.' KEY ;
childrenNode: '[' KEY ( ',' KEY )* ']' ;
index: '[' NUM ']';
indexes: '[' NUM ( ',' NUM )* ']' ;
slicing: '[' NUM? COLON NUM? ']';
filter: '[' expr ']';
expr : expr ('&&' expr)+
           | expr ('||' expr)+
           | '*'
           | '@.' KEY
           | '@.' KEY '>' NUM
           | '@.' KEY '<' NUM
           | '@.length-' NUM
           | '@.' KEY '==' NUM
           | '@.' KEY '==\'' KEY '\''
           ;
COLON : ':';
KEY : [a-zA-Z][a-zA-Z0-9_]* ;
NUM : '0' | [1-9][0-9]* ;
WS  :   [ \t\n\r]+ -> skip ;






© 2015 - 2025 Weber Informatics LLC | Privacy Policy