occam-grammars 1.3.14 → 1.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/example.js +2 -2
- package/lib/furtle/bnf.js +2 -2
- package/package.json +1 -1
- package/src/furtle/bnf.js +67 -67
package/lib/furtle/bnf.js
CHANGED
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "default", {
|
|
|
8
8
|
return _default;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
var bnf = 'document
|
|
11
|
+
var bnf = 'document ::= ( topLevelDeclaration | error )+ ;\n\n\n\ntopLevelDeclaration ::= procedureDeclaration\n \n | variablesDeclaration\n \n ;\n\n\n\nerror. ::= . ;\n\n\n\ninstruction ::= variablesDeclaration\n \n | variableAssignment \n \n | objectAssignment \n \n | arrayAssignment\n \n ;\n\n\n\nprocedureDeclaration ::= [type] label<NO_WHITESPACE>"(" ( argument ( "," argument )* )? ")" returnBlock ;\n\nvariablesDeclaration ::= [type] variable assignment? ( "," variable assignment? )* ";" ;\n\nvariableAssignment ::= variable assignment ";" ;\n\nobjectAssignment ::= "{" \n\n [type]? variable ( "," [type]? variable )* \n \n "}" "=" variable ";" ;\n\narrayAssignment ::= "[" \n\n ( \n\n ( "_" ( "," "_" )* ( "," [type]? variable )+ ) \n \n | \n \n ( [type]? variable ( "," [type]? variable )* ) \n \n ) \n \n "]" "=" variable ";" ;\n \n \n\nanonymousFunction ::= "(" ( argument ( "," argument )* )? ")" returnBlock ;\n\nconditionalBlock ::= "If" "(" condition ")" block ( "Else" block )? ; \n\nforEachLoop ::= "ForEach"<NO_WHITESPACE>"(" variable "," anonymousFunction ")" ";" ;\n\ncondition ::= "(" condition ")" \n\n | condition ( "||" | "&&" ) condition \n\n | value ( ( "!=" | "==" ) value )? \n \n ;\n \n\n\nreturnBlock.. ::= "{" ( conditionalBlock | forEachLoop | instruction | nonsense )* return? "}" ;\n \nblock.. ::= "{" ( conditionalBlock | forEachLoop | instruction | nonsense )* "}" ;\n\n\n\nnonsense. ::= [type] | [keyword] | [primitive] | [instruction] | [special] | [name] | [number] | [unassigned] ;\n \n\n \nreturn ::= [return] value ";" ; \n\nvalue ::= variable | [number] | [primitive] | [string-literal] ;\n\nargument ::= [type] variable ;\n\nvariable ::= [name] ;\n\nassignment ::= "=" ( procedureCall | nodesQuery | nodeQuery | value ) ;\n\n\n\nprocedureCall ::= reference<NO_WHITESPACE>"(" ( value ( "," value )* )? ")" ;\n\nnodesQuery ::= "nodesQuery"<NO_WHITESPACE>"(" variable "," expression ")" ;\n\nnodeQuery ::= "nodeQuery"<NO_WHITESPACE>"(" variable "," expression ")" ;\n\n\n\nlabel. ::= [name] ;\n\nreference. ::= [name] ;\n\n\n\nexpression ::= path spread? subExpression? ;\n\npath ::= "/" infiniteDescent? selectors ;\n\nsubExpression ::= path spread? subExpression?;\n\ninfiniteDescent ::= "/" ;\n\nselectors ::= selector ( "|" selector )* ;\n\nspread ::= unique\n\n | "[" \n \n ( \n \n ( startIndex "..." endIndex ) \n \n | \n \n ( startIndex "..." ) \n \n | \n \n ( "..." endIndex )\n \n | \n \n index \n \n ) \n \n "]" ;\n\nselector ::= ruleName | tokenType ;\n \nruleName ::= [name] | "*" ;\n \ntokenType ::= "@"<NO_WHITESPACE>( [name] | "*" ) ;\n \nstartIndex ::= [number] ;\n \nendIndex ::= [number] ;\n \nindex ::= [number] ;\n \nunique ::= "!" ;';
|
|
12
12
|
var _default = bnf;
|
|
13
13
|
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mdXJ0bGUvYm5mLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5jb25zdCBibmYgPSBgZG9jdW1lbnQgICAgICAgICAgICAgICA6Oj0gICggdG9wTGV2ZWxEZWNsYXJhdGlvbiB8IGVycm9yICkrIDtcblxuXG5cbnRvcExldmVsRGVjbGFyYXRpb24gICAgOjo9ICBwcm9jZWR1cmVEZWNsYXJhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgfCAgdmFyaWFibGVzRGVjbGFyYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgIDtcblxuXG5cbmVycm9yLiAgICAgICAgICAgICAgICAgOjo9ICAuIDtcblxuXG5cbmluc3RydWN0aW9uICAgICAgICAgICAgOjo9ICB2YXJpYWJsZXNEZWNsYXJhdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgfCAgdmFyaWFibGVBc3NpZ25tZW50IFxuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgfCAgb2JqZWN0QXNzaWdubWVudCBcbiAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgIHwgIGFycmF5QXNzaWdubWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgO1xuXG5cblxucHJvY2VkdXJlRGVjbGFyYXRpb24gICA6Oj0gIFt0eXBlXSBsYWJlbDxOT19XSElURVNQQUNFPlwiKFwiICggYXJndW1lbnQgKCBcIixcIiBhcmd1bWVudCApKiApPyBcIilcIiByZXR1cm5CbG9jayA7XG5cbnZhcmlhYmxlc0RlY2xhcmF0aW9uICAgOjo9ICBbdHlwZV0gdmFyaWFibGUgYXNzaWdubWVudD8gKCBcIixcIiB2YXJpYWJsZSBhc3NpZ25tZW50PyApKiBcIjtcIiA7XG5cbnZhcmlhYmxlQXNzaWdubWVudCAgICAgOjo9ICB2YXJpYWJsZSBhc3NpZ25tZW50IFwiO1wiIDtcblxub2JqZWN0QXNzaWdubWVudCAgICAgICA6Oj0gIFwie1wiIFxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgW3R5cGVdPyB2YXJpYWJsZSAoIFwiLFwiIFt0eXBlXT8gdmFyaWFibGUgKSogXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIn1cIiBcIj1cIiB2YXJpYWJsZSBcIjtcIiA7XG5cbmFycmF5QXNzaWdubWVudCAgICAgICAgOjo9ICBcIltcIiBcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICggXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggXCJfXCIgKCBcIixcIiBcIl9cIiApKiAoIFwiLFwiIFt0eXBlXT8gdmFyaWFibGUgKSsgKSBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCBbdHlwZV0/IHZhcmlhYmxlICggXCIsXCIgW3R5cGVdPyB2YXJpYWJsZSApKiApIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIl1cIiBcIj1cIiB2YXJpYWJsZSBcIjtcIiA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuXG5hbm9ueW1vdXNGdW5jdGlvbiAgICAgIDo6PSAgXCIoXCIgKCBhcmd1bWVudCAoIFwiLFwiIGFyZ3VtZW50ICkqICk/IFwiKVwiIHJldHVybkJsb2NrIDtcblxuY29uZGl0aW9uYWxCbG9jayAgICAgICA6Oj0gIFwiSWZcIiBcIihcIiBjb25kaXRpb24gXCIpXCIgYmxvY2sgKCBcIkVsc2VcIiBibG9jayApPyA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcblxuZm9yRWFjaExvb3AgICAgICAgICAgICA6Oj0gIFwiRm9yRWFjaFwiPE5PX1dISVRFU1BBQ0U+XCIoXCIgdmFyaWFibGUgXCIsXCIgYW5vbnltb3VzRnVuY3Rpb24gXCIpXCIgXCI7XCIgO1xuXG5jb25kaXRpb24gICAgICAgICAgICAgIDo6PSAgXCIoXCIgY29uZGl0aW9uIFwiKVwiIFxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgfCAgY29uZGl0aW9uICggXCJ8fFwiIHwgXCImJlwiICkgY29uZGl0aW9uIFxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgfCAgdmFsdWUgKCAoIFwiIT1cIiB8IFwiPT1cIiApIHZhbHVlICk/IFxuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgO1xuICAgICAgICAgICAgICAgICAgICAgICAgXG5cblxucmV0dXJuQmxvY2suLiAgICAgICAgICA6Oj0gIFwie1wiICggY29uZGl0aW9uYWxCbG9jayB8IGZvckVhY2hMb29wIHwgaW5zdHJ1Y3Rpb24gfCBub25zZW5zZSApKiByZXR1cm4/IFwifVwiIDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuYmxvY2suLiAgICAgICAgICAgICAgICA6Oj0gIFwie1wiICggY29uZGl0aW9uYWxCbG9jayB8IGZvckVhY2hMb29wIHwgaW5zdHJ1Y3Rpb24gfCBub25zZW5zZSApKiBcIn1cIiA7XG5cblxuXG5ub25zZW5zZS4gICAgICAgICAgICAgIDo6PSAgW3R5cGVdIHwgW2tleXdvcmRdIHwgW3ByaW1pdGl2ZV0gfCBbaW5zdHJ1Y3Rpb25dIHwgW3NwZWNpYWxdIHwgW25hbWVdIHwgW251bWJlcl0gfCBbdW5hc3NpZ25lZF0gO1xuICAgIFxuXG4gICAgXG5yZXR1cm4gICAgICAgICAgICAgICAgIDo6PSAgW3JldHVybl0gdmFsdWUgXCI7XCIgOyBcblxudmFsdWUgICAgICAgICAgICAgICAgICA6Oj0gIHZhcmlhYmxlIHwgW251bWJlcl0gfCBbcHJpbWl0aXZlXSB8IFtzdHJpbmctbGl0ZXJhbF0gO1xuXG5hcmd1bWVudCAgICAgICAgICAgICAgIDo6PSAgW3R5cGVdIHZhcmlhYmxlIDtcblxudmFyaWFibGUgICAgICAgICAgICAgICA6Oj0gIFtuYW1lXSA7XG5cbmFzc2lnbm1lbnQgICAgICAgICAgICAgOjo9ICBcIj1cIiAoIHByb2NlZHVyZUNhbGwgfCBub2Rlc1F1ZXJ5IHwgbm9kZVF1ZXJ5IHwgdmFsdWUgKSA7XG5cblxuXG5wcm9jZWR1cmVDYWxsICAgICAgICAgIDo6PSAgcmVmZXJlbmNlPE5PX1dISVRFU1BBQ0U+XCIoXCIgKCB2YWx1ZSAoIFwiLFwiIHZhbHVlICkqICk/IFwiKVwiIDtcblxubm9kZXNRdWVyeSAgICAgICAgICAgICA6Oj0gIFwibm9kZXNRdWVyeVwiPE5PX1dISVRFU1BBQ0U+XCIoXCIgdmFyaWFibGUgXCIsXCIgZXhwcmVzc2lvbiBcIilcIiA7XG5cbm5vZGVRdWVyeSAgICAgICAgICAgICAgOjo9ICBcIm5vZGVRdWVyeVwiPE5PX1dISVRFU1BBQ0U+XCIoXCIgdmFyaWFibGUgXCIsXCIgZXhwcmVzc2lvbiBcIilcIiA7XG5cblxuXG5sYWJlbC4gICAgICAgICAgICAgICAgIDo6PSAgW25hbWVdIDtcblxucmVmZXJlbmNlLiAgICAgICAgICAgICA6Oj0gIFtuYW1lXSA7XG5cblxuXG5leHByZXNzaW9uICAgICAgICAgICAgIDo6PSAgcGF0aCBzcHJlYWQ/IHN1YkV4cHJlc3Npb24/IDtcblxucGF0aCAgICAgICAgICAgICAgICAgICA6Oj0gIFwiL1wiIGluZmluaXRlRGVzY2VudD8gc2VsZWN0b3JzIDtcblxuc3ViRXhwcmVzc2lvbiAgICAgICAgICA6Oj0gIHBhdGggc3ByZWFkPyBzdWJFeHByZXNzaW9uPztcblxuaW5maW5pdGVEZXNjZW50ICAgICAgICA6Oj0gIFwiL1wiIDtcblxuc2VsZWN0b3JzICAgICAgICAgICAgICA6Oj0gIHNlbGVjdG9yICggXCJ8XCIgc2VsZWN0b3IgKSogO1xuXG5zcHJlYWQgICAgICAgICAgICAgICAgIDo6PSAgdW5pcXVlXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICB8ICBcIltcIiBcbiAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICggXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggc3RhcnRJbmRleCBcIi4uLlwiIGVuZEluZGV4ICkgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggc3RhcnRJbmRleCBcIi4uLlwiICkgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICggXCIuLi5cIiBlbmRJbmRleCApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiXVwiIDtcblxuc2VsZWN0b3IgICAgICAgICAgICAgICA6Oj0gIHJ1bGVOYW1lIHwgdG9rZW5UeXBlIDtcbiAgICAgICAgICAgICAgICAgICBcbnJ1bGVOYW1lICAgICAgICAgICAgICAgOjo9ICBbbmFtZV0gfCBcIipcIiA7XG4gICAgICAgICAgICAgICAgICAgXG50b2tlblR5cGUgICAgICAgICAgICAgIDo6PSAgXCJAXCI8Tk9fV0hJVEVTUEFDRT4oIFtuYW1lXSB8IFwiKlwiICkgO1xuICAgICAgICAgICAgICAgICAgIFxuc3RhcnRJbmRleCAgICAgICAgICAgICA6Oj0gIFtudW1iZXJdIDtcbiAgICAgICAgICAgICAgICAgICBcbmVuZEluZGV4ICAgICAgICAgICAgICAgOjo9ICBbbnVtYmVyXSA7XG4gICAgICAgICAgICAgICAgICAgXG5pbmRleCAgICAgICAgICAgICAgICAgIDo6PSAgW251bWJlcl0gO1xuICAgICAgICAgICAgICAgICAgIFxudW5pcXVlICAgICAgICAgICAgICAgICA6Oj0gIFwiIVwiIDtgO1xuXG5leHBvcnQgZGVmYXVsdCBibmY7XG4iXSwibmFtZXMiOlsiYm5mIl0sIm1hcHBpbmdzIjoiQUFBQTs7OzsrQkE4SkE7OztlQUFBOzs7QUE1SkEsSUFBTUEsTUFBTztJQTRKYixXQUFlQSJ9
|
package/package.json
CHANGED
package/src/furtle/bnf.js
CHANGED
|
@@ -1,159 +1,159 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const bnf = `document
|
|
3
|
+
const bnf = `document ::= ( topLevelDeclaration | error )+ ;
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
topLevelDeclaration
|
|
7
|
+
topLevelDeclaration ::= procedureDeclaration
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
| variablesDeclaration
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
;
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
error.
|
|
15
|
+
error. ::= . ;
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
instruction
|
|
19
|
+
instruction ::= variablesDeclaration
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
| variableAssignment
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
| objectAssignment
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
| arrayAssignment
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
;
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
procedureDeclaration ::= [type] label<NO_WHITESPACE>"(" ( argument ( "," argument )* )? ")" returnBlock ;
|
|
32
32
|
|
|
33
|
-
variablesDeclaration
|
|
33
|
+
variablesDeclaration ::= [type] variable assignment? ( "," variable assignment? )* ";" ;
|
|
34
34
|
|
|
35
|
-
variableAssignment
|
|
35
|
+
variableAssignment ::= variable assignment ";" ;
|
|
36
36
|
|
|
37
|
-
objectAssignment
|
|
37
|
+
objectAssignment ::= "{"
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
[type]? variable ( "," [type]? variable )*
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
"}" "=" variable ";" ;
|
|
42
42
|
|
|
43
|
-
arrayAssignment
|
|
43
|
+
arrayAssignment ::= "["
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
(
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
( "_" ( "," "_" )* ( "," [type]? variable )+ )
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
|
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
( [type]? variable ( "," [type]? variable )* )
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
)
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
"]" "=" variable ";" ;
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
anonymousFunction
|
|
59
|
+
anonymousFunction ::= "(" ( argument ( "," argument )* )? ")" returnBlock ;
|
|
60
60
|
|
|
61
|
-
conditionalBlock
|
|
61
|
+
conditionalBlock ::= "If" "(" condition ")" block ( "Else" block )? ;
|
|
62
62
|
|
|
63
|
-
forEachLoop
|
|
63
|
+
forEachLoop ::= "ForEach"<NO_WHITESPACE>"(" variable "," anonymousFunction ")" ";" ;
|
|
64
64
|
|
|
65
|
-
condition
|
|
65
|
+
condition ::= "(" condition ")"
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
| condition ( "||" | "&&" ) condition
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
| value ( ( "!=" | "==" ) value )?
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
;
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
returnBlock..
|
|
75
|
+
returnBlock.. ::= "{" ( conditionalBlock | forEachLoop | instruction | nonsense )* return? "}" ;
|
|
76
76
|
|
|
77
|
-
block..
|
|
77
|
+
block.. ::= "{" ( conditionalBlock | forEachLoop | instruction | nonsense )* "}" ;
|
|
78
78
|
|
|
79
79
|
|
|
80
80
|
|
|
81
|
-
nonsense.
|
|
81
|
+
nonsense. ::= [type] | [keyword] | [primitive] | [instruction] | [special] | [name] | [number] | [unassigned] ;
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
|
|
85
|
-
return
|
|
85
|
+
return ::= [return] value ";" ;
|
|
86
86
|
|
|
87
|
-
value
|
|
87
|
+
value ::= variable | [number] | [primitive] | [string-literal] ;
|
|
88
88
|
|
|
89
|
-
argument
|
|
89
|
+
argument ::= [type] variable ;
|
|
90
90
|
|
|
91
|
-
variable
|
|
91
|
+
variable ::= [name] ;
|
|
92
92
|
|
|
93
|
-
assignment
|
|
93
|
+
assignment ::= "=" ( procedureCall | nodesQuery | nodeQuery | value ) ;
|
|
94
94
|
|
|
95
95
|
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
procedureCall ::= reference<NO_WHITESPACE>"(" ( value ( "," value )* )? ")" ;
|
|
98
98
|
|
|
99
|
-
nodesQuery
|
|
99
|
+
nodesQuery ::= "nodesQuery"<NO_WHITESPACE>"(" variable "," expression ")" ;
|
|
100
100
|
|
|
101
|
-
nodeQuery
|
|
101
|
+
nodeQuery ::= "nodeQuery"<NO_WHITESPACE>"(" variable "," expression ")" ;
|
|
102
102
|
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
label.
|
|
105
|
+
label. ::= [name] ;
|
|
106
106
|
|
|
107
|
-
reference.
|
|
107
|
+
reference. ::= [name] ;
|
|
108
108
|
|
|
109
109
|
|
|
110
110
|
|
|
111
|
-
expression
|
|
111
|
+
expression ::= path spread? subExpression? ;
|
|
112
112
|
|
|
113
|
-
path
|
|
113
|
+
path ::= "/" infiniteDescent? selectors ;
|
|
114
114
|
|
|
115
|
-
subExpression
|
|
115
|
+
subExpression ::= path spread? subExpression?;
|
|
116
116
|
|
|
117
|
-
infiniteDescent
|
|
117
|
+
infiniteDescent ::= "/" ;
|
|
118
118
|
|
|
119
|
-
selectors
|
|
119
|
+
selectors ::= selector ( "|" selector )* ;
|
|
120
120
|
|
|
121
|
-
spread
|
|
121
|
+
spread ::= unique
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
| "["
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
(
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
( startIndex "..." endIndex )
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
|
|
|
130
130
|
|
|
131
|
-
|
|
131
|
+
( startIndex "..." )
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
|
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
( "..." endIndex )
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
|
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
index
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
)
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
"]" ;
|
|
144
144
|
|
|
145
|
-
selector
|
|
145
|
+
selector ::= ruleName | tokenType ;
|
|
146
146
|
|
|
147
|
-
ruleName
|
|
147
|
+
ruleName ::= [name] | "*" ;
|
|
148
148
|
|
|
149
|
-
tokenType
|
|
149
|
+
tokenType ::= "@"<NO_WHITESPACE>( [name] | "*" ) ;
|
|
150
150
|
|
|
151
|
-
startIndex
|
|
151
|
+
startIndex ::= [number] ;
|
|
152
152
|
|
|
153
|
-
endIndex
|
|
153
|
+
endIndex ::= [number] ;
|
|
154
154
|
|
|
155
|
-
index
|
|
155
|
+
index ::= [number] ;
|
|
156
156
|
|
|
157
|
-
unique
|
|
157
|
+
unique ::= "!" ;`;
|
|
158
158
|
|
|
159
159
|
export default bnf;
|