-
Notifications
You must be signed in to change notification settings - Fork 21
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
Support ANTLR v4.6 grammars #40
Comments
Could you please let us know ETA for this enhancement? That will be great help. Thanks. |
Still in progress, the introduction of Node.js in ANTLRv4 JavaScript target is bringing additional headache. Hopefully, it will be made publicly available in v0.9.2 by the end of March. |
Would this be with the lexer and parser in separate files or combined? |
Separate files, jut like the current ANTLR v3.3 integration.
|
You need antlr4 in client? I believe the antlr4 runtime https://github.com/antlr/antlr4/blob/master/doc/javascript-target.md allows running with or without nodejs. To use without nodejs the require needs a replacement. https://github.com/letorbi/smoothie/tree/master/standalone is the updated one. I will try it with one of my small experimental apps. Also curious if http://requirejs.org/ would work as well. Since ace has it's own require some coding to have both is needed
I never tried their webpack suggestion but did stand up an antlr4 grammar with ace with require.js |
I agree, the problem v4.6 has a strong depenency to Node.js, and the Honey stuff looks like a hack to make it work with ACE's require.js. I think doing a clean integration with ACE requires to slightly modify the parser/lexer generator templates, which is possible with ANTLR, but as it needs a non negligible ammount of work, we don't want to do it just because it's cool (we've contributed a lot of stuff based on this philosophy so far :), and we'd like to get more feedback from developers before going further. That said, if you make it work the clean way, it would be nice to integrate it to DSL Forge. Please feel free to open a pull request if you are interested. |
Well it ain't happenin' fast via me lol. I get 2807 errors after getting the plugins projects into Eclipse. The pde dependencies are there. Eclipse EE thingy. And I'm not asking for anyone to help me with this. I have great intestinal fortitude for most tasks but for some reason Eclipse is a complete pita to me. One question; how vital is Java and Eclipse to the dsl forge's purposes? Could it be a webapp itself? |
Of course yes, we experimented something like this before, the idea was to setup an ANTLR Web IDE, based on DSL Forge and other open-source projects. We were able to migrate parts of the tooling (Eclipse) to the runtime (the webapp), but the backend was still in Java. |
Ah very interesting. In a branch or other project? |
For now, it's an internal prototype, we did not publish the code as it needs additional care to make it compatible with EPL. We would love to take this direction, but unfortunately, this is not our top priority now, unless there are good reasons. Alternatively, you could get in touch with the professional support if you want to share your usecase/motivations and discuss how to dispatch the efforts. Anyone else interested in this enhancement is more than welcome! |
Hi @amlajmi, I've learned more about what you were referring to ace needing modification. As you know ace is a one line-at-a-time lexer/highlighter and currently isn't built for grammars. I'm looking around to see if anyone is forking and attempting to redo the core of ace and looking at other possibilities of going from antlr v4 to a rich text editor in javascript |
Hi @rimmartin ,
I think it's a good practice to keep the runtime based on a standard Ace distribution, even with the issue of multiline parsing, which is another known problem. Maybe the effort should be done on the Antlr side; changing the template headers to use Ace require instead of Node require would be enough. |
Oh I wasn't proposing forking forever but to put a pull request eventually to them. (Or see if anyone is already forking for this but their fork list is so huge ace's github won't display them) I may try a pull request for using the same ace require to the antlr team as well. As you stated it is two issues. Ace's mode getLineTokens is a limitation that my project can't live with since I'm even employing the multi lexer mode(https://github.com/antlr/antlr4/blob/master/doc/lexer-rules.md, a different concept than ace's language mode concept) capability with antlr v4 |
OK, I see. If you are using multiple lexers, I understand why you may need to process several lines at once, I guess something needs to be done here to make it work with your project. Anyway, let us know if you succeed in rebuilding Antlr v4, this would be awesome :) |
Evaluate the JavaScript target of ANTLR v4.6 and provide support for such grammars in the static web app scenario (no Xtext in the backend).
The text was updated successfully, but these errors were encountered: