Skip to content

Commit

Permalink
No longer uses an own ANTLR jar for code generation
Browse files Browse the repository at this point in the history
The project instead relies now on the antlr4ng-cli package for code generation.
Also increased the Node.js version to use for Github actions.
  • Loading branch information
mike-lischke committed Sep 12, 2023
1 parent 35e3824 commit 4c3a08b
Show file tree
Hide file tree
Showing 10 changed files with 9,042 additions and 9,014 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 19.x]
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
1 change: 0 additions & 1 deletion antlr

This file was deleted.

20 changes: 16 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"test": "jest --testMatch [ \"**/tests/**/*.spec.ts\" ] --no-coverage --watchAll=false --max-worker=1",
"test-ci": "jest --testMatch [ \"**/tests/**/*.spec.ts\" ] --no-coverage --watchAll=false --silent",
"test-coverage": "jest --testMatch [ \"**/tests/**/*.spec.ts\" ] --coverage --silent",
"generate": "java -jar antlr/antlr4-4.13.2-SNAPSHOT-complete.jar -Dlanguage=TypeScript tests/CPP14.g4 tests/Expr.g4 tests/Whitebox.g4 -no-listener -no-visitor -o tests/generated -Xexact-output-dir",
"generate": "antlr4ng -Dlanguage=TypeScript tests/CPP14.g4 tests/Expr.g4 tests/Whitebox.g4 -no-listener -no-visitor -o tests/generated -Xexact-output-dir",
"eslint": "eslint ."
},
"devDependencies": {
Expand All @@ -32,6 +32,7 @@
"@types/unicode-properties": "1.3.0",
"@typescript-eslint/eslint-plugin": "6.6.0",
"@typescript-eslint/parser": "6.6.0",
"antlr4ng-cli": "1.0.0",
"eslint": "8.48.0",
"eslint-plugin-import": "2.28.1",
"eslint-plugin-jsdoc": "46.5.1",
Expand All @@ -42,6 +43,6 @@
"typescript": "5.2.2"
},
"dependencies": {
"antlr4ng": "1.0.6"
"antlr4ng": "1.0.7"
}
}
1,258 changes: 629 additions & 629 deletions tests/generated/CPP14Lexer.ts

Large diffs are not rendered by default.

15,646 changes: 7,823 additions & 7,823 deletions tests/generated/CPP14Parser.ts

Large diffs are not rendered by default.

50 changes: 26 additions & 24 deletions tests/generated/ExprLexer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Generated from tests/Expr.g4 by ANTLR 4.13.1

import * as antlr from "antlr4ng";
import { Token } from "antlr4ng";


export class ExprLexer extends antlr.Lexer {
public static readonly VAR = 1;
Expand All @@ -24,7 +26,7 @@ export class ExprLexer extends antlr.Lexer {
];

public static readonly symbolicNames = [
null, "VAR", "LET", "PLUS", "MINUS", "MULTIPLY", "DIVIDE", "EQUAL",
null, "VAR", "LET", "PLUS", "MINUS", "MULTIPLY", "DIVIDE", "EQUAL",
"OPEN_PAR", "CLOSE_PAR", "ID", "WS"
];

Expand All @@ -33,7 +35,7 @@ export class ExprLexer extends antlr.Lexer {
];

public static readonly ruleNames = [
"VAR", "LET", "PLUS", "MINUS", "MULTIPLY", "DIVIDE", "EQUAL", "OPEN_PAR",
"VAR", "LET", "PLUS", "MINUS", "MULTIPLY", "DIVIDE", "EQUAL", "OPEN_PAR",
"CLOSE_PAR", "ID", "WS",
];

Expand All @@ -56,26 +58,26 @@ export class ExprLexer extends antlr.Lexer {
public get modeNames(): string[] { return ExprLexer.modeNames; }

public static readonly _serializedATN: number[] = [
4, 0, 11, 56, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2,
6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 5, 1, 5, 1, 6, 1, 6, 1, 7, 1, 7, 1, 8, 1, 8,
1, 9, 1, 9, 5, 9, 48, 8, 9, 10, 9, 12, 9, 51, 9, 9, 1, 10, 1, 10, 1, 10, 1, 10, 0, 0, 11, 1,
1, 3, 2, 5, 3, 7, 4, 9, 5, 11, 6, 13, 7, 15, 8, 17, 9, 19, 10, 21, 11, 1, 0, 9, 2, 0, 86, 86,
118, 118, 2, 0, 65, 65, 97, 97, 2, 0, 82, 82, 114, 114, 2, 0, 76, 76, 108, 108, 2, 0,
69, 69, 101, 101, 2, 0, 84, 84, 116, 116, 2, 0, 65, 90, 97, 122, 4, 0, 48, 57, 65, 90,
95, 95, 97, 122, 3, 0, 9, 10, 13, 13, 32, 32, 56, 0, 1, 1, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 5,
1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1,
0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 1, 23, 1, 0, 0, 0, 3, 27, 1,
0, 0, 0, 5, 31, 1, 0, 0, 0, 7, 33, 1, 0, 0, 0, 9, 35, 1, 0, 0, 0, 11, 37, 1, 0, 0, 0, 13, 39,
1, 0, 0, 0, 15, 41, 1, 0, 0, 0, 17, 43, 1, 0, 0, 0, 19, 45, 1, 0, 0, 0, 21, 52, 1, 0, 0, 0,
23, 24, 7, 0, 0, 0, 24, 25, 7, 1, 0, 0, 25, 26, 7, 2, 0, 0, 26, 2, 1, 0, 0, 0, 27, 28, 7, 3,
0, 0, 28, 29, 7, 4, 0, 0, 29, 30, 7, 5, 0, 0, 30, 4, 1, 0, 0, 0, 31, 32, 5, 43, 0, 0, 32, 6,
1, 0, 0, 0, 33, 34, 5, 45, 0, 0, 34, 8, 1, 0, 0, 0, 35, 36, 5, 42, 0, 0, 36, 10, 1, 0, 0, 0,
37, 38, 5, 47, 0, 0, 38, 12, 1, 0, 0, 0, 39, 40, 5, 61, 0, 0, 40, 14, 1, 0, 0, 0, 41, 42,
5, 40, 0, 0, 42, 16, 1, 0, 0, 0, 43, 44, 5, 41, 0, 0, 44, 18, 1, 0, 0, 0, 45, 49, 7, 6, 0,
0, 46, 48, 7, 7, 0, 0, 47, 46, 1, 0, 0, 0, 48, 51, 1, 0, 0, 0, 49, 47, 1, 0, 0, 0, 49, 50,
1, 0, 0, 0, 50, 20, 1, 0, 0, 0, 51, 49, 1, 0, 0, 0, 52, 53, 7, 8, 0, 0, 53, 54, 1, 0, 0, 0,
54, 55, 6, 10, 0, 0, 55, 22, 1, 0, 0, 0, 2, 0, 49, 1, 0, 1, 0
4,0,11,56,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,
6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,1,0,1,0,1,0,1,0,1,1,1,1,
1,1,1,1,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,
1,9,1,9,5,9,48,8,9,10,9,12,9,51,9,9,1,10,1,10,1,10,1,10,0,0,11,1,
1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,1,0,9,2,0,86,86,
118,118,2,0,65,65,97,97,2,0,82,82,114,114,2,0,76,76,108,108,2,0,
69,69,101,101,2,0,84,84,116,116,2,0,65,90,97,122,4,0,48,57,65,90,
95,95,97,122,3,0,9,10,13,13,32,32,56,0,1,1,0,0,0,0,3,1,0,0,0,0,5,
1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,
0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,1,23,1,0,0,0,3,27,1,
0,0,0,5,31,1,0,0,0,7,33,1,0,0,0,9,35,1,0,0,0,11,37,1,0,0,0,13,39,
1,0,0,0,15,41,1,0,0,0,17,43,1,0,0,0,19,45,1,0,0,0,21,52,1,0,0,0,
23,24,7,0,0,0,24,25,7,1,0,0,25,26,7,2,0,0,26,2,1,0,0,0,27,28,7,3,
0,0,28,29,7,4,0,0,29,30,7,5,0,0,30,4,1,0,0,0,31,32,5,43,0,0,32,6,
1,0,0,0,33,34,5,45,0,0,34,8,1,0,0,0,35,36,5,42,0,0,36,10,1,0,0,0,
37,38,5,47,0,0,38,12,1,0,0,0,39,40,5,61,0,0,40,14,1,0,0,0,41,42,
5,40,0,0,42,16,1,0,0,0,43,44,5,41,0,0,44,18,1,0,0,0,45,49,7,6,0,
0,46,48,7,7,0,0,47,46,1,0,0,0,48,51,1,0,0,0,49,47,1,0,0,0,49,50,
1,0,0,0,50,20,1,0,0,0,51,49,1,0,0,0,52,53,7,8,0,0,53,54,1,0,0,0,
54,55,6,10,0,0,55,22,1,0,0,0,2,0,49,1,0,1,0
];

private static __ATN: antlr.ATN;
Expand All @@ -94,5 +96,5 @@ export class ExprLexer extends antlr.Lexer {
return ExprLexer.vocabulary;
}

private static readonly decisionsToDFA = ExprLexer._ATN.decisionToState.map((ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index));
}
private static readonly decisionsToDFA = ExprLexer._ATN.decisionToState.map( (ds: antlr.DecisionState, index: number) => new antlr.DFA(ds, index) );
}
Loading

0 comments on commit 4c3a08b

Please sign in to comment.