occam-furtle 3.0.39 → 3.0.41

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.
Files changed (164) hide show
  1. package/lib/constants.js +1 -28
  2. package/lib/context/block.js +6 -7
  3. package/lib/context/file/furtle.js +6 -12
  4. package/lib/element/assignment/array.js +3 -3
  5. package/lib/element/assignment/object.js +3 -3
  6. package/lib/element/assignment/variable.js +3 -8
  7. package/lib/element/assignments/variable.js +5 -10
  8. package/lib/element/declaration/procedure.js +3 -8
  9. package/lib/element/error.js +3 -8
  10. package/lib/element/every.js +5 -5
  11. package/lib/element/expression.js +3 -8
  12. package/lib/element/label.js +3 -8
  13. package/lib/element/nodeQuery.js +3 -3
  14. package/lib/element/nodesQuery.js +3 -3
  15. package/lib/element/parameter/named.js +3 -3
  16. package/lib/element/parameter.js +3 -3
  17. package/lib/element/parameters/named.js +3 -3
  18. package/lib/element/parameters.js +3 -3
  19. package/lib/element/primitive.js +3 -3
  20. package/lib/element/procedure/anonymous.js +3 -3
  21. package/lib/element/procedure.js +3 -3
  22. package/lib/element/procedureCall.js +3 -3
  23. package/lib/element/reduce.js +5 -5
  24. package/lib/element/reference.js +3 -8
  25. package/lib/element/returnBlock.js +5 -5
  26. package/lib/element/some.js +5 -5
  27. package/lib/element/statement/return.js +3 -8
  28. package/lib/element/step.js +3 -8
  29. package/lib/element/term/bracketed.js +3 -8
  30. package/lib/element/term/comparison.js +3 -3
  31. package/lib/element/term/logical.js +3 -3
  32. package/lib/element/term/negated.js +3 -3
  33. package/lib/element/term.js +3 -8
  34. package/lib/element/terms.js +3 -8
  35. package/lib/element/ternary.js +3 -3
  36. package/lib/element/variable.js +3 -3
  37. package/lib/example/view.js +3 -4
  38. package/lib/furtle/parser.js +3 -3
  39. package/lib/index.js +7 -43
  40. package/lib/node/assignment.js +4 -9
  41. package/lib/node/assignments.js +4 -9
  42. package/lib/node/declaration.js +4 -9
  43. package/lib/node/document.js +4 -9
  44. package/lib/node/error.js +4 -9
  45. package/lib/node/every.js +4 -9
  46. package/lib/node/expression.js +4 -9
  47. package/lib/node/label.js +4 -9
  48. package/lib/node/nodeQuery.js +4 -9
  49. package/lib/node/nodesQuery.js +4 -9
  50. package/lib/node/nonsense.js +4 -9
  51. package/lib/node/parameter.js +4 -9
  52. package/lib/node/parameters.js +4 -9
  53. package/lib/node/primitive.js +4 -4
  54. package/lib/node/procedure.js +4 -9
  55. package/lib/node/procedureCall.js +4 -9
  56. package/lib/node/reduce.js +4 -9
  57. package/lib/node/reference.js +4 -9
  58. package/lib/node/returnBlock.js +4 -9
  59. package/lib/node/some.js +4 -9
  60. package/lib/node/statement.js +4 -9
  61. package/lib/node/step.js +4 -9
  62. package/lib/node/term.js +4 -9
  63. package/lib/node/terms.js +4 -9
  64. package/lib/node/ternary.js +4 -9
  65. package/lib/node/variable.js +4 -9
  66. package/lib/process/verify.js +5 -161
  67. package/package.json +7 -7
  68. package/src/constants.js +0 -12
  69. package/src/context/block.js +3 -4
  70. package/src/context/file/furtle.js +3 -4
  71. package/src/element/assignment/array.js +2 -1
  72. package/src/element/assignment/object.js +2 -1
  73. package/src/element/assignment/variable.js +1 -1
  74. package/src/element/assignments/variable.js +3 -3
  75. package/src/element/declaration/procedure.js +2 -2
  76. package/src/element/error.js +2 -2
  77. package/src/element/every.js +4 -2
  78. package/src/element/expression.js +1 -1
  79. package/src/element/label.js +1 -1
  80. package/src/element/nodeQuery.js +1 -1
  81. package/src/element/nodesQuery.js +2 -1
  82. package/src/element/parameter/named.js +2 -2
  83. package/src/element/parameter.js +2 -1
  84. package/src/element/parameters/named.js +2 -2
  85. package/src/element/parameters.js +2 -1
  86. package/src/element/primitive.js +1 -1
  87. package/src/element/procedure/anonymous.js +2 -1
  88. package/src/element/procedure.js +2 -1
  89. package/src/element/procedureCall.js +2 -1
  90. package/src/element/reduce.js +4 -2
  91. package/src/element/reference.js +1 -1
  92. package/src/element/returnBlock.js +4 -2
  93. package/src/element/some.js +4 -2
  94. package/src/element/statement/return.js +2 -2
  95. package/src/element/step.js +1 -1
  96. package/src/element/term/bracketed.js +2 -2
  97. package/src/element/term/comparison.js +2 -1
  98. package/src/element/term/logical.js +2 -1
  99. package/src/element/term/negated.js +2 -1
  100. package/src/element/term.js +1 -1
  101. package/src/element/terms.js +1 -1
  102. package/src/element/ternary.js +2 -1
  103. package/src/element/variable.js +2 -1
  104. package/src/example/view.js +1 -2
  105. package/src/furtle/parser.js +2 -1
  106. package/src/index.js +2 -11
  107. package/src/node/assignment.js +1 -1
  108. package/src/node/assignments.js +1 -1
  109. package/src/node/declaration.js +1 -1
  110. package/src/node/document.js +1 -1
  111. package/src/node/error.js +1 -1
  112. package/src/node/every.js +1 -1
  113. package/src/node/expression.js +1 -1
  114. package/src/node/label.js +1 -1
  115. package/src/node/nodeQuery.js +1 -1
  116. package/src/node/nodesQuery.js +1 -1
  117. package/src/node/nonsense.js +1 -1
  118. package/src/node/parameter.js +1 -1
  119. package/src/node/parameters.js +1 -1
  120. package/src/node/primitive.js +2 -1
  121. package/src/node/procedure.js +1 -1
  122. package/src/node/procedureCall.js +1 -1
  123. package/src/node/reduce.js +1 -1
  124. package/src/node/reference.js +1 -1
  125. package/src/node/returnBlock.js +1 -1
  126. package/src/node/some.js +1 -1
  127. package/src/node/statement.js +1 -1
  128. package/src/node/step.js +1 -1
  129. package/src/node/term.js +1 -1
  130. package/src/node/terms.js +1 -1
  131. package/src/node/ternary.js +1 -2
  132. package/src/node/variable.js +1 -1
  133. package/src/process/verify.js +2 -98
  134. package/{src → test}/context/file/nominal.js +5 -3
  135. package/test/file/furtle.js +14 -0
  136. package/test/file/nominal.js +15 -0
  137. package/test/helpers/nominal.js +32 -0
  138. package/lib/context/file/nominal.js +0 -272
  139. package/lib/context/file.js +0 -456
  140. package/lib/context/release.js +0 -446
  141. package/lib/context.js +0 -141
  142. package/lib/element.js +0 -207
  143. package/lib/log.js +0 -195
  144. package/lib/nonTerminalNode.js +0 -236
  145. package/lib/utilities/asynchronous.js +0 -458
  146. package/lib/utilities/context.js +0 -34
  147. package/lib/utilities/customGrammar.js +0 -55
  148. package/lib/utilities/lineIndex.js +0 -26
  149. package/lib/utilities/node.js +0 -78
  150. package/lib/utilities/nominal.js +0 -42
  151. package/lib/utilities/query.js +0 -43
  152. package/src/context/file.js +0 -149
  153. package/src/context/release.js +0 -222
  154. package/src/context.js +0 -42
  155. package/src/element.js +0 -27
  156. package/src/log.js +0 -132
  157. package/src/nonTerminalNode.js +0 -151
  158. package/src/utilities/asynchronous.js +0 -121
  159. package/src/utilities/context.js +0 -19
  160. package/src/utilities/customGrammar.js +0 -54
  161. package/src/utilities/lineIndex.js +0 -21
  162. package/src/utilities/node.js +0 -90
  163. package/src/utilities/nominal.js +0 -31
  164. package/src/utilities/query.js +0 -30
@@ -1,151 +0,0 @@
1
- "use strict";
2
-
3
- import { arrayUtilities } from "necessary";
4
-
5
- import { NonTerminalNode as NonTerminalNodeBase } from "occam-parsers";
6
-
7
- const { first } = arrayUtilities;
8
-
9
- export default class NonTerminalNode extends NonTerminalNodeBase {
10
- someTerminalNode(callback, tokenType) {
11
- return this.someChildNode((childNode, index) => {
12
- const childNodeTerminalNode = childNode.isTerminalNode();
13
-
14
- if (childNodeTerminalNode) {
15
- const terminalNode = childNode, ///
16
- terminalNodeType = terminalNode.getType();
17
-
18
- if (terminalNodeType === tokenType) {
19
- return callback(terminalNode, index);
20
- }
21
- }
22
- });
23
- }
24
-
25
- getNodeByRuleName(...ruleNames) {
26
- const node = this.findChildNode((childNode) => {
27
- const childNodeNonTerminalNode = childNode.isNonTerminalNode();
28
-
29
- if (childNodeNonTerminalNode) {
30
- const nonTerminalNode = childNode, ///
31
- ruleName = nonTerminalNode.getRuleName(),
32
- ruleNamesIncludesRuleName = ruleNames.includes(ruleName);
33
-
34
- if (ruleNamesIncludesRuleName) {
35
- return true;
36
- }
37
- }
38
- }) || null;
39
-
40
- return node;
41
- }
42
-
43
- getNodesByRuleName(...ruleNames) {
44
- const nodes = this.filterChildNode((childNode) => {
45
- const childNodeNonTerminalNode = childNode.isNonTerminalNode();
46
-
47
- if (childNodeNonTerminalNode) {
48
- const nonTerminalNode = childNode, ///
49
- ruleName = nonTerminalNode.getRuleName(),
50
- ruleNamesIncludesRuleName = ruleNames.includes(ruleName);
51
-
52
- if (ruleNamesIncludesRuleName) {
53
- return true;
54
- }
55
- }
56
- });
57
-
58
- return nodes;
59
- }
60
-
61
- getLastNodeByRuleName(...ruleNames) {
62
- let lastNode = null;
63
-
64
- this.backwardsSomeChildNode((childNode) => {
65
- const childNodeNonTerminalNode = childNode.isNonTerminalNode();
66
-
67
- if (childNodeNonTerminalNode) {
68
- const nonTerminalNode = childNode, ///
69
- ruleName = nonTerminalNode.getRuleName(),
70
- ruleNamesIncludesRuleName = ruleNames.includes(ruleName);
71
-
72
- if (ruleNamesIncludesRuleName) {
73
- lastNode = childNode; ///
74
-
75
- return true;
76
- }
77
- }
78
- });
79
-
80
- return lastNode;
81
- }
82
-
83
- getFirstNodeByRuleName(...ruleNames) {
84
- let firstNode = null;
85
-
86
- this.forwardsSomeChildNode((childNode) => {
87
- const childNodeNonTerminalNode = childNode.isNonTerminalNode();
88
-
89
- if (childNodeNonTerminalNode) {
90
- const nonTerminalNode = childNode, ///
91
- ruleName = nonTerminalNode.getRuleName(),
92
- ruleNamesIncludesRuleName = ruleNames.includes(ruleName);
93
-
94
- if (ruleNamesIncludesRuleName) {
95
- firstNode = childNode; ///
96
-
97
- return true;
98
- }
99
- }
100
- });
101
-
102
- return firstNode;
103
- }
104
-
105
- getSingularNodeByRuleName(...ruleNames) {
106
- let singularNode = null;
107
-
108
- const nodes = this.filterChildNode((childNode) => {
109
- const childNodeNonTerminalNode = childNode.isNonTerminalNode();
110
-
111
- if (childNodeNonTerminalNode) {
112
- const nonTerminalNode = childNode, ///
113
- ruleName = nonTerminalNode.getRuleName(),
114
- ruleNamesIncludesRuleName = ruleNames.includes(ruleName);
115
-
116
- if (ruleNamesIncludesRuleName) {
117
- return true;
118
- }
119
- }
120
- }),
121
- nodesLength = nodes.length;
122
-
123
- if (nodesLength === 1) {
124
- const firstNode = first(nodes);
125
-
126
- singularNode = firstNode; ///
127
- }
128
-
129
- return singularNode;
130
- }
131
-
132
- getDescendantNodesByRuleName(...ruleNames) {
133
- const nodes = this.filterDescendantNode((descendantNode) => {
134
- const descendantNodeNonTerminalNode = descendantNode.isNonTerminalNode();
135
-
136
- if (descendantNodeNonTerminalNode) {
137
- const nonTerminalNode = descendantNode, ///
138
- ruleName = nonTerminalNode.getRuleName(),
139
- ruleNamesIncludesRuleName = ruleNames.includes(ruleName);
140
-
141
- if (ruleNamesIncludesRuleName) {
142
- return true;
143
- }
144
- }
145
- });
146
-
147
- return nodes;
148
- }
149
-
150
- static fromRuleNameChildNodesOpacityAndPrecedence(Class, ruleName, childNodes, opacity, precedence) { return NonTerminalNodeBase.fromRuleNameChildNodesOpacityAndPrecedence(Class, ruleName, childNodes, opacity, precedence); }
151
- }
@@ -1,121 +0,0 @@
1
- "use strict";
2
-
3
- import { arrayUtilities } from "necessary";
4
-
5
- const { filter } = arrayUtilities;
6
-
7
- export async function asyncSome(array, callback) {
8
- let result = false;
9
-
10
- const length = array.length;
11
-
12
- for (let index = 0; index < length; index += 1) {
13
- const item = array[index];
14
-
15
- result = await callback(item, index, array);
16
-
17
- if (result) {
18
- break;
19
- }
20
- }
21
-
22
- return result;
23
- }
24
-
25
- export async function asyncEvery(array, callback) {
26
- let result = true;
27
-
28
- const length = array.length;
29
-
30
- for (let index = 0; index < length; index += 1) {
31
- const item = array[index];
32
-
33
- result = await callback(item, index, array);
34
-
35
- if (!result) {
36
- break;
37
- }
38
- }
39
-
40
- return result;
41
- }
42
-
43
- export async function asyncReduce(array, callback, initialValue) {
44
- let value = initialValue; ///
45
-
46
- const length = array.length;
47
-
48
- for (let index = 0; index < length; index += 1) {
49
- const item = array[index];
50
-
51
- value = await callback(value, item, index, array);
52
- }
53
-
54
- return value;
55
- }
56
-
57
- export async function asyncForEach(array, callback) {
58
- const length = array.length;
59
-
60
- for (let index = 0; index < length; index += 1) {
61
- const item = array[index];
62
-
63
- await callback(item, index, array);
64
- }
65
- }
66
-
67
- export async function asyncResolve(arrayA, arrayB, callback) {
68
- let resolved;
69
-
70
- arrayA = [ ///
71
- ...arrayA
72
- ];
73
-
74
- for (;;) {
75
- const arrayALength = arrayA.length;
76
-
77
- if (arrayALength === 0) {
78
- break;
79
- }
80
-
81
- let resolved = false;
82
-
83
- await asyncForEach(arrayA, async (elementA) => {
84
- const passed = await callback(elementA);
85
-
86
- if (passed) {
87
- const elementB = elementA; ///
88
-
89
- arrayB.push(elementB);
90
-
91
- resolved = true;
92
- }
93
- });
94
-
95
- if (!resolved) {
96
- break;
97
- }
98
-
99
- filter(arrayA, (elementA) => {
100
- const arrayBIncludesElementA = arrayB.includes(elementA);
101
-
102
- if (!arrayBIncludesElementA) {
103
- return true;
104
- }
105
- });
106
- }
107
-
108
- const arrayALength = arrayA.length;
109
-
110
- resolved = (arrayALength === 0);
111
-
112
- return resolved;
113
- }
114
-
115
- export default {
116
- asyncSome,
117
- asyncEvery,
118
- asyncReduce,
119
- asyncForEach,
120
- asyncResolve
121
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- export function chainContext(context) {
4
- return new Proxy(context, {
5
- get: (context, name, receiver) => {
6
- if (Reflect.has(context, name)) {
7
- return Reflect.get(context, name, receiver);
8
- }
9
-
10
- context = context.getContext(); ///
11
-
12
- return Reflect.get(context, name, receiver);
13
- }
14
- });
15
- }
16
-
17
- export default {
18
- chainContext
19
- };
@@ -1,54 +0,0 @@
1
- "use strict";
2
-
3
- import { CustomGrammar, CombinedCustomGrammar } from "occam-nominal";
4
-
5
- export function combinedCustomGrammarFromJSON(json) {
6
- const customGrammars = customGrammarsFromJSON(json),
7
- includeDefault = false,
8
- combinedCustomGrammar = CombinedCustomGrammar.fromCustomGrammars(customGrammars, includeDefault);
9
-
10
- return combinedCustomGrammar;
11
- }
12
-
13
- export function customGrammarFromNameAndEntries(name, entries) {
14
- const termBNF = entries.getTermBNF(),
15
- statementBNF = entries.getStatementBNF(),
16
- typeVocabulary = entries.getTypeVocabulary(),
17
- symbolVocabulary = entries.getSymbolVocabulary(),
18
- customGrammar = CustomGrammar.fromNameTermBNFStatementBNFTypeVocabularyAndSymbolVocabulary(name, termBNF, statementBNF, typeVocabulary, symbolVocabulary);
19
-
20
- return customGrammar;
21
- }
22
-
23
- export function combinedCustomGrammarFromNothing() {
24
- const customGrammars = [],
25
- combinedCustomGrammar = CombinedCustomGrammar.fromCustomGrammars(customGrammars);
26
-
27
- return combinedCustomGrammar;
28
- }
29
-
30
- export function combinedCustomGrammarFromReleaseContexts(releaseContexts) {
31
- const customGrammars = releaseContexts.map((releaseContext) => {
32
- const customGrammar = releaseContext.getCustomGrammar();
33
-
34
- return customGrammar;
35
- });
36
-
37
- customGrammars.reverse(); ///
38
-
39
- const combinedCustomGrammar = CombinedCustomGrammar.fromCustomGrammars(customGrammars);
40
-
41
- return combinedCustomGrammar;
42
- }
43
-
44
- function customGrammarsFromJSON(json) {
45
- const customGrammarsJSON = json, ///
46
- customGrammars = customGrammarsJSON.map((customGrammarsJSON) => {
47
- const json = customGrammarsJSON, ///
48
- customGrammar = CustomGrammar.fromJSON(json);
49
-
50
- return customGrammar;
51
- });
52
-
53
- return customGrammars;
54
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- export function lineIndexFromNodeAndTokens(node, tokens) {
4
- let lineIndex = 0;
5
-
6
- const firstSignificantTokenIndex = node.getFirstSignificantTokenIndex(tokens);
7
-
8
- tokens.some((token, tokenIndex) => {
9
- const tokenEndOfLineToken = token.isEndOfLineToken();
10
-
11
- if (tokenEndOfLineToken) {
12
- lineIndex += 1;
13
- }
14
-
15
- if (tokenIndex === firstSignificantTokenIndex) {
16
- return true;
17
- }
18
- });
19
-
20
- return lineIndex;
21
- }
@@ -1,90 +0,0 @@
1
- "use strict";
2
-
3
- import { EMPTY_STRING } from "../constants";
4
-
5
- export function nodeAsString(node, tokens) {
6
- let string;
7
-
8
- tokens = nodeAsTokens(node, tokens); ///
9
-
10
- string = tokensAsString(tokens);
11
-
12
- string = trimString(string); ///
13
-
14
- return string;
15
- }
16
-
17
- export function nodesAsString(nodes, tokens) {
18
- const string = nodes.reduce((string, node) => {
19
- const nodeString = nodeAsString(node, tokens);
20
-
21
- string = (string === null) ?
22
- nodeString :
23
- `${string}, ${nodeString}`;
24
-
25
- return string;
26
- }, null);
27
-
28
- return string;
29
- }
30
-
31
- export default {
32
- nodeAsString,
33
- nodesAsString,
34
- };
35
-
36
- function trimString(string) {
37
- string = string.replace(/\s+$/, EMPTY_STRING); ///
38
-
39
- return string;
40
- }
41
-
42
- function tokensAsString(tokens) {
43
- const string = tokens.reduce((string, token) => {
44
- const content = token.getContent();
45
-
46
- string = `${string}${content}`;
47
-
48
- return string;
49
- }, EMPTY_STRING);
50
-
51
- return string;
52
- }
53
-
54
- function nodeAsTokens(node, tokens) {
55
- const nodeTerminalNode = node.isTerminalNode();
56
-
57
- if (nodeTerminalNode) {
58
- const terminalNode = node; ///
59
-
60
- tokens = terminalNodeAsTokens(terminalNode, tokens);
61
- } else {
62
- const nonTerminalNode = node; ///
63
-
64
- tokens = nonTerminalNodeAsTokens(nonTerminalNode, tokens);
65
- }
66
-
67
- return tokens;
68
- }
69
-
70
- function terminalNodeAsTokens(terminalNode, tokens) {
71
- const significantToken = terminalNode.getSignificantToken(),
72
- token = significantToken; ///
73
-
74
- tokens = [ ///
75
- token
76
- ];
77
-
78
- return tokens;
79
- }
80
-
81
- function nonTerminalNodeAsTokens(nonTerminalNode, tokens) {
82
- const lastSignificantTokenIndex = nonTerminalNode.getLastSignificantTokenIndex(tokens),
83
- firstSignificantTokenIndex = nonTerminalNode.getFirstSignificantTokenIndex(tokens),
84
- start = firstSignificantTokenIndex, ///
85
- end = lastSignificantTokenIndex + 1;
86
-
87
- tokens = tokens.slice(start, end); ///
88
-
89
- return tokens;
90
- }
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- import { lexersUtilities, parsersUtilities } from "occam-nominal";
4
-
5
- import { STATEMENT_RULE_NAME } from "../constants";
6
- import { combinedCustomGrammarFromJSON } from "../utilities/customGrammar";
7
-
8
- const { nominalLexerFromCombinedCustomGrammar } = lexersUtilities,
9
- { nominalParserFromStartRuleNameAndCombinedCustomGrammar } = parsersUtilities;
10
-
11
- const startRuleName = STATEMENT_RULE_NAME,
12
- combinedCustomGrammar = combinedCustomGrammarFromJSON([
13
- {
14
- "name": "Default",
15
- "termBNF": "term ::= \"(\" argument \")\"\n\n | variable \n \n ;",
16
- "statementBNF": "statement ::= \"(\" metaArgument \")\" \n \n | equality\n\n | judgement\n\n | typeAssertion \n \n | definedAssertion \n\n | containedAssertion \n \n | satisfiesAssertion\n\n | subproofAssertion \n\n | propertyAssertion \n\n | metavariable ( frameSubstitution | termSubstitution )?\n\n ;\n\nequality ::= term \"=\" term ;\n\ntypeAssertion ::= term \":\" type ;\n\ndefinedAssertion ::= ( frame | term ) \"is\" ( \"defined\" | \"undefined\" );\n\ncontainedAssertion ::= ( frame | term ) \"is\" ( \"present\" | \"missing\" ) \"in\" statement ;\n\nsatisfiesAssertion ::= signature \"satisfies\" metavariable ; \n\nsubproofAssertion ::= \"[\" statement ( \",\" statement )* \"]\" \"...\" statement ;\n\npropertyAssertion ::= term \"is\" ( \"a\" | \"an\" ) propertyRelation ;\n\npropertyRelation ::= property \"of\" term ;\n\njudgement ::= frame \"|\"<NO_WHITESPACE>\"-\" declaration ;\n\nframe ::= \"[\" declaration ( \",\" declaration )* \"]\" ;\n \ndeclaration ::= metavariable ( \"::\" statement )? ;\n\ntermSubstitution ::= \"[\" term \"for\" term \"]\";\n\nframeSubstitution ::= \"[\" frame \"for\" frame \"]\";\n\nstatementSubstitution ::= \"[\" statement \"for\" statement \"]\";\n\nreferenceSubstitution ::= \"[\" reference \"for\" reference \"]\";",
17
- "typeVocabulary": "",
18
- "symbolVocabulary": ""
19
- },
20
- {
21
- "name": "first-order-logic",
22
- "termBNF": "",
23
- "statementBNF": "\n\n statement ::= ( \"∀\" | \"∃\" ) ( frameArgument | argument ) metaArgument \n\n | ( frameArgument | argument ) \"is\" ( \"𝘣𝘰𝘶𝘯𝘥\" | \"𝘧𝘳𝘦𝘦\" ) \"in\" metaArgument\n\n ;\n\n",
24
- "typeVocabulary": "",
25
- "symbolVocabulary": "𝘣𝘰𝘶𝘯𝘥\n𝘧𝘳𝘦𝘦\n∀\n∃\n"
26
- }
27
- ]);
28
-
29
- export const nominalLexer = nominalLexerFromCombinedCustomGrammar(combinedCustomGrammar);
30
-
31
- export const nominalParser = nominalParserFromStartRuleNameAndCombinedCustomGrammar(startRuleName, combinedCustomGrammar);
@@ -1,30 +0,0 @@
1
- "use strict";
2
-
3
- import { Query } from "occam-query";
4
-
5
- export function nodeQuery(expressionString) {
6
- const query = Query.fromExpressionString(expressionString);
7
-
8
- return function(node) {
9
- const nodes = query.execute(node);
10
-
11
- node = nodes.shift() || null; ///
12
-
13
- return node;
14
- };
15
- }
16
-
17
- export function nodesQuery(expressionString) {
18
- const query = Query.fromExpressionString(expressionString);
19
-
20
- return function(node) {
21
- const nodes = query.execute(node);
22
-
23
- return nodes;
24
- };
25
- }
26
-
27
- export default {
28
- nodeQuery,
29
- nodesQuery,
30
- }