occam-parsers 23.0.83 → 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.
- package/example.js +596 -568
- package/lib/bnf/parser.js +59 -61
- package/lib/node/nonTerminal.js +31 -1
- package/lib/rule/{callAheadModifier.js → bnf/callAheadModifier.js} +14 -14
- package/lib/rule/{choiceOfParts.js → bnf/choiceOfParts.js} +14 -14
- package/lib/rule/{definition.js → bnf/definition.js} +14 -14
- package/lib/rule/{definitions.js → bnf/definitions.js} +14 -14
- package/lib/rule/{document.js → bnf/document.js} +14 -14
- package/lib/rule/{endOfLine.js → bnf/endOfLine.js} +14 -14
- package/lib/rule/{epsilon.js → bnf/epsilon.js} +14 -14
- package/lib/rule/{error.js → bnf/error.js} +14 -14
- package/lib/rule/{name.js → bnf/name.js} +14 -14
- package/lib/rule/{noWhitespacePart.js → bnf/noWhitespacePart.js} +14 -14
- package/lib/rule/{nonTerminalPart.js → bnf/nonTerminalPart.js} +15 -15
- package/lib/rule/{oneOrMoreQuantifier.js → bnf/oneOrMoreQuantifier.js} +14 -14
- package/lib/rule/{opacityModifier.js → bnf/opacityModifier.js} +14 -14
- package/lib/rule/{optionalQuantifier.js → bnf/optionalQuantifier.js} +14 -14
- package/lib/rule/{part.js → bnf/part.js} +15 -15
- package/lib/rule/{partChoice.js → bnf/partChoice.js} +14 -14
- package/lib/rule/{precedence.js → bnf/precedence.js} +14 -14
- package/lib/rule/{quantifier.js → bnf/quantifier.js} +14 -14
- package/lib/rule/{regularExpression.js → bnf/regularExpression.js} +14 -14
- package/lib/rule/{rule.js → bnf/rule.js} +14 -14
- package/lib/rule/{ruleName.js → bnf/ruleName.js} +14 -14
- package/lib/rule/{sequenceOfParts.js → bnf/sequenceOfParts.js} +14 -14
- package/lib/rule/{significantTokenType.js → bnf/significantTokenType.js} +14 -14
- package/lib/rule/{startOfContentPart.js → bnf/startOfContentPart.js} +14 -14
- package/lib/rule/bnf/terminalPart.js +120 -0
- package/lib/rule/{terminalSymbol.js → bnf/terminalSymbol.js} +14 -14
- package/lib/rule/{wildcard.js → bnf/wildcard.js} +14 -14
- package/lib/rule/{zeroOrMoreQuantifier.js → bnf/zeroOrMoreQuantifier.js} +14 -14
- package/package.json +3 -3
- package/src/bnf/parser.js +87 -89
- package/src/node/nonTerminal.js +10 -0
- package/src/rule/bnf/callAheadModifier.js +22 -0
- package/src/rule/bnf/choiceOfParts.js +22 -0
- package/src/rule/bnf/definition.js +22 -0
- package/src/rule/bnf/definitions.js +22 -0
- package/src/rule/bnf/document.js +22 -0
- package/src/rule/{endOfLine.js → bnf/endOfLine.js} +6 -6
- package/src/rule/{epsilon.js → bnf/epsilon.js} +6 -6
- package/src/rule/bnf/error.js +26 -0
- package/src/rule/bnf/name.js +22 -0
- package/src/rule/bnf/noWhitespacePart.js +22 -0
- package/src/rule/{nonTerminalPart.js → bnf/nonTerminalPart.js} +7 -7
- package/src/rule/{oneOrMoreQuantifier.js → bnf/oneOrMoreQuantifier.js} +6 -6
- package/src/rule/bnf/opacityModifier.js +22 -0
- package/src/rule/{optionalQuantifier.js → bnf/optionalQuantifier.js} +6 -6
- package/src/rule/{part.js → bnf/part.js} +7 -7
- package/src/rule/bnf/partChoice.js +22 -0
- package/src/rule/bnf/precedence.js +22 -0
- package/src/rule/{quantifier.js → bnf/quantifier.js} +6 -6
- package/src/rule/{regularExpression.js → bnf/regularExpression.js} +6 -6
- package/src/rule/bnf/rule.js +22 -0
- package/src/rule/bnf/ruleName.js +22 -0
- package/src/rule/bnf/sequenceOfParts.js +22 -0
- package/src/rule/{significantTokenType.js → bnf/significantTokenType.js} +6 -6
- package/src/rule/bnf/startOfContentPart.js +22 -0
- package/src/rule/{terminalPart.js → bnf/terminalPart.js} +7 -7
- package/src/rule/{terminalSymbol.js → bnf/terminalSymbol.js} +7 -7
- package/src/rule/{wildcard.js → bnf/wildcard.js} +6 -6
- package/src/rule/{zeroOrMoreQuantifier.js → bnf/zeroOrMoreQuantifier.js} +6 -6
- package/lib/rule/terminalPart.js +0 -120
- package/src/rule/callAheadModifier.js +0 -22
- package/src/rule/choiceOfParts.js +0 -22
- package/src/rule/definition.js +0 -22
- package/src/rule/definitions.js +0 -22
- package/src/rule/document.js +0 -22
- package/src/rule/error.js +0 -26
- package/src/rule/name.js +0 -22
- package/src/rule/noWhitespacePart.js +0 -22
- package/src/rule/opacityModifier.js +0 -22
- package/src/rule/partChoice.js +0 -22
- package/src/rule/precedence.js +0 -22
- package/src/rule/rule.js +0 -22
- package/src/rule/ruleName.js +0 -22
- package/src/rule/sequenceOfParts.js +0 -22
- package/src/rule/startOfContentPart.js +0 -22
|
@@ -0,0 +1,22 @@
|
|
|
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 PrecedenceBNFRule 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 PrecedenceBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
+
|
|
20
|
+
return precedenceRule;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import Rule from "
|
|
4
|
-
import PartBNFNode from "
|
|
5
|
-
import RuleNameDefinition from "
|
|
3
|
+
import Rule from "../../rule";
|
|
4
|
+
import PartBNFNode from "../../node/bnf/part";
|
|
5
|
+
import RuleNameDefinition from "../../definition/ruleName";
|
|
6
6
|
|
|
7
|
-
import { quantifierRuleName, optionalQuantifierRuleName, oneOrMoreQuantifierRuleName, zeroOrMoreQuantifierRuleName } from "
|
|
7
|
+
import { quantifierRuleName, optionalQuantifierRuleName, oneOrMoreQuantifierRuleName, zeroOrMoreQuantifierRuleName } from "../../ruleNames";
|
|
8
8
|
|
|
9
|
-
export default class
|
|
9
|
+
export default class QuantifierBNFRule extends Rule {
|
|
10
10
|
static fromNothing() {
|
|
11
11
|
const name = quantifierRuleName, ///
|
|
12
12
|
optionalQuantifierRuleNameDefinition = RuleNameDefinition.fromRuleName(optionalQuantifierRuleName),
|
|
@@ -19,7 +19,7 @@ export default class QuantifierRule extends Rule {
|
|
|
19
19
|
zeroOrMoreQuantifierRuleNameDefinition
|
|
20
20
|
],
|
|
21
21
|
NonTerminalNode = PartBNFNode, ///
|
|
22
|
-
quantifierRule = new
|
|
22
|
+
quantifierRule = new QuantifierBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
23
23
|
|
|
24
24
|
return quantifierRule;
|
|
25
25
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { types } from "occam-lexers";
|
|
4
4
|
|
|
5
|
-
import Rule from "
|
|
6
|
-
import RegularExpressionBNFNode from "
|
|
7
|
-
import SignificantTokenTypeDefinition from "
|
|
5
|
+
import Rule from "../../rule";
|
|
6
|
+
import RegularExpressionBNFNode from "../../node/bnf/regularExpression";
|
|
7
|
+
import SignificantTokenTypeDefinition from "../../definition/significantTokenType";
|
|
8
8
|
|
|
9
|
-
import { regularExpressionRuleName } from "
|
|
9
|
+
import { regularExpressionRuleName } from "../../ruleNames";
|
|
10
10
|
|
|
11
11
|
const { regularExpressionType } = types;
|
|
12
12
|
|
|
13
|
-
export default class
|
|
13
|
+
export default class RegularExpressionBNFRule extends Rule {
|
|
14
14
|
static fromNothing() {
|
|
15
15
|
const significantTokenType = regularExpressionType, ///
|
|
16
16
|
regularExpressionSignificantTokenTypeDefinition = SignificantTokenTypeDefinition.fromSignificantTokenType(significantTokenType),
|
|
@@ -20,7 +20,7 @@ export default class RegularExpressionRule extends Rule {
|
|
|
20
20
|
regularExpressionSignificantTokenTypeDefinition
|
|
21
21
|
],
|
|
22
22
|
NonTerminalNode = RegularExpressionBNFNode, ///
|
|
23
|
-
regularExpressionRule = new
|
|
23
|
+
regularExpressionRule = new RegularExpressionBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
24
24
|
|
|
25
25
|
return regularExpressionRule;
|
|
26
26
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 RuleBNFRule 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 RuleBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
+
|
|
20
|
+
return ruleRule;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 RuleNameBNFRule 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 RuleNameBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
+
|
|
20
|
+
return ruleNameRule;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 SequenceOfPartsBNFRule 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 SequenceOfPartsBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
+
|
|
20
|
+
return sequenceOfPartsRule;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { types } from "occam-lexers";
|
|
4
4
|
|
|
5
|
-
import Rule from "
|
|
6
|
-
import SignificantTokenTypeBNFNode from "
|
|
7
|
-
import SignificantTokenTypeDefinition from "
|
|
5
|
+
import Rule from "../../rule";
|
|
6
|
+
import SignificantTokenTypeBNFNode from "../../node/bnf/significantTokenType";
|
|
7
|
+
import SignificantTokenTypeDefinition from "../../definition/significantTokenType";
|
|
8
8
|
|
|
9
|
-
import { significantTokenTypeRuleName } from "
|
|
9
|
+
import { significantTokenTypeRuleName } from "../../ruleNames";
|
|
10
10
|
|
|
11
11
|
const { typeType } = types;
|
|
12
12
|
|
|
13
|
-
export default class
|
|
13
|
+
export default class SignificantTokenTypeBNFRule extends Rule {
|
|
14
14
|
static fromNothing() {
|
|
15
15
|
const significantTokenType = typeType, ///
|
|
16
16
|
typeSignificantTokenTypeDefinition = SignificantTokenTypeDefinition.fromSignificantTokenType(significantTokenType),
|
|
@@ -20,7 +20,7 @@ export default class SignificantTokenTypeRule extends Rule {
|
|
|
20
20
|
typeSignificantTokenTypeDefinition
|
|
21
21
|
],
|
|
22
22
|
NonTerminalNode = SignificantTokenTypeBNFNode, ///
|
|
23
|
-
significantTokenTypeRule = new
|
|
23
|
+
significantTokenTypeRule = new SignificantTokenTypeBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
24
24
|
|
|
25
25
|
return significantTokenTypeRule;
|
|
26
26
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 StartOfContentPartBNFRule 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 StartOfContentPartBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
+
|
|
20
|
+
return startOfContentPartRule;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import Rule from "
|
|
4
|
-
import RuleNameDefinition from "
|
|
5
|
-
import TerminalPartBNFNode from "
|
|
3
|
+
import Rule from "../../rule";
|
|
4
|
+
import RuleNameDefinition from "../../definition/ruleName";
|
|
5
|
+
import TerminalPartBNFNode from "../../node/bnf/part/terminal";
|
|
6
6
|
|
|
7
7
|
import { epsilonRuleName,
|
|
8
8
|
wildcardRuleName,
|
|
@@ -12,9 +12,9 @@ import { epsilonRuleName,
|
|
|
12
12
|
noWhitespacePartRuleName,
|
|
13
13
|
regularExpressionRuleName,
|
|
14
14
|
startOfContentPartRuleName,
|
|
15
|
-
significantTokenTypeRuleName } from "
|
|
15
|
+
significantTokenTypeRuleName } from "../../ruleNames";
|
|
16
16
|
|
|
17
|
-
export default class
|
|
17
|
+
export default class TerminalPartBNFRule extends Rule {
|
|
18
18
|
static fromNothing() {
|
|
19
19
|
const name = terminalPartRuleName,
|
|
20
20
|
epsilonRuleNameDefinition = RuleNameDefinition.fromRuleName(epsilonRuleName),
|
|
@@ -36,8 +36,8 @@ export default class TerminalPartRule extends Rule {
|
|
|
36
36
|
noWhitespacePartRuleNameDefinition,
|
|
37
37
|
startOfContentPartRuleNameDefinition
|
|
38
38
|
],
|
|
39
|
-
NonTerminalNode = TerminalPartBNFNode,
|
|
40
|
-
terminalPartRule = new
|
|
39
|
+
NonTerminalNode = TerminalPartBNFNode, ///
|
|
40
|
+
terminalPartRule = new TerminalPartBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
41
41
|
|
|
42
42
|
return terminalPartRule;
|
|
43
43
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { types } from "occam-lexers";
|
|
4
4
|
|
|
5
|
-
import Rule from "
|
|
6
|
-
import TerminalSymbolBNFNode from "
|
|
7
|
-
import SignificantTokenTypeDefinition from "
|
|
5
|
+
import Rule from "../../rule";
|
|
6
|
+
import TerminalSymbolBNFNode from "../../node/bnf/terminalSymbol";
|
|
7
|
+
import SignificantTokenTypeDefinition from "../../definition/significantTokenType";
|
|
8
8
|
|
|
9
|
-
import { terminalSymbolRuleName } from "
|
|
9
|
+
import { terminalSymbolRuleName } from "../../ruleNames";
|
|
10
10
|
|
|
11
11
|
const { stringLiteralType } = types;
|
|
12
12
|
|
|
13
|
-
export default class
|
|
13
|
+
export default class TerminalSymbolBNFRule extends Rule {
|
|
14
14
|
static fromNothing() {
|
|
15
15
|
const significantTokenType = stringLiteralType, ///
|
|
16
16
|
stringLiteralSignificantTokenTypeDefinition = SignificantTokenTypeDefinition.fromSignificantTokenType(significantTokenType),
|
|
@@ -19,8 +19,8 @@ export default class TerminalSymbolRule extends Rule {
|
|
|
19
19
|
definitions = [
|
|
20
20
|
stringLiteralSignificantTokenTypeDefinition
|
|
21
21
|
],
|
|
22
|
-
NonTerminalNode = TerminalSymbolBNFNode,
|
|
23
|
-
terminalSymbolRule = new
|
|
22
|
+
NonTerminalNode = TerminalSymbolBNFNode, ///
|
|
23
|
+
terminalSymbolRule = new TerminalSymbolBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
24
24
|
|
|
25
25
|
return terminalSymbolRule;
|
|
26
26
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { specialSymbols } from "occam-lexers";
|
|
4
4
|
|
|
5
|
-
import Rule from "
|
|
6
|
-
import WildcardBNFNode from "
|
|
7
|
-
import TerminalSymbolDefinition from "
|
|
5
|
+
import Rule from "../../rule";
|
|
6
|
+
import WildcardBNFNode from "../../node/bnf/wildcard";
|
|
7
|
+
import TerminalSymbolDefinition from "../../definition/terminalSymbol";
|
|
8
8
|
|
|
9
|
-
import { wildcardRuleName } from "
|
|
9
|
+
import { wildcardRuleName } from "../../ruleNames";
|
|
10
10
|
|
|
11
11
|
const { wildcard } = specialSymbols;
|
|
12
12
|
|
|
13
|
-
export default class
|
|
13
|
+
export default class WildcardBNFRule extends Rule {
|
|
14
14
|
static fromNothing() {
|
|
15
15
|
const content = wildcard, ///
|
|
16
16
|
wildcardTerminalSymbolDefinition = TerminalSymbolDefinition.fromContent(content),
|
|
@@ -20,7 +20,7 @@ export default class WildcardRule extends Rule {
|
|
|
20
20
|
wildcardTerminalSymbolDefinition
|
|
21
21
|
],
|
|
22
22
|
NonTerminalNode = WildcardBNFNode, ///
|
|
23
|
-
wildcardRule = new
|
|
23
|
+
wildcardRule = new WildcardBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
24
24
|
|
|
25
25
|
return wildcardRule;
|
|
26
26
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { specialSymbols } from "occam-lexers";
|
|
4
4
|
|
|
5
|
-
import Rule from "
|
|
6
|
-
import QuantifierBNFNode from "
|
|
7
|
-
import QuantifierRuleDefinition from "
|
|
5
|
+
import Rule from "../../rule";
|
|
6
|
+
import QuantifierBNFNode from "../../node/bnf/quantifier";
|
|
7
|
+
import QuantifierRuleDefinition from "../../definition/quantifierRule";
|
|
8
8
|
|
|
9
|
-
import { zeroOrMoreQuantifierRuleName } from "
|
|
9
|
+
import { zeroOrMoreQuantifierRuleName } from "../../ruleNames";
|
|
10
10
|
|
|
11
11
|
const { asterisk } = specialSymbols;
|
|
12
12
|
|
|
13
|
-
export default class
|
|
13
|
+
export default class ZeroOrMoreQuantifierBNFRule extends Rule {
|
|
14
14
|
static fromNothing() {
|
|
15
15
|
const name = zeroOrMoreQuantifierRuleName, ///
|
|
16
16
|
specialSymbol = asterisk, ///
|
|
@@ -20,7 +20,7 @@ export default class ZeroOrMoreQuantifierRule extends Rule {
|
|
|
20
20
|
zeroOrMoreQuantifierRuleDefinition
|
|
21
21
|
],
|
|
22
22
|
NonTerminalNode = QuantifierBNFNode, ///
|
|
23
|
-
zeroOrMoreQuantifierRule = new
|
|
23
|
+
zeroOrMoreQuantifierRule = new ZeroOrMoreQuantifierBNFRule(name, opacity, definitions, NonTerminalNode);
|
|
24
24
|
|
|
25
25
|
return zeroOrMoreQuantifierRule;
|
|
26
26
|
}
|
package/lib/rule/terminalPart.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return TerminalPartRule;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _rule = /*#__PURE__*/ _interop_require_default(require("../rule"));
|
|
12
|
-
var _ruleName = /*#__PURE__*/ _interop_require_default(require("../definition/ruleName"));
|
|
13
|
-
var _terminal = /*#__PURE__*/ _interop_require_default(require("../node/bnf/part/terminal"));
|
|
14
|
-
var _ruleNames = require("../ruleNames");
|
|
15
|
-
function _assert_this_initialized(self) {
|
|
16
|
-
if (self === void 0) {
|
|
17
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
18
|
-
}
|
|
19
|
-
return self;
|
|
20
|
-
}
|
|
21
|
-
function _call_super(_this, derived, args) {
|
|
22
|
-
derived = _get_prototype_of(derived);
|
|
23
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
24
|
-
}
|
|
25
|
-
function _class_call_check(instance, Constructor) {
|
|
26
|
-
if (!(instance instanceof Constructor)) {
|
|
27
|
-
throw new TypeError("Cannot call a class as a function");
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function _defineProperties(target, props) {
|
|
31
|
-
for(var i = 0; i < props.length; i++){
|
|
32
|
-
var descriptor = props[i];
|
|
33
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
34
|
-
descriptor.configurable = true;
|
|
35
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
36
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
40
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
41
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
42
|
-
return Constructor;
|
|
43
|
-
}
|
|
44
|
-
function _get_prototype_of(o) {
|
|
45
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
46
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
47
|
-
};
|
|
48
|
-
return _get_prototype_of(o);
|
|
49
|
-
}
|
|
50
|
-
function _inherits(subClass, superClass) {
|
|
51
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
52
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
53
|
-
}
|
|
54
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
55
|
-
constructor: {
|
|
56
|
-
value: subClass,
|
|
57
|
-
writable: true,
|
|
58
|
-
configurable: true
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
62
|
-
}
|
|
63
|
-
function _interop_require_default(obj) {
|
|
64
|
-
return obj && obj.__esModule ? obj : {
|
|
65
|
-
default: obj
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
function _possible_constructor_return(self, call) {
|
|
69
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
70
|
-
return call;
|
|
71
|
-
}
|
|
72
|
-
return _assert_this_initialized(self);
|
|
73
|
-
}
|
|
74
|
-
function _set_prototype_of(o, p) {
|
|
75
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
76
|
-
o.__proto__ = p;
|
|
77
|
-
return o;
|
|
78
|
-
};
|
|
79
|
-
return _set_prototype_of(o, p);
|
|
80
|
-
}
|
|
81
|
-
function _type_of(obj) {
|
|
82
|
-
"@swc/helpers - typeof";
|
|
83
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
84
|
-
}
|
|
85
|
-
function _is_native_reflect_construct() {
|
|
86
|
-
try {
|
|
87
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
88
|
-
} catch (_) {}
|
|
89
|
-
return (_is_native_reflect_construct = function() {
|
|
90
|
-
return !!result;
|
|
91
|
-
})();
|
|
92
|
-
}
|
|
93
|
-
var TerminalPartRule = /*#__PURE__*/ function(Rule) {
|
|
94
|
-
_inherits(TerminalPartRule, Rule);
|
|
95
|
-
function TerminalPartRule() {
|
|
96
|
-
_class_call_check(this, TerminalPartRule);
|
|
97
|
-
return _call_super(this, TerminalPartRule, arguments);
|
|
98
|
-
}
|
|
99
|
-
_create_class(TerminalPartRule, null, [
|
|
100
|
-
{
|
|
101
|
-
key: "fromNothing",
|
|
102
|
-
value: function fromNothing() {
|
|
103
|
-
var name = _ruleNames.terminalPartRuleName, epsilonRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.epsilonRuleName), wildcardRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.wildcardRuleName), endOfLineRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.endOfLineRuleName), terminalSymbolRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.terminalSymbolRuleName), noWhitespacePartRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.noWhitespacePartRuleName), regularExpressionRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.regularExpressionRuleName), startOfContentPartRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.startOfContentPartRuleName), significantTokenTypeRuleNameDefinition = _ruleName.default.fromRuleName(_ruleNames.significantTokenTypeRuleName), opacity = null, definitions = [
|
|
104
|
-
significantTokenTypeRuleNameDefinition,
|
|
105
|
-
regularExpressionRuleNameDefinition,
|
|
106
|
-
terminalSymbolRuleNameDefinition,
|
|
107
|
-
endOfLineRuleNameDefinition,
|
|
108
|
-
wildcardRuleNameDefinition,
|
|
109
|
-
epsilonRuleNameDefinition,
|
|
110
|
-
noWhitespacePartRuleNameDefinition,
|
|
111
|
-
startOfContentPartRuleNameDefinition
|
|
112
|
-
], NonTerminalNode = _terminal.default, terminalPartRule = new TerminalPartRule(name, opacity, definitions, NonTerminalNode);
|
|
113
|
-
return terminalPartRule;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
]);
|
|
117
|
-
return TerminalPartRule;
|
|
118
|
-
}(_rule.default);
|
|
119
|
-
|
|
120
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ydWxlL3Rlcm1pbmFsUGFydC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IFJ1bGUgZnJvbSBcIi4uL3J1bGVcIjtcbmltcG9ydCBSdWxlTmFtZURlZmluaXRpb24gZnJvbSBcIi4uL2RlZmluaXRpb24vcnVsZU5hbWVcIjtcbmltcG9ydCBUZXJtaW5hbFBhcnRCTkZOb2RlIGZyb20gXCIuLi9ub2RlL2JuZi9wYXJ0L3Rlcm1pbmFsXCI7XG5cbmltcG9ydCB7IGVwc2lsb25SdWxlTmFtZSxcbiAgICAgICAgIHdpbGRjYXJkUnVsZU5hbWUsXG4gICAgICAgICBlbmRPZkxpbmVSdWxlTmFtZSxcbiAgICAgICAgIHRlcm1pbmFsUGFydFJ1bGVOYW1lLFxuICAgICAgICAgdGVybWluYWxTeW1ib2xSdWxlTmFtZSxcbiAgICAgICAgIG5vV2hpdGVzcGFjZVBhcnRSdWxlTmFtZSxcbiAgICAgICAgIHJlZ3VsYXJFeHByZXNzaW9uUnVsZU5hbWUsXG4gICAgICAgICBzdGFydE9mQ29udGVudFBhcnRSdWxlTmFtZSxcbiAgICAgICAgIHNp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BNFNode from "../node/bnf/callAheadModifier";
|
|
5
|
-
import CallAheadModifierRuleDefinition from "../definition/callAheadModifierRule";
|
|
6
|
-
|
|
7
|
-
import { callAheadModifierRuleName } from "../ruleNames";
|
|
8
|
-
|
|
9
|
-
export default class CallAheadModifierRule extends Rule {
|
|
10
|
-
static fromNothing() {
|
|
11
|
-
const name = callAheadModifierRuleName, ///
|
|
12
|
-
callAheadModifierRuleDefinition = CallAheadModifierRuleDefinition.fromNothing(),
|
|
13
|
-
opacity = null,
|
|
14
|
-
definitions = [
|
|
15
|
-
callAheadModifierRuleDefinition
|
|
16
|
-
],
|
|
17
|
-
NonTerminalNode = CallAheadModifierBNFNode, ///
|
|
18
|
-
callAheadModifierRule = new CallAheadModifierRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
-
|
|
20
|
-
return callAheadModifierRule;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Rule from "../rule";
|
|
4
|
-
import ChoiceOfPartsBNFNode from "../node/bnf/choiceOfParts";
|
|
5
|
-
import ChoiceOfPartsDefinition from "../definition/choiceOfParts";
|
|
6
|
-
|
|
7
|
-
import { choiceOfPartsRuleName } from "../ruleNames";
|
|
8
|
-
|
|
9
|
-
export default class ChoiceOfPartsRule extends Rule {
|
|
10
|
-
static fromNothing() {
|
|
11
|
-
const name = choiceOfPartsRuleName, ///
|
|
12
|
-
choiceOfPartsDefinition = ChoiceOfPartsDefinition.fromNothing(),
|
|
13
|
-
opacity = null,
|
|
14
|
-
definitions = [
|
|
15
|
-
choiceOfPartsDefinition
|
|
16
|
-
],
|
|
17
|
-
NonTerminalNode = ChoiceOfPartsBNFNode, ///
|
|
18
|
-
choiceOfPartsRule = new ChoiceOfPartsRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
-
|
|
20
|
-
return choiceOfPartsRule;
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/rule/definition.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Rule from "../rule";
|
|
4
|
-
import DefinitionBNFNode from "../node/bnf/definition";
|
|
5
|
-
import DefinitionDefinition from "../definition/definition";
|
|
6
|
-
|
|
7
|
-
import { definitionRuleName } from "../ruleNames";
|
|
8
|
-
|
|
9
|
-
export default class DefinitionRule extends Rule {
|
|
10
|
-
static fromNothing() {
|
|
11
|
-
const name = definitionRuleName, ///
|
|
12
|
-
definitionDefinition = DefinitionDefinition.fromNothing(),
|
|
13
|
-
opacity = null,
|
|
14
|
-
definitions = [
|
|
15
|
-
definitionDefinition
|
|
16
|
-
],
|
|
17
|
-
NonTerminalNode = DefinitionBNFNode, ///
|
|
18
|
-
definitionRule = new DefinitionRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
-
|
|
20
|
-
return definitionRule;
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/rule/definitions.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Rule from "../rule";
|
|
4
|
-
import DefinitionsBNFNode from "../node/bnf/definitions";
|
|
5
|
-
import DefinitionsDefinition from "../definition/definitions";
|
|
6
|
-
|
|
7
|
-
import { definitionsRuleName } from "../ruleNames";
|
|
8
|
-
|
|
9
|
-
export default class DefinitionsRule extends Rule {
|
|
10
|
-
static fromNothing() {
|
|
11
|
-
const definitionsDefinition = DefinitionsDefinition.fromNothing(),
|
|
12
|
-
name = definitionsRuleName, ///
|
|
13
|
-
opacity = null,
|
|
14
|
-
definitions = [
|
|
15
|
-
definitionsDefinition
|
|
16
|
-
],
|
|
17
|
-
NonTerminalNode = DefinitionsBNFNode, ///
|
|
18
|
-
definitionsRule = new DefinitionsRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
-
|
|
20
|
-
return definitionsRule;
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/rule/document.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Rule from "../rule";
|
|
4
|
-
import DocumentBNFNode from "../node/bnf/document";
|
|
5
|
-
import DocumentDefinition from "../definition/document";
|
|
6
|
-
|
|
7
|
-
import { documentRuleName } from "../ruleNames";
|
|
8
|
-
|
|
9
|
-
export default class DocumentRule extends Rule {
|
|
10
|
-
static fromNothing() {
|
|
11
|
-
const documentDefinition = DocumentDefinition.fromNothing(),
|
|
12
|
-
name = documentRuleName, ///
|
|
13
|
-
opacity = null,
|
|
14
|
-
definitions = [
|
|
15
|
-
documentDefinition
|
|
16
|
-
],
|
|
17
|
-
NonTerminalNode = DocumentBNFNode, ///
|
|
18
|
-
documentRule = new DocumentRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
-
|
|
20
|
-
return documentRule;
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/rule/error.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { specialSymbols } from "occam-lexers";
|
|
4
|
-
|
|
5
|
-
import Rule from "../rule";
|
|
6
|
-
import ErrorBNFNode from "../node/bnf/error";
|
|
7
|
-
import ErrorDefinition from "../definition/error";
|
|
8
|
-
|
|
9
|
-
import { errorRuleName } from "../ruleNames";
|
|
10
|
-
|
|
11
|
-
const { opaque } = specialSymbols;
|
|
12
|
-
|
|
13
|
-
export default class ErrorRule extends Rule {
|
|
14
|
-
static fromNothing() {
|
|
15
|
-
const errorDefinition = ErrorDefinition.fromNothing(),
|
|
16
|
-
name = errorRuleName, ///
|
|
17
|
-
opacity = opaque, ///
|
|
18
|
-
definitions = [
|
|
19
|
-
errorDefinition
|
|
20
|
-
],
|
|
21
|
-
NonTerminalNode = ErrorBNFNode,
|
|
22
|
-
errorRule = new ErrorRule(name, opacity, definitions, NonTerminalNode);
|
|
23
|
-
|
|
24
|
-
return errorRule;
|
|
25
|
-
}
|
|
26
|
-
}
|
package/src/rule/name.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Rule from "../rule";
|
|
4
|
-
import NameBNFNode from "../node/bnf/name";
|
|
5
|
-
import NameDefinition from "../definition/name";
|
|
6
|
-
|
|
7
|
-
import { nameRuleName } from "../ruleNames";
|
|
8
|
-
|
|
9
|
-
export default class NameRule extends Rule {
|
|
10
|
-
static fromNothing() {
|
|
11
|
-
const nameDefinition = NameDefinition.fromNothing(),
|
|
12
|
-
name = nameRuleName, ///
|
|
13
|
-
opacity = null,
|
|
14
|
-
definitions = [
|
|
15
|
-
nameDefinition
|
|
16
|
-
],
|
|
17
|
-
NonTerminalNode = NameBNFNode, ///
|
|
18
|
-
nameRule = new NameRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
-
|
|
20
|
-
return nameRule;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Rule from "../rule";
|
|
4
|
-
import NoWhitespacePartBNFNode from "../node/bnf/noWhitespacePart";
|
|
5
|
-
import NoWhitespacePartDefinition from "../definition/noWhitespacePart";
|
|
6
|
-
|
|
7
|
-
import { noWhitespacePartRuleName } from "../ruleNames";
|
|
8
|
-
|
|
9
|
-
export default class NoWhitespacePartRule extends Rule {
|
|
10
|
-
static fromNothing() {
|
|
11
|
-
const noWhitespacePartDefinition = NoWhitespacePartDefinition.fromNothing(),
|
|
12
|
-
name = noWhitespacePartRuleName, ///
|
|
13
|
-
opacity = null,
|
|
14
|
-
definitions = [
|
|
15
|
-
noWhitespacePartDefinition
|
|
16
|
-
],
|
|
17
|
-
NonTerminalNode = NoWhitespacePartBNFNode, ///
|
|
18
|
-
noWhitespacePartRule = new NoWhitespacePartRule(name, opacity, definitions, NonTerminalNode);
|
|
19
|
-
|
|
20
|
-
return noWhitespacePartRule;
|
|
21
|
-
}
|
|
22
|
-
}
|