grammar-well 1.1.2 → 1.1.4
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/build/compiler/compiler.d.ts +49 -49
- package/build/compiler/compiler.js +227 -227
- package/build/compiler/generator.d.ts +23 -23
- package/build/compiler/generator.js +213 -212
- package/build/compiler/generator.js.map +1 -1
- package/build/compiler/import-resolver.d.ts +15 -15
- package/build/compiler/import-resolver.js +36 -36
- package/build/compiler/outputs/javascript.d.ts +3 -3
- package/build/compiler/outputs/javascript.js +14 -14
- package/build/compiler/outputs/json.d.ts +2 -2
- package/build/compiler/outputs/json.js +7 -7
- package/build/compiler/outputs/typescript.d.ts +2 -2
- package/build/compiler/outputs/typescript.js +9 -8
- package/build/compiler/outputs/typescript.js.map +1 -1
- package/build/grammars/gwell.d.ts +1023 -997
- package/build/grammars/gwell.js +540 -536
- package/build/grammars/gwell.js.map +1 -1
- package/build/grammars/json.d.ts +151 -151
- package/build/grammars/json.js +111 -111
- package/build/grammars/number.d.ts +239 -239
- package/build/grammars/number.js +114 -114
- package/build/grammars/number.json +1 -1
- package/build/grammars/string.d.ts +116 -116
- package/build/grammars/string.js +49 -49
- package/build/grammars/string.json +1 -1
- package/build/grammars/whitespace.d.ts +51 -51
- package/build/grammars/whitespace.js +29 -29
- package/build/grammars/whitespace.json +1 -1
- package/build/index.d.ts +4 -4
- package/build/index.js +20 -20
- package/build/lexers/character-lexer.d.ts +27 -27
- package/build/lexers/character-lexer.js +70 -70
- package/build/lexers/stateful-lexer.d.ts +48 -48
- package/build/lexers/stateful-lexer.js +308 -308
- package/build/lexers/token-buffer.d.ts +32 -32
- package/build/lexers/token-buffer.js +91 -91
- package/build/parser/algorithms/cyk.d.ts +16 -16
- package/build/parser/algorithms/cyk.js +57 -57
- package/build/parser/algorithms/earley.d.ts +48 -48
- package/build/parser/algorithms/earley.js +157 -157
- package/build/parser/algorithms/lr.d.ts +10 -10
- package/build/parser/algorithms/lr.js +33 -33
- package/build/parser/parser.d.ts +26 -26
- package/build/parser/parser.js +73 -73
- package/build/typings.d.ts +199 -198
- package/build/typings.js +2 -2
- package/build/utility/general.d.ts +55 -55
- package/build/utility/general.js +175 -165
- package/build/utility/general.js.map +1 -1
- package/build/utility/lint.d.ts +2 -2
- package/build/utility/lint.js +27 -27
- package/build/utility/lr.d.ts +52 -52
- package/build/utility/lr.js +129 -129
- package/build/utility/text-format.d.ts +11 -11
- package/build/utility/text-format.js +83 -83
- package/package.json +1 -1
- package/src/compiler/generator.ts +1 -0
- package/src/compiler/outputs/typescript.ts +2 -1
- package/src/grammars/gwell.gwell +15 -13
- package/src/grammars/gwell.js +17 -13
- package/src/grammars/gwell.json +1 -1
- package/src/typings.ts +1 -0
- package/src/utility/general.ts +31 -19
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TokenBuffer = void 0;
|
|
4
|
-
class TokenBuffer {
|
|
5
|
-
lexer;
|
|
6
|
-
history = [];
|
|
7
|
-
queued = '';
|
|
8
|
-
$historyIndex = -1;
|
|
9
|
-
get offset() { return this.active?.offset || 0; }
|
|
10
|
-
get line() { return this.active?.line || 0; }
|
|
11
|
-
get column() { return this.active?.column || 0; }
|
|
12
|
-
get active() { return this.history[this.$historyIndex]; }
|
|
13
|
-
get state() {
|
|
14
|
-
return { historyIndex: this.$historyIndex, offset: this.offset };
|
|
15
|
-
}
|
|
16
|
-
constructor(lexer) {
|
|
17
|
-
this.lexer = lexer;
|
|
18
|
-
}
|
|
19
|
-
reset(buffer) {
|
|
20
|
-
this.lexer.feed(buffer);
|
|
21
|
-
this.history = [];
|
|
22
|
-
this.$historyIndex = -1;
|
|
23
|
-
}
|
|
24
|
-
restore(state) {
|
|
25
|
-
if (this.history[state.historyIndex].offset != state.offset) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
this.$historyIndex = state.historyIndex;
|
|
29
|
-
}
|
|
30
|
-
feed(buffer, flush) {
|
|
31
|
-
this.queued += buffer;
|
|
32
|
-
if (flush) {
|
|
33
|
-
this.flush();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
flush() {
|
|
37
|
-
this.history = this.history.slice(this.$historyIndex);
|
|
38
|
-
this.$historyIndex = 0;
|
|
39
|
-
if (this.lexer.flush) {
|
|
40
|
-
this.lexer.flush();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
previous() {
|
|
44
|
-
if (this.$historyIndex > 0) {
|
|
45
|
-
return this.history[--this.$historyIndex];
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
next() {
|
|
49
|
-
if (this.$historyIndex + 1 >= this.history.length) {
|
|
50
|
-
this.lexerNext();
|
|
51
|
-
}
|
|
52
|
-
if (this.$historyIndex + 1 < this.history.length) {
|
|
53
|
-
return this.history[++this.$historyIndex];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
peek(offset) {
|
|
57
|
-
offset += this.$historyIndex;
|
|
58
|
-
while ((offset >= this.history.length) && this.lexerNext()) {
|
|
59
|
-
}
|
|
60
|
-
if (offset >= 0 && offset < this.history.length)
|
|
61
|
-
return this.history[offset];
|
|
62
|
-
}
|
|
63
|
-
lexerNext() {
|
|
64
|
-
let token = this.lexer.next();
|
|
65
|
-
if (typeof token === 'undefined' && this.queued) {
|
|
66
|
-
this.lexer.feed(this.queued, this.$historyIndex >= 0 ? this.lexer.state() : undefined);
|
|
67
|
-
this.queued = '';
|
|
68
|
-
token = this.lexer.next();
|
|
69
|
-
}
|
|
70
|
-
if (token)
|
|
71
|
-
this.history.push(token);
|
|
72
|
-
return token;
|
|
73
|
-
}
|
|
74
|
-
[Symbol.iterator]() {
|
|
75
|
-
return new TokenIterator(this);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.TokenBuffer = TokenBuffer;
|
|
79
|
-
class TokenIterator {
|
|
80
|
-
buffer;
|
|
81
|
-
constructor(buffer) {
|
|
82
|
-
this.buffer = buffer;
|
|
83
|
-
}
|
|
84
|
-
next() {
|
|
85
|
-
const token = this.buffer.next();
|
|
86
|
-
return { value: token, done: !token };
|
|
87
|
-
}
|
|
88
|
-
[Symbol.iterator]() {
|
|
89
|
-
return this;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TokenBuffer = void 0;
|
|
4
|
+
class TokenBuffer {
|
|
5
|
+
lexer;
|
|
6
|
+
history = [];
|
|
7
|
+
queued = '';
|
|
8
|
+
$historyIndex = -1;
|
|
9
|
+
get offset() { return this.active?.offset || 0; }
|
|
10
|
+
get line() { return this.active?.line || 0; }
|
|
11
|
+
get column() { return this.active?.column || 0; }
|
|
12
|
+
get active() { return this.history[this.$historyIndex]; }
|
|
13
|
+
get state() {
|
|
14
|
+
return { historyIndex: this.$historyIndex, offset: this.offset };
|
|
15
|
+
}
|
|
16
|
+
constructor(lexer) {
|
|
17
|
+
this.lexer = lexer;
|
|
18
|
+
}
|
|
19
|
+
reset(buffer) {
|
|
20
|
+
this.lexer.feed(buffer);
|
|
21
|
+
this.history = [];
|
|
22
|
+
this.$historyIndex = -1;
|
|
23
|
+
}
|
|
24
|
+
restore(state) {
|
|
25
|
+
if (this.history[state.historyIndex].offset != state.offset) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
this.$historyIndex = state.historyIndex;
|
|
29
|
+
}
|
|
30
|
+
feed(buffer, flush) {
|
|
31
|
+
this.queued += buffer;
|
|
32
|
+
if (flush) {
|
|
33
|
+
this.flush();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
flush() {
|
|
37
|
+
this.history = this.history.slice(this.$historyIndex);
|
|
38
|
+
this.$historyIndex = 0;
|
|
39
|
+
if (this.lexer.flush) {
|
|
40
|
+
this.lexer.flush();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
previous() {
|
|
44
|
+
if (this.$historyIndex > 0) {
|
|
45
|
+
return this.history[--this.$historyIndex];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
next() {
|
|
49
|
+
if (this.$historyIndex + 1 >= this.history.length) {
|
|
50
|
+
this.lexerNext();
|
|
51
|
+
}
|
|
52
|
+
if (this.$historyIndex + 1 < this.history.length) {
|
|
53
|
+
return this.history[++this.$historyIndex];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
peek(offset) {
|
|
57
|
+
offset += this.$historyIndex;
|
|
58
|
+
while ((offset >= this.history.length) && this.lexerNext()) {
|
|
59
|
+
}
|
|
60
|
+
if (offset >= 0 && offset < this.history.length)
|
|
61
|
+
return this.history[offset];
|
|
62
|
+
}
|
|
63
|
+
lexerNext() {
|
|
64
|
+
let token = this.lexer.next();
|
|
65
|
+
if (typeof token === 'undefined' && this.queued) {
|
|
66
|
+
this.lexer.feed(this.queued, this.$historyIndex >= 0 ? this.lexer.state() : undefined);
|
|
67
|
+
this.queued = '';
|
|
68
|
+
token = this.lexer.next();
|
|
69
|
+
}
|
|
70
|
+
if (token)
|
|
71
|
+
this.history.push(token);
|
|
72
|
+
return token;
|
|
73
|
+
}
|
|
74
|
+
[Symbol.iterator]() {
|
|
75
|
+
return new TokenIterator(this);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.TokenBuffer = TokenBuffer;
|
|
79
|
+
class TokenIterator {
|
|
80
|
+
buffer;
|
|
81
|
+
constructor(buffer) {
|
|
82
|
+
this.buffer = buffer;
|
|
83
|
+
}
|
|
84
|
+
next() {
|
|
85
|
+
const token = this.buffer.next();
|
|
86
|
+
return { value: token, done: !token };
|
|
87
|
+
}
|
|
88
|
+
[Symbol.iterator]() {
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
92
|
//# sourceMappingURL=token-buffer.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { TokenBuffer } from "../../lexers/token-buffer";
|
|
2
|
-
import { GrammarRule, LanguageDefinition, LexerToken } from "../../typings";
|
|
3
|
-
export declare function CYK(language: LanguageDefinition & {
|
|
4
|
-
tokens: TokenBuffer;
|
|
5
|
-
}, _options?: {}): {
|
|
6
|
-
results: any[];
|
|
7
|
-
};
|
|
8
|
-
export interface NonTerminal {
|
|
9
|
-
rule: GrammarRule;
|
|
10
|
-
left: NonTerminal | Terminal;
|
|
11
|
-
right: NonTerminal | Terminal;
|
|
12
|
-
}
|
|
13
|
-
export interface Terminal {
|
|
14
|
-
rule: GrammarRule;
|
|
15
|
-
token: LexerToken;
|
|
16
|
-
}
|
|
1
|
+
import { TokenBuffer } from "../../lexers/token-buffer";
|
|
2
|
+
import { GrammarRule, LanguageDefinition, LexerToken } from "../../typings";
|
|
3
|
+
export declare function CYK(language: LanguageDefinition & {
|
|
4
|
+
tokens: TokenBuffer;
|
|
5
|
+
}, _options?: {}): {
|
|
6
|
+
results: any[];
|
|
7
|
+
};
|
|
8
|
+
export interface NonTerminal {
|
|
9
|
+
rule: GrammarRule;
|
|
10
|
+
left: NonTerminal | Terminal;
|
|
11
|
+
right: NonTerminal | Terminal;
|
|
12
|
+
}
|
|
13
|
+
export interface Terminal {
|
|
14
|
+
rule: GrammarRule;
|
|
15
|
+
token: LexerToken;
|
|
16
|
+
}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CYK = void 0;
|
|
4
|
-
const general_1 = require("../../utility/general");
|
|
5
|
-
const parser_1 = require("../parser");
|
|
6
|
-
function CYK(language, _options = {}) {
|
|
7
|
-
const { grammar, tokens } = language;
|
|
8
|
-
const terminals = [];
|
|
9
|
-
const nonTerminals = [];
|
|
10
|
-
for (const name in grammar.rules) {
|
|
11
|
-
for (const rule of grammar.rules[name]) {
|
|
12
|
-
const { symbols } = rule;
|
|
13
|
-
if (parser_1.ParserUtility.SymbolIsTerminal(symbols[0])) {
|
|
14
|
-
terminals.push(rule);
|
|
15
|
-
}
|
|
16
|
-
else {
|
|
17
|
-
nonTerminals.push(rule);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
let currentTokenIndex = -1;
|
|
22
|
-
const chart = new general_1.Matrix(0, 0, () => new Map());
|
|
23
|
-
for (const token of tokens) {
|
|
24
|
-
currentTokenIndex++;
|
|
25
|
-
chart.resize(currentTokenIndex + 2, currentTokenIndex + 2);
|
|
26
|
-
for (const rule of terminals) {
|
|
27
|
-
if (parser_1.ParserUtility.TokenMatchesSymbol(token, rule.symbols[0])) {
|
|
28
|
-
chart.get(currentTokenIndex, currentTokenIndex).set(rule.name, { rule, token });
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
for (let floor = currentTokenIndex; floor >= 0; floor--) {
|
|
32
|
-
for (let inner = floor; inner <= currentTokenIndex; inner++) {
|
|
33
|
-
const leftCell = chart.get(floor, inner);
|
|
34
|
-
const rightCell = chart.get(inner + 1, currentTokenIndex);
|
|
35
|
-
for (const rule of nonTerminals) {
|
|
36
|
-
const { symbols: [leftSymbol, rightSymbol] } = rule;
|
|
37
|
-
const left = leftCell.get(leftSymbol);
|
|
38
|
-
const right = rightCell.get(rightSymbol);
|
|
39
|
-
if (left && right) {
|
|
40
|
-
chart.get(floor, currentTokenIndex).set(rule.name, { rule, left, right });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
const results = Array.from(chart.get(0, currentTokenIndex).values()).map(v => GetValue(v));
|
|
47
|
-
return { results };
|
|
48
|
-
}
|
|
49
|
-
exports.CYK = CYK;
|
|
50
|
-
function GetValue(ref) {
|
|
51
|
-
if (!ref)
|
|
52
|
-
return;
|
|
53
|
-
if ('token' in ref) {
|
|
54
|
-
return parser_1.ParserUtility.PostProcess(ref.rule, [ref.token]);
|
|
55
|
-
}
|
|
56
|
-
return parser_1.ParserUtility.PostProcess(ref.rule, [GetValue(ref.left), GetValue(ref.right)]);
|
|
57
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CYK = void 0;
|
|
4
|
+
const general_1 = require("../../utility/general");
|
|
5
|
+
const parser_1 = require("../parser");
|
|
6
|
+
function CYK(language, _options = {}) {
|
|
7
|
+
const { grammar, tokens } = language;
|
|
8
|
+
const terminals = [];
|
|
9
|
+
const nonTerminals = [];
|
|
10
|
+
for (const name in grammar.rules) {
|
|
11
|
+
for (const rule of grammar.rules[name]) {
|
|
12
|
+
const { symbols } = rule;
|
|
13
|
+
if (parser_1.ParserUtility.SymbolIsTerminal(symbols[0])) {
|
|
14
|
+
terminals.push(rule);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
nonTerminals.push(rule);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
let currentTokenIndex = -1;
|
|
22
|
+
const chart = new general_1.Matrix(0, 0, () => new Map());
|
|
23
|
+
for (const token of tokens) {
|
|
24
|
+
currentTokenIndex++;
|
|
25
|
+
chart.resize(currentTokenIndex + 2, currentTokenIndex + 2);
|
|
26
|
+
for (const rule of terminals) {
|
|
27
|
+
if (parser_1.ParserUtility.TokenMatchesSymbol(token, rule.symbols[0])) {
|
|
28
|
+
chart.get(currentTokenIndex, currentTokenIndex).set(rule.name, { rule, token });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
for (let floor = currentTokenIndex; floor >= 0; floor--) {
|
|
32
|
+
for (let inner = floor; inner <= currentTokenIndex; inner++) {
|
|
33
|
+
const leftCell = chart.get(floor, inner);
|
|
34
|
+
const rightCell = chart.get(inner + 1, currentTokenIndex);
|
|
35
|
+
for (const rule of nonTerminals) {
|
|
36
|
+
const { symbols: [leftSymbol, rightSymbol] } = rule;
|
|
37
|
+
const left = leftCell.get(leftSymbol);
|
|
38
|
+
const right = rightCell.get(rightSymbol);
|
|
39
|
+
if (left && right) {
|
|
40
|
+
chart.get(floor, currentTokenIndex).set(rule.name, { rule, left, right });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const results = Array.from(chart.get(0, currentTokenIndex).values()).map(v => GetValue(v));
|
|
47
|
+
return { results };
|
|
48
|
+
}
|
|
49
|
+
exports.CYK = CYK;
|
|
50
|
+
function GetValue(ref) {
|
|
51
|
+
if (!ref)
|
|
52
|
+
return;
|
|
53
|
+
if ('token' in ref) {
|
|
54
|
+
return parser_1.ParserUtility.PostProcess(ref.rule, [ref.token]);
|
|
55
|
+
}
|
|
56
|
+
return parser_1.ParserUtility.PostProcess(ref.rule, [GetValue(ref.left), GetValue(ref.right)]);
|
|
57
|
+
}
|
|
58
58
|
//# sourceMappingURL=cyk.js.map
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { Dictionary, GrammarRule, LanguageDefinition } from "../../typings";
|
|
2
|
-
import { TokenBuffer } from "../../lexers/token-buffer";
|
|
3
|
-
export interface EarleyParserOptions {
|
|
4
|
-
keepHistory?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function Earley(language: LanguageDefinition & {
|
|
7
|
-
tokens: TokenBuffer;
|
|
8
|
-
}, options?: EarleyParserOptions): {
|
|
9
|
-
results: any[];
|
|
10
|
-
info: {
|
|
11
|
-
table: Column[];
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
declare class Column {
|
|
15
|
-
private rules;
|
|
16
|
-
index: number;
|
|
17
|
-
data: any;
|
|
18
|
-
states: State[];
|
|
19
|
-
wants: Dictionary<State[]>;
|
|
20
|
-
scannable: State[];
|
|
21
|
-
completed: Dictionary<State[]>;
|
|
22
|
-
constructor(rules: Dictionary<GrammarRule[]>, index: number);
|
|
23
|
-
process(): void;
|
|
24
|
-
predict(exp: string): void;
|
|
25
|
-
expects(): GrammarRule[];
|
|
26
|
-
private complete;
|
|
27
|
-
}
|
|
28
|
-
declare class State {
|
|
29
|
-
rule: GrammarRule;
|
|
30
|
-
dot: number;
|
|
31
|
-
reference: number;
|
|
32
|
-
wantedBy: State[];
|
|
33
|
-
isComplete: boolean;
|
|
34
|
-
data: any;
|
|
35
|
-
left: State;
|
|
36
|
-
right: State | StateToken;
|
|
37
|
-
constructor(rule: GrammarRule, dot: number, reference: number, wantedBy: State[]);
|
|
38
|
-
nextState(child: State | StateToken): State;
|
|
39
|
-
finish(): void;
|
|
40
|
-
protected build(): any[];
|
|
41
|
-
}
|
|
42
|
-
interface StateToken {
|
|
43
|
-
data: any;
|
|
44
|
-
token: any;
|
|
45
|
-
isToken: boolean;
|
|
46
|
-
reference: number;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
1
|
+
import { Dictionary, GrammarRule, LanguageDefinition } from "../../typings";
|
|
2
|
+
import { TokenBuffer } from "../../lexers/token-buffer";
|
|
3
|
+
export interface EarleyParserOptions {
|
|
4
|
+
keepHistory?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function Earley(language: LanguageDefinition & {
|
|
7
|
+
tokens: TokenBuffer;
|
|
8
|
+
}, options?: EarleyParserOptions): {
|
|
9
|
+
results: any[];
|
|
10
|
+
info: {
|
|
11
|
+
table: Column[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare class Column {
|
|
15
|
+
private rules;
|
|
16
|
+
index: number;
|
|
17
|
+
data: any;
|
|
18
|
+
states: State[];
|
|
19
|
+
wants: Dictionary<State[]>;
|
|
20
|
+
scannable: State[];
|
|
21
|
+
completed: Dictionary<State[]>;
|
|
22
|
+
constructor(rules: Dictionary<GrammarRule[]>, index: number);
|
|
23
|
+
process(): void;
|
|
24
|
+
predict(exp: string): void;
|
|
25
|
+
expects(): GrammarRule[];
|
|
26
|
+
private complete;
|
|
27
|
+
}
|
|
28
|
+
declare class State {
|
|
29
|
+
rule: GrammarRule;
|
|
30
|
+
dot: number;
|
|
31
|
+
reference: number;
|
|
32
|
+
wantedBy: State[];
|
|
33
|
+
isComplete: boolean;
|
|
34
|
+
data: any;
|
|
35
|
+
left: State;
|
|
36
|
+
right: State | StateToken;
|
|
37
|
+
constructor(rule: GrammarRule, dot: number, reference: number, wantedBy: State[]);
|
|
38
|
+
nextState(child: State | StateToken): State;
|
|
39
|
+
finish(): void;
|
|
40
|
+
protected build(): any[];
|
|
41
|
+
}
|
|
42
|
+
interface StateToken {
|
|
43
|
+
data: any;
|
|
44
|
+
token: any;
|
|
45
|
+
isToken: boolean;
|
|
46
|
+
reference: number;
|
|
47
|
+
}
|
|
48
|
+
export {};
|