chuckjonas / extract-interface-ts Goto Github PK
View Code? Open in Web Editor NEWA Typescript port of a demo from the Definitive Antlr 4 Reference (chapter 4.3)
A Typescript port of a demo from the Definitive Antlr 4 Reference (chapter 4.3)
After hacking a quick fix for #1, running npm run compile
gives me a different error. This one may be a bit trickier to address, as the antlr4ts cli tool currently exhibits some platform-specific differences in path handling on Windows. Antlr4ts has a bug outstanding on this, tunnelvisionlabs/antlr4ts#303, where I've documented the the suggested workaround. , I'll also mention @sharwell in this bug to get his attention.
Here's the errors running on Windows :
C:\code\extract-interface-ts>npm run compile
> [email protected] compile C:\code\extract-interface-ts
> tsc -watch -p ./
src/extractInterfaceListener.ts(2,39): error TS2307: Cannot find module './grammar/JavaParser'.
src/extractInterfaceListener.ts(3,40): error TS2307: Cannot find module './grammar/JavaParser'.
src/extractInterfaceListener.ts(7,26): error TS2307: Cannot find module './grammar/JavaParser'.
src/extractInterfaceListener.ts(8,28): error TS2307: Cannot find module './grammar/JavaListener'.
src/index.ts(5,25): error TS2307: Cannot find module './grammar/JavaLexer'.
src/index.ts(6,26): error TS2307: Cannot find module './grammar/JavaParser'.
2:37:03 PM - Compilation complete. Watching for file changes.
I downloaded your project and ran npm install
. It generated an error which suggests to me you have a hard-coded path somewhere that should be made relative to the project directory.
In other words, not everyone will clone your project into a directory named /Users/Jonas, so you don't want to include that path in the package.json scripts. The npm command will allways be run with the directory where package.json is locate being the current working directory, so relative paths like src/grammar/Java.g4
are better than ones rooted up at /Users
.
Here's the output (on a windows machine)
C:\code\extract-interface-ts>npm install
> [email protected] install C:\code\extract-interface-ts
> npm run antlr4ts
> [email protected] antlr4ts C:\code\extract-interface-ts
> antlr4ts -visitor /Users/jonas/Documents/code/apex-parser-ts/src/grammar/Java.g4
error(7): cannot find or open file: /Users/jonas/Documents/code/apex-parser-ts/src/grammar/Java.g4
child process exited with code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] antlr4ts: `antlr4ts -visitor /Users/jonas/Documents/code/apex-parser-ts/src/grammar/Java.g4`
npm ERR! Exit status 1
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.