-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Grammar parsing and tree walkers working. - Semantic pipeline working (inclusive left recursion removal).
- Loading branch information
1 parent
7a94e99
commit bae1768
Showing
11 changed files
with
477 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,97 +1,98 @@ | ||
ACTION = 4 | ||
ACTION_CHAR_LITERAL = 5 | ||
ACTION_ESC = 6 | ||
ACTION_STRING_LITERAL = 7 | ||
ARG_ACTION = 8 | ||
ARG_OR_CHARSET = 9 | ||
ASSIGN = 10 | ||
AT = 11 | ||
CATCH = 12 | ||
CHANNELS = 13 | ||
COLON = 14 | ||
COLONCOLON = 15 | ||
COMMA = 16 | ||
DOC_COMMENT = 17 | ||
DOLLAR = 18 | ||
DOT = 19 | ||
ERRCHAR = 20 | ||
ESC_SEQ = 21 | ||
FINALLY = 22 | ||
FRAGMENT = 23 | ||
GRAMMAR = 24 | ||
GT = 25 | ||
HEX_DIGIT = 26 | ||
ID = 27 | ||
IMPORT = 28 | ||
INT = 29 | ||
LEXER = 30 | ||
LEXER_CHAR_SET = 31 | ||
LOCALS = 32 | ||
LPAREN = 33 | ||
LT = 34 | ||
MODE = 35 | ||
NESTED_ACTION = 36 | ||
NLCHARS = 37 | ||
NOT = 38 | ||
NameChar = 39 | ||
NameStartChar = 40 | ||
OPTIONS = 41 | ||
OR = 42 | ||
PARSER = 43 | ||
PLUS = 44 | ||
PLUS_ASSIGN = 45 | ||
POUND = 46 | ||
QUESTION = 47 | ||
RANGE = 48 | ||
RARROW = 49 | ||
RBRACE = 50 | ||
RETURNS = 51 | ||
RPAREN = 52 | ||
RULE_REF = 53 | ||
SEMI = 54 | ||
SEMPRED = 55 | ||
SRC = 56 | ||
STAR = 57 | ||
STRING_LITERAL = 58 | ||
THROWS = 59 | ||
TOKENS_SPEC = 60 | ||
TOKEN_REF = 61 | ||
UNICODE_ESC = 62 | ||
UNICODE_EXTENDED_ESC = 63 | ||
UnicodeBOM = 64 | ||
WS = 65 | ||
WSCHARS = 66 | ||
WSNLCHARS = 67 | ||
ALT = 68 | ||
BLOCK = 69 | ||
CLOSURE = 70 | ||
COMBINED = 71 | ||
ELEMENT_OPTIONS = 72 | ||
EPSILON = 73 | ||
LEXER_ACTION_CALL = 74 | ||
LEXER_ALT_ACTION = 75 | ||
OPTIONAL = 76 | ||
POSITIVE_CLOSURE = 77 | ||
RULE = 78 | ||
RULEMODIFIERS = 79 | ||
RULES = 80 | ||
SET = 81 | ||
WILDCARD = 82 | ||
BLOCK_COMMENT = 83 | ||
LINE_COMMENT = 84 | ||
UNTERMINATED_STRING_LITERAL = 85 | ||
BEGIN_ARGUMENT = 86 | ||
BEGIN_ACTION = 87 | ||
TOKENS = 88 | ||
LBRACE = 89 | ||
END_ARGUMENT = 90 | ||
UNTERMINATED_ARGUMENT = 91 | ||
ARGUMENT_CONTENT = 92 | ||
END_ACTION = 93 | ||
UNTERMINATED_ACTION = 94 | ||
ACTION_CONTENT = 95 | ||
UNTERMINATED_CHAR_SET = 96 | ||
PRIVATE = 97 | ||
PROTECTED = 98 | ||
PUBLIC = 99 | ||
PREDICATE_OPTIONS = 100 | ||
ACTION = 4 | ||
ACTION_CHAR_LITERAL = 5 | ||
ACTION_ESC = 6 | ||
ACTION_STRING_LITERAL = 7 | ||
ARG_ACTION = 8 | ||
ARG_OR_CHARSET = 9 | ||
ASSIGN = 10 | ||
AT = 11 | ||
CATCH = 12 | ||
CHANNELS = 13 | ||
COLON = 14 | ||
COLONCOLON = 15 | ||
COMMA = 16 | ||
COMMENT1 = 17 | ||
DOC_COMMENT = 18 | ||
DOLLAR = 19 | ||
DOT = 20 | ||
ERRCHAR = 21 | ||
ESC_SEQ = 22 | ||
FINALLY = 23 | ||
FRAGMENT = 24 | ||
GRAMMAR = 25 | ||
GT = 26 | ||
HEX_DIGIT = 27 | ||
ID = 28 | ||
IMPORT = 29 | ||
INT = 30 | ||
LEXER = 31 | ||
LEXER_CHAR_SET = 32 | ||
LOCALS = 33 | ||
LPAREN = 34 | ||
LT = 35 | ||
MODE = 36 | ||
NESTED_ACTION = 37 | ||
NLCHARS = 38 | ||
NOT = 39 | ||
NameChar = 40 | ||
NameStartChar = 41 | ||
OPTIONS = 42 | ||
OR = 43 | ||
PARSER = 44 | ||
PLUS = 45 | ||
PLUS_ASSIGN = 46 | ||
POUND = 47 | ||
QUESTION = 48 | ||
RANGE = 49 | ||
RARROW = 50 | ||
RBRACE = 51 | ||
RETURNS = 52 | ||
RPAREN = 53 | ||
RULE_REF = 54 | ||
SEMI = 55 | ||
SEMPRED = 56 | ||
SRC = 57 | ||
STAR = 58 | ||
STRING_LITERAL = 59 | ||
THROWS = 60 | ||
TOKENS_SPEC = 61 | ||
TOKEN_REF = 62 | ||
UNICODE_ESC = 63 | ||
UNICODE_EXTENDED_ESC = 64 | ||
UnicodeBOM = 65 | ||
WS = 66 | ||
WSCHARS = 67 | ||
WSNLCHARS = 68 | ||
ALT = 69 | ||
BLOCK = 70 | ||
CLOSURE = 71 | ||
COMBINED = 72 | ||
ELEMENT_OPTIONS = 73 | ||
EPSILON = 74 | ||
LEXER_ACTION_CALL = 75 | ||
LEXER_ALT_ACTION = 76 | ||
OPTIONAL = 77 | ||
POSITIVE_CLOSURE = 78 | ||
RULE = 79 | ||
RULEMODIFIERS = 80 | ||
RULES = 81 | ||
SET = 82 | ||
WILDCARD = 83 | ||
BLOCK_COMMENT = 84 | ||
LINE_COMMENT = 85 | ||
UNTERMINATED_STRING_LITERAL = 86 | ||
BEGIN_ARGUMENT = 87 | ||
BEGIN_ACTION = 88 | ||
TOKENS = 89 | ||
LBRACE = 90 | ||
END_ARGUMENT = 91 | ||
UNTERMINATED_ARGUMENT = 92 | ||
ARGUMENT_CONTENT = 93 | ||
END_ACTION = 94 | ||
UNTERMINATED_ACTION = 95 | ||
ACTION_CONTENT = 96 | ||
UNTERMINATED_CHAR_SET = 97 | ||
PRIVATE = 98 | ||
PROTECTED = 99 | ||
PUBLIC = 100 | ||
PREDICATE_OPTIONS = 101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) The ANTLR Project. All rights reserved. | ||
* Use of this file is governed by the BSD 3-clause license that | ||
* can be found in the LICENSE.txt file in the project root. | ||
*/ | ||
|
||
export class OrderedHashMap<K, V> extends Map<K, V> { | ||
/** Track the elements as they are added to the set */ | ||
private elements: K[] = []; | ||
|
||
public override get(key: K): never { | ||
throw new Error("Use getKey and getElement instead."); | ||
} | ||
|
||
public getKey(i: number): K { | ||
return this.elements[i]; | ||
} | ||
|
||
public getElement(i: number): V | undefined { | ||
return super.get(this.elements[i]); | ||
} | ||
|
||
public override set(key: K, value: V): this { | ||
this.elements.push(key); | ||
|
||
return super.set(key, value); | ||
} | ||
} |
Oops, something went wrong.