Can I use only GrammarKit to generate both parser and lexer for Intellij Plugin development (custom lang) - intellij-plugin

In the tutorial of custom language support for Intellij Plugin development, it uses GrammarKit to generate the Parser and JFlex (patched) to generate the Lexer.
On this page the author says we can "use the GrammarKit plugin to generate lexer and parser".
Is there a particular reason that JetBrains suggest using JFlex to generate the lexer? How different the process would be if we use GrammarKit to generate both?

Well, I think I know the answer now.
The short answer is NO. It is a little bit complex than that.
Grammar-Kit can be used to generate .flex file and you still need JFlex generator to generate the Java lexer.
Both steps can be done via the context menu.
See here for more info.

Related

How to generate Doxygen documents from DSL language

I want to generate Doxygen document for my DSL(Domain Specific Language). As my DSL language is totally different from C,C++,Java languages.
Basically mine is eclipse plugin project and we are developing IDE for DSL language in that i want to generate Doxygen out of DSL project.
I am very new to Doxygen topic. Please let me know some ideas to proceed.
Note: I have added dependencies so i could generate Doxygen document for Java. The thing i don't know how to do it for my DSL language.
The answer is that it is not possible without hacks. You have three options
Either you add support for your DSL to doxygen and recompile it
Use the INPUT_FILTER option. This will probably fail if your DSL is not an imperative OOP language like Java and C++, because trouble in concept translation.
Do not use doxygen, but another tool which is easier to extend.
If I knew about another tool I would have recommended the third option.

How can I Adapt an already built antlr4 Cobol parser into antlr3 interfaces

I have built an antlr v4 grammar for parsing Cobol files. It is tested and fully functional. Now I need to adapt it to be used within a XText project (with unfortunately uses antlrv3). How can I achieve it without backporting my grammar (and loosing all already built Listeners and Visitors)?
After a few thinking about the problem I am wondering if there is a way to generate antlr v3 interface adaptors to use antlr v4 Parser and Lexer. If so, i could "tweak" XText, so it would be using my already built antlrv4 classes through this adaptor interface.
Anyone already had done something like this?
We are currently working on this problem as well. Is there a possibility to look at your grammar file?

Which ANTLR product do I choose?

I am confused, please do help me out. According to this tutorial, http://www.ibm.com/developerworks/opensource/tutorials/os-ecl-commplgin1/index.html, the first thing I need to do is create a parser and lexer. Okay, I've decided to use ANTLR. Now I've checked ANTLR on the net.. But which kind of ANTLR should I use? ANTLR Works / ANTLR V3 / ANTLR V4? I would like to build an editor after this phase, so I hope the generated parser / lexer / etc can be integrated smoothly with it. What I'm trying to do here actually is create an IDE for my language that can plug-in into Eclipse. Thanks. :)
ANTLR (ANother Tool for Language Recognition) is a tool for generating recognizer of various kinds. There are currently 2 versions out there: v4, the latest one, and v3 the previous one which is still in wide use because of the needed runtimes for different language targets (many haven't been ported to v4 yet).
ANTLR Works is a standalone IDE for developing ANTLR recognizers. There are other tools like Eclipse plugins, a VS plugin etc.
If you are going with Eclipse it sounds natural to me to use the Eclipse plugin for developing the parser for your IDE. You should probably first play a bit with other applications, test parser etc. to get an idea how this works.

Is it possible to extend checkstyle architecture for other languages?

I am looking for static code anaylyzer for some SQL scripts written. I was interested in having a tool that can be extended with my own set of rules.
For static code analysis I see lot of tools for java like checkstyle, PMD etc. which can be extended with custom rules.
Based on some inputs in Static code analysis for new language. Where to start? I decided to use ANTLR. With ANTLR it looks like I have to create lot of code to achieve what I am looking for. So took a look at tools that use ANTLR(Checkstyle is one of them)
I am trying to see if the code already created by Checkstyle can be extended to parse my new grammar file and use all the Check rules that it allows to add
Please let me know if there are other better tools to achieve the same

How to create an Eclipse editor plugin with syntax checking and coloring as fast as possible?

I'm working on a project that requires me to create a series of editors for languages that are quite different. The syntaxes are defined by us.
I'm looking for a solution for this.
Is there a shortcut to take in this problem?
You could use XText:
a framework for development of textual domain specific languages (DSLs).
Just describe your very own DSL using Xtext's simple EBNF grammar language and the generator will create a parser, an AST-meta model (implemented in EMF) as well as a full-featured Eclipse text editor from that.
Alternatives to XText are Rascal or Spoofax, both less popular than XText but interesting for they support more general context-free grammars, among other things. Nice to check out.
If you are looking for a more low level, programmable solution, then Eclipse's IDE Meta-tooling platform is a good choice (IMP).
What IMP gives you is API to connect your existing parsers to Eclipse without much hassle. You need to implement an IParseController interface, to call your parser and ITokenIterator to produce tokens and some other interface to assign fonts to each kind of token.
The aforementioned Rascal and Spoofax are both build on top of IMP.
Not mentioned is DLTK (proposed also in Tutorial regarding the development of a custom Eclipse editor)
There are Ruby, bash that are implemented with it.