Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a smith I want a first prototype of an integrated d.ts parser #2293

Closed
mmews-n4 opened this issue Jan 6, 2022 · 0 comments · Fixed by #2306
Closed

As a smith I want a first prototype of an integrated d.ts parser #2293

mmews-n4 opened this issue Jan 6, 2022 · 0 comments · Fixed by #2306
Assignees

Comments

@mmews-n4
Copy link
Contributor

mmews-n4 commented Jan 6, 2022

The prototype is base on the antlr4 parser for d.ts files of #2284 and provides a first implementation for:

  • parsing d.ts files during the normal build process of an n4js project
  • deriving an n4js AST (selected features only) from d.ts parse tree
  • performing linking and scoping for the derived AST
  • providing a very limited feature set to be accessible from n4js files by importing d.ts files
  • some tests and their infrastructure to test interplay of d.ts and n4js
@mmews-n4 mmews-n4 self-assigned this Jan 6, 2022
mmews-n4 added a commit that referenced this issue Jan 26, 2022
Conflicts:
	plugins/org.eclipse.n4js.dts/.classpath
	plugins/org.eclipse.n4js.dts/META-INF/MANIFEST.MF
	plugins/org.eclipse.n4js.dts/grammar/.antlr/TypeScriptLexer.interp
	plugins/org.eclipse.n4js.dts/grammar/.antlr/TypeScriptParser.interp
	plugins/org.eclipse.n4js.dts/grammar/TypeScriptLexer.g4
	plugins/org.eclipse.n4js.dts/grammar/TypeScriptParser.g4
	plugins/org.eclipse.n4js.dts/pom.xml
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptLexer.java
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptLexer.tokens
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptParser.java
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptParser.tokens
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptParserBaseListener.java
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptParserBaseVisitor.java
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptParserListener.java
	plugins/org.eclipse.n4js.dts/src-gen-antlr/org/eclipse/n4js/dts/TypeScriptParserVisitor.java
	plugins/org.eclipse.n4js.dts/src/org/eclipse/n4js/dts/MainTypeScriptParserTest.java
	plugins/org.eclipse.n4js.dts/src/org/eclipse/n4js/dts/ManualParseTreeWalker.java
	plugins/org.eclipse.n4js.dts/src/org/eclipse/n4js/dts/ParserContextUtil.java
mmews-n4 added a commit that referenced this issue Feb 1, 2022
…rser (#2306)

* add new project

* specify version

* adjust target platform

* update target platform file due to antlr

* re-generation

* add reference to pom

* remove jar from repo

* ignore lib folder that contains jar files

* update generated antlr parser

* adjust antlr4 version

* modify d.ts grammar

* towards converting parse trees to ASTs

* clean-up and java doc

* fix manifest

* adjust copyright header

* fix pom

* adjust n4js builder to also parse and build d.ts files

* supporting more ts features

* more of the same

* current state

* enable linking, enable source locations

* support JSDoc of d.ts files

* add some Java Doc

* add test to test all d.ts files in definitely typed repo

* convert xtend into java

* some streamlining of dependencies

* make the build great again

* 2nd try to make the builder great again

* repack antlr4 to mitigate version conflict with antlr3

* first try to xpect test d.ts files

* fix tests

* fixed now or not fixed now that is the question

* introduce ast serialization test used for d.ts parser

* add jar test with d.ts and n4js files

* switch from antlr complete to runtime only

* use variable

* try without relocation

* clean-ups

* small grammar changes

* adjust dts test

* small fixes

* add/change tests

* yet another try

* some d.ts grammar changes on members

* fix two scoping issues

* adjust validation message

* fix classpath

* adjust/fix warnings

* fix another test

* add comment

* some clean-ups

* add comment, extend test case

* incorporate feedback

* fix 1-/0-based line numbers

* fix n4jsd-generator and vscode extension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant