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

l.restql-core.2.1.7.source-code.grammar.ebnf Maven / Gradle / Ivy

The newest version!
Query =
   WS (UseBlock WS LS WS)? QueryBlock;

UseBlock =
  UseRule (WS LS WS UseRule)*;

UseRule =
  KW_USE WS_MAND UseRuleKey WS EQUALS_SIGN WS UseRuleValue;

UseRuleKey =
  Identifier;

UseRuleValue =
  Primitive;

QueryBlock =
  QueryItem (WS LS WS QueryItem)*;

QueryItem =
  WS FromRule (WS_MAND HeaderRule)?  (WS_MAND TimeoutRule)?  (WS_MAND WithRule)? (WS_MAND WithBodyRule)?  (WS_MAND (OnlyRule | HideRule))? (WS_MAND FlagsRule)? WS;


 =
  KW_FROM WS FromResource (WS_MAND KW_AS WS_MAND ResultAlias)?;

FromResource =
  Identifier;

ResultAlias =
  Identifier;


TimeoutRule =
  KW_TIMEOUT WS_MAND TimeoutRuleValue;

TimeoutRuleValue =
  Integer;


HeaderRule =
  KW_HEADERS WS_MAND HeaderRuleItem (WS LS WS HeaderRuleItem)*;

HeaderRuleItem =
  HeaderName WS EQUALS_SIGN WS HeaderValue;

HeaderName =
  (Digit | Letter | "-" | "_")+;

HeaderValue =
  LiteralHeaderValue | Variable;

LiteralHeaderValue =
  String;

WithRule =
  KW_WITH WS_MAND WithRuleItem (WS LS WS WithRuleItem)*;

WithRuleItem =
  WithParamName WS EQUALS_SIGN WS WithParamValue;

WithParamName =
  QueryParameterName;

WithParamValue =
  WithParamValueData WithParamValueModifierList;

WithParamValueData =
  (WithParamPrimitiveValue | Chaining | ListParamValue | ComplexParamValue | Variable);

WithParamValueModifierList =
  (WS MOD_OPERATOR WS WithParamModifier)*;

WithParamPrimitiveValue =
  Primitive;

WithBodyRule =
  KW_WITH_BODY WS_MAND WithRuleItem (WS LS WS WithRuleItem)*;

ListParamValue =
  BEGIN_LIST WS END_LIST |
  BEGIN_LIST WS WithParamValue ( WS LS WS WithParamValue )* END_LIST;

ComplexParamValue =
  BEGIN_OBJ WS END_OBJ |
  BEGIN_OBJ WS ComplexParamItem ( WS OBJ_SEP WS ComplexParamItem)* WS END_OBJ;

ComplexParamItem =
  ComplexParamKey WS OBJ_PROP_SEP WS WithParamValue;

ComplexParamKey =
  Identifier | String;

Chaining =
  PathItem (CHAINING_OPERATOR PathItem)+;

Variable =
  <"$"> Identifier;

PathItem =
  Identifier;

 =
  (Letter | Digit | "_" | "-" | "." | "|")+;

WithParamModifier =
  WithModifierAlias | WithModifierFunction;

WithModifierAlias =
  Identifier;

WithModifierFunction =
  WithModifierFunctionName OPEN_PARAMS CLOSE_PARAMS |
  WithModifierFunctionName OPEN_PARAMS WithModifierFunctionArgList CLOSE_PARAMS;

WithModifierFunctionName =
  Identifier;

WithModifierFunctionArgList =
  WithModifierFunctionArg (WS ARGS_SEP WS WithModifierFunctionArg)*;

WithModifierFunctionArg =
  Primitive;

OnlyRule =
  KW_ONLY WS_MAND OnlyRuleItem (WS LS WS OnlyRuleItem)*;

OnlyRuleItem =
  OnlyRuleItemName OnlyRuleItemModifierList;

OnlyRuleItemName =
  OnlyRuleItemPath (CHAINING_OPERATOR OnlyRuleItemPath)*

OnlyRuleItemPath =
  Identifier | "*";

OnlyRuleItemModifierList =
  (WS MOD_OPERATOR WS OnlyRuleItemModifier)*;

OnlyRuleItemModifier =
  OnlyRuleItemModifierName WS OPEN_PARAMS WS CLOSE_PARAMS |
  OnlyRuleItemModifierName WS OPEN_PARAMS WS OnlyRuleItemModifierArgList WS CLOSE_PARAMS;

OnlyRuleItemModifierName =
  Identifier;

OnlyRuleItemModifierArgList =
  OnlyRuleItemModifierArg (WS ARGS_SEP WS OnlyRuleItemModifierArg)* | OnlyRuleItemModifierArgVar;

OnlyRuleItemModifierArg =
  Primitive;

OnlyRuleItemModifierArgVar =
  Variable;

HideRule =
  KW_HIDE;

FlagsRule =
  FlagRule (WS LS WS FlagRule)*;

FlagRule =
  IgnoreErrorsFlag;

IgnoreErrorsFlag =
  KW_IGNORE_ERRORS;

 =
  <"use">;

 =
  <"from">;

 =
  <"as">;

 =
  <"headers">;

 =
  <"timeout">;

 =
  <"with"|"params">;

 =
  <"body">;


 =
  <"only">;

 =
  <"hidden">;

 =
  <"ignore-errors">

 =
  <"=">;

 =
  <".">;

 =
  <"->">;

 =
  <"[">;

 =
  <"]">;

 =
  <"{">;

 =
  <"}">;

 =
  <",">;

 =
  <":">;

 =
  <"(">;

 =
  <")">;

 =
  <",">;


 =
  Letter (Digit | Letter | "-" | "_")*;

 =
  String | Number | Boolean | Null;

 =
  Quote StringChar* Quote;

 =
  True | False;

True =
  <"true">;

False =
  <"false">;

Null =
  <"null">;

 =
  Integer | Float;


 =
 "-"? ("0" | #"[1-9]\d*");

 =
  "-"? ( "0.0" | Integer "." Digit+ );

 =
  Unescaped;

 =
  #"[^\x00-\x1F\x22\x5C]";

 =
  "\"";

 =
  #"\d";

 =
  #"\w";

 =
  <"\n">;

(*List Separator*)
 =
  NL | <","> | Comment;

(*White Space*)
 =
  (SPACE | Comment)*;

 =
  (SPACE | Comment | NL)+;

 =
  <#"\s">;

 =
  BEGIN_COMMENT  END_COMMENT;

 =
  < "//" >;

 =
  < #"\n" >;

 =
  #"[^\x00-\x1F\n]";

 =
  CommentChar* ;





© 2015 - 2025 Weber Informatics LLC | Privacy Policy