occam-parsers 23.0.84 → 23.0.85

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 (78) hide show
  1. package/example.js +596 -568
  2. package/lib/bnf/parser.js +59 -61
  3. package/lib/node/nonTerminal.js +31 -1
  4. package/lib/rule/{callAheadModifier.js → bnf/callAheadModifier.js} +14 -14
  5. package/lib/rule/{choiceOfParts.js → bnf/choiceOfParts.js} +14 -14
  6. package/lib/rule/{definition.js → bnf/definition.js} +14 -14
  7. package/lib/rule/{definitions.js → bnf/definitions.js} +14 -14
  8. package/lib/rule/{document.js → bnf/document.js} +14 -14
  9. package/lib/rule/{endOfLine.js → bnf/endOfLine.js} +14 -14
  10. package/lib/rule/{epsilon.js → bnf/epsilon.js} +14 -14
  11. package/lib/rule/{error.js → bnf/error.js} +14 -14
  12. package/lib/rule/{name.js → bnf/name.js} +14 -14
  13. package/lib/rule/{noWhitespacePart.js → bnf/noWhitespacePart.js} +14 -14
  14. package/lib/rule/{nonTerminalPart.js → bnf/nonTerminalPart.js} +15 -15
  15. package/lib/rule/{oneOrMoreQuantifier.js → bnf/oneOrMoreQuantifier.js} +14 -14
  16. package/lib/rule/{opacityModifier.js → bnf/opacityModifier.js} +14 -14
  17. package/lib/rule/{optionalQuantifier.js → bnf/optionalQuantifier.js} +14 -14
  18. package/lib/rule/{part.js → bnf/part.js} +15 -15
  19. package/lib/rule/{partChoice.js → bnf/partChoice.js} +14 -14
  20. package/lib/rule/{precedence.js → bnf/precedence.js} +14 -14
  21. package/lib/rule/{quantifier.js → bnf/quantifier.js} +14 -14
  22. package/lib/rule/{regularExpression.js → bnf/regularExpression.js} +14 -14
  23. package/lib/rule/{rule.js → bnf/rule.js} +14 -14
  24. package/lib/rule/{ruleName.js → bnf/ruleName.js} +14 -14
  25. package/lib/rule/{sequenceOfParts.js → bnf/sequenceOfParts.js} +14 -14
  26. package/lib/rule/{significantTokenType.js → bnf/significantTokenType.js} +14 -14
  27. package/lib/rule/{startOfContentPart.js → bnf/startOfContentPart.js} +14 -14
  28. package/lib/rule/bnf/terminalPart.js +120 -0
  29. package/lib/rule/{terminalSymbol.js → bnf/terminalSymbol.js} +14 -14
  30. package/lib/rule/{wildcard.js → bnf/wildcard.js} +14 -14
  31. package/lib/rule/{zeroOrMoreQuantifier.js → bnf/zeroOrMoreQuantifier.js} +14 -14
  32. package/package.json +1 -1
  33. package/src/bnf/parser.js +87 -89
  34. package/src/node/nonTerminal.js +10 -0
  35. package/src/rule/bnf/callAheadModifier.js +22 -0
  36. package/src/rule/bnf/choiceOfParts.js +22 -0
  37. package/src/rule/bnf/definition.js +22 -0
  38. package/src/rule/bnf/definitions.js +22 -0
  39. package/src/rule/bnf/document.js +22 -0
  40. package/src/rule/{endOfLine.js → bnf/endOfLine.js} +6 -6
  41. package/src/rule/{epsilon.js → bnf/epsilon.js} +6 -6
  42. package/src/rule/bnf/error.js +26 -0
  43. package/src/rule/bnf/name.js +22 -0
  44. package/src/rule/bnf/noWhitespacePart.js +22 -0
  45. package/src/rule/{nonTerminalPart.js → bnf/nonTerminalPart.js} +7 -7
  46. package/src/rule/{oneOrMoreQuantifier.js → bnf/oneOrMoreQuantifier.js} +6 -6
  47. package/src/rule/bnf/opacityModifier.js +22 -0
  48. package/src/rule/{optionalQuantifier.js → bnf/optionalQuantifier.js} +6 -6
  49. package/src/rule/{part.js → bnf/part.js} +7 -7
  50. package/src/rule/bnf/partChoice.js +22 -0
  51. package/src/rule/bnf/precedence.js +22 -0
  52. package/src/rule/{quantifier.js → bnf/quantifier.js} +6 -6
  53. package/src/rule/{regularExpression.js → bnf/regularExpression.js} +6 -6
  54. package/src/rule/bnf/rule.js +22 -0
  55. package/src/rule/bnf/ruleName.js +22 -0
  56. package/src/rule/bnf/sequenceOfParts.js +22 -0
  57. package/src/rule/{significantTokenType.js → bnf/significantTokenType.js} +6 -6
  58. package/src/rule/bnf/startOfContentPart.js +22 -0
  59. package/src/rule/{terminalPart.js → bnf/terminalPart.js} +7 -7
  60. package/src/rule/{terminalSymbol.js → bnf/terminalSymbol.js} +7 -7
  61. package/src/rule/{wildcard.js → bnf/wildcard.js} +6 -6
  62. package/src/rule/{zeroOrMoreQuantifier.js → bnf/zeroOrMoreQuantifier.js} +6 -6
  63. package/lib/rule/terminalPart.js +0 -120
  64. package/src/rule/callAheadModifier.js +0 -22
  65. package/src/rule/choiceOfParts.js +0 -22
  66. package/src/rule/definition.js +0 -22
  67. package/src/rule/definitions.js +0 -22
  68. package/src/rule/document.js +0 -22
  69. package/src/rule/error.js +0 -26
  70. package/src/rule/name.js +0 -22
  71. package/src/rule/noWhitespacePart.js +0 -22
  72. package/src/rule/opacityModifier.js +0 -22
  73. package/src/rule/partChoice.js +0 -22
  74. package/src/rule/precedence.js +0 -22
  75. package/src/rule/rule.js +0 -22
  76. package/src/rule/ruleName.js +0 -22
  77. package/src/rule/sequenceOfParts.js +0 -22
  78. package/src/rule/startOfContentPart.js +0 -22
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- import Rule from "../rule";
4
- import OpacityModifierBNFNode from "../node/bnf/opacityModifier";
5
- import OpacityModifierRuleDefinition from "../definition/opacityModifierRule";
6
-
7
- import { opacityModifierRuleName } from "../ruleNames";
8
-
9
- export default class OpacityModifierRule extends Rule {
10
- static fromNothing() {
11
- const name = opacityModifierRuleName, ///
12
- opacityModifierRuleDefinition = OpacityModifierRuleDefinition.fromNothing(),
13
- opacity = null,
14
- definitions = [
15
- opacityModifierRuleDefinition
16
- ],
17
- NonTerminalNode = OpacityModifierBNFNode,
18
- opacityModifierRule = new OpacityModifierRule(name, opacity, definitions, NonTerminalNode);
19
-
20
- return opacityModifierRule;
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- import Rule from "../rule";
4
- import PartChoiceBNFNode from "../node/bnf/partChoice";
5
- import PartChoiceDefinition from "../definition/partChoice";
6
-
7
- import { partChoiceRuleName } from "../ruleNames";
8
-
9
- export default class PartChoiceRule extends Rule {
10
- static fromNothing() {
11
- const name = partChoiceRuleName, ///
12
- partChoiceDefinition = PartChoiceDefinition.fromNothing(),
13
- opacity = null,
14
- definitions = [
15
- partChoiceDefinition
16
- ],
17
- NonTerminalNode = PartChoiceBNFNode, ///
18
- definitionRule = new PartChoiceRule(name, opacity, definitions, NonTerminalNode);
19
-
20
- return definitionRule;
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- import Rule from "../rule";
4
- import PrecedenceBNFNode from "../node/bnf/precedence";
5
- import PrecedenceDefinition from "../definition/precedence";
6
-
7
- import { precedenceRuleName } from "../ruleNames";
8
-
9
- export default class PrecedenceRule extends Rule {
10
- static fromNothing() {
11
- const name = precedenceRuleName, ///
12
- precedenceDefinition = PrecedenceDefinition.fromNothing(),
13
- opacity = null,
14
- definitions = [
15
- precedenceDefinition
16
- ],
17
- NonTerminalNode = PrecedenceBNFNode, ///
18
- precedenceRule = new PrecedenceRule(name, opacity, definitions, NonTerminalNode);
19
-
20
- return precedenceRule;
21
- }
22
- }
package/src/rule/rule.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- import Rule from "../rule";
4
- import RuleBNFNode from "../node/bnf/rule";
5
- import RuleDefinition from "../definition/rule";
6
-
7
- import { ruleRuleName } from "../ruleNames";
8
-
9
- export default class RuleRule extends Rule {
10
- static fromNothing() {
11
- const ruleDefinition = RuleDefinition.fromNothing(),
12
- name = ruleRuleName, ///
13
- opacity = null,
14
- definitions = [
15
- ruleDefinition
16
- ],
17
- NonTerminalNode = RuleBNFNode,
18
- ruleRule = new RuleRule(name, opacity, definitions, NonTerminalNode);
19
-
20
- return ruleRule;
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- import Rule from "../rule";
4
- import NameDefinition from "../definition/name";
5
- import RuleNameBNFNode from "../node/bnf/ruleName";
6
-
7
- import { ruleNameRuleName } from "../ruleNames";
8
-
9
- export default class RuleNameRule extends Rule {
10
- static fromNothing() {
11
- const nameDefinition = NameDefinition.fromNothing(),
12
- name = ruleNameRuleName, ///
13
- opacity = null,
14
- definitions = [
15
- nameDefinition ///
16
- ],
17
- NonTerminalNode = RuleNameBNFNode, ///
18
- ruleNameRule = new RuleNameRule(name, opacity, definitions, NonTerminalNode);
19
-
20
- return ruleNameRule;
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- import Rule from "../rule";
4
- import SequenceOfPartsBNFNode from "../node/bnf/sequenceOfParts";
5
- import SequenceOfPartsDefinition from "../definition/sequenceOfParts";
6
-
7
- import { sequenceOfPartsRuleName } from "../ruleNames";
8
-
9
- export default class SequenceOfPartsRule extends Rule {
10
- static fromNothing() {
11
- const name = sequenceOfPartsRuleName, ///
12
- sequenceOfPartsDefinition = SequenceOfPartsDefinition.fromNothing(),
13
- opacity = null,
14
- definitions = [
15
- sequenceOfPartsDefinition
16
- ],
17
- NonTerminalNode = SequenceOfPartsBNFNode, ///
18
- sequenceOfPartsRule = new SequenceOfPartsRule(name, opacity, definitions, NonTerminalNode);
19
-
20
- return sequenceOfPartsRule;
21
- }
22
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- import Rule from "../rule";
4
- import StartOfContentPartBNFNode from "../node/bnf/startOfContentPart";
5
- import StartOfContentPartDefinition from "../definition/startOfContentPart";
6
-
7
- import { startOfContentPartRuleName } from "../ruleNames";
8
-
9
- export default class StartOfContentPartRule extends Rule {
10
- static fromNothing() {
11
- const startOfContentPartDefinition = StartOfContentPartDefinition.fromNothing(),
12
- name = startOfContentPartRuleName, ///
13
- opacity = null,
14
- definitions = [
15
- startOfContentPartDefinition
16
- ],
17
- NonTerminalNode = StartOfContentPartBNFNode, ///
18
- startOfContentPartRule = new StartOfContentPartRule(name, opacity, definitions, NonTerminalNode);
19
-
20
- return startOfContentPartRule;
21
- }
22
- }