Comments (11)
I also get something like this:
src/generated_parser/MetamarkLexer.ts:83:13 - error TS4114: This member must have an 'override' modifier because it overrides a member in the base class 'Lexer'.
83 public get serializedATN(): string { return MetamarkLexer._serializedATN; }
~~~~~~~~~~~~~
I have strict tsconfig.json
settings in my project and it's not really possible to add an exception from a rule for ANTLR-generated classes... So I'm basically forced to use less safe compiler options π
from antlr4ts.
Managed to recompile the .jar file for the generation tool (in folder 'tool'). Then put the file antlr4-typescript-4.9.0-SNAPSHOT-complete.jar
in the Angular project folder for antlr4ts-cli
(node_modules/antlr4ts-cli/target
) and ran the regular antlr4ts
script to generate new files.
from antlr4ts.
I'm having the same trouble and your workaround is unfortunately only a workaround.
This issue/ticket needs to be reopened to solve this problem here in this repository.
from antlr4ts.
Another solution would be to just unzip the .jar-file ntlr4-typescript-4.9.0-SNAPSHOT-complete.jar
(after all it is just a zip-file) and replace the given attachment (see my initial contribution) and re-zip the whole thing and rename it to .jar again.
The .jar-file can me found in node_modules/antlr4ts-cli/target
.
from antlr4ts.
Here is an example on how to automate this: nidomiro/relation-tuple-parser@8209a1b
from antlr4ts.
are your problems resolved?
did you compile using ts 4.4.0+?
@martinmolema @nidomiro
from antlr4ts.
@chengchengpei I'm using ts 4.8.2 at the commit posted above. It compiles, but only with the patches.
from antlr4ts.
@chengchengpei thank you for your help. However, I have no idea how to apply such a patch... there's a first time for everything. Could you give me pointers here?
from antlr4ts.
I got some errors when using antlr4ts in my project. Here is the post: https://stackoverflow.com/questions/74870072/typeerror-class-extends-value-undefined-is-not-a-constructor-or-null-when-using
I need help. Any comments welcomed. thanks :)
from antlr4ts.
I upgraded to Angular 16 and got some more errors. Noticed that a few more override
statements had to be inserted.
TypeScript.txt
Please rename this attachment to TypeScript.stg
and put it in the right place.
Also wrote a small shell-script to help repackaging without recompiling the whole stuff. Make sure to unpack the original .jar-file somewhere. Then put the script and the attachment (TypeScript.stg) in the same folder. So you get the following folder structure:
ProjectFolder
|
|-----antlr4-typescript-4.9.0-SNAPSHOT-complete/
|-----repackage.sh
|-----TypeScript.stg
# This will create a new JAR-file that can be used to create new G4-dependant files using the antlr4ts-cli
# - Edit the file ./TypeScript.stg (in this folder)
# - save the file
# - run this script
# The script will copy the .stg-file to the right folder in the folder structure that originated from the original
# JAR-file (antlr4-typescript-4.9.0-SNAPSHOT-complete.jar) that was unpacked here.
# then a new JAR-file is created and put in the right folder: the node_modules folder that was created when installing
# the antlr4ts-cli (https://github.com/tunnelvisionlabs/antlr4ts/tree/master) :
# node_modules/antlr4ts-cli/target/antlr4-typescript-4.9.0-SNAPSHOT-complete.jar
PROJECT_ROOT="/mnt/ssd/Develop/crisisgame/scenariomanager-v16"
ANTLR4TS_FOLDER=${PROJECT_ROOT}/__Resources/Antlr4ts-cli
JAR_FILE_UNPACKED_FOLDER=${ANTLR4TS_FOLDER}/antlr4-typescript-4.9.0-SNAPSHOT-complete
TEMPLATE_FILENAME_DESTINATION_JAR_FILE=${JAR_FILE_UNPACKED_FOLDER}/org/antlr/v4/tool/templates/codegen/TypeScript
cd $ANTLR4TS_FOLDER
cp TypeScript.stg $TEMPLATE_FILENAME_DESTINATION_JAR_FILE
# Repackage the file. this must be done using the current folder otherwise the class-files will have an absolute path in them
cd $JAR_FILE_UNPACKED_FOLDER
jar cvfm $ANTLR4TS_FOLDER/typescript.jar ./META-INF/MANIFEST.MF .
# Copy to source location and rename to right filename
cd $ANTLR4TS_FOLDER
cp typescript.jar ${PROJECT_ROOT}/node_modules/antlr4ts-cli/target/antlr4-typescript-4.9.0-SNAPSHOT-complete.jar
from antlr4ts.
Still seeing the same thing on TypeScript 4.9.5 :(
from antlr4ts.
Related Issues (20)
- Can't run on an Angular project? HOT 2
- Inconsistent file generation across operating systems
- Example in the README uses a deprecated feature
- Generated Parser refers to C++ Classes (std::set<std::string>), unable to compile TS HOT 1
- Cannot find module βnode_modules\antlr4ts\atn\ATNβ HOT 1
- Update serialization version support
- Grammar r file `exception` rule is conflict with ParserRuleContext.exception
- antlr4ts cli's -o option is wrong affected by the grammar file option
- Incorporate the >4.10 release
- child process exited with code 3221226505
- return type declaration does not support function types
- Project continues to be updated? HOT 4
- Argument of type 'SqlParser' is not assignable to parameter of type 'Parser'.
- Uncaught TypeError: Cannot read properties of undefined (reading 'custom') at node_modules/antlr4ts/misc/BitSet.js (BitSet.ts:834:32) HOT 7
- Could not generate files with esm type
- "cannot find tokens file" (documentation missing) HOT 1
- TS2339: Property 'compilationUnit' does not exist on type 'Python3Parser'. HOT 1
- Webpack 5 - AntlrTS in Browser HOT 3
- Suggestion for transformation of parse tree
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from antlr4ts.