Is there any way to visualize .grl extension grammar? - go

I'm studying rule engine for golang and came across a project on github which is based on ANTLR4. I wish to visualize the grammar they're using (.grl extension). Is there any way ?

ANTLR Development Tools Page give you lots of options to help you visualize ANTLR4 grammar file. Most of them (if not all) are in form of IDE plugins. As the developer or grule, I use Goland plugin (same with Intellij) to develop Grule's grammar.

Related

Testing a DSL / Grammar Written With Xtext

I've been set a task of writing a grammar / DSL with XText. It seems reasonably simple. I've been asked to incrementally add rules to the grammar as per a specification. I want to be able to test each new rule that I create.
I have Spring Tool Suite Version: 3.9.2.RELEASE, Build Id: 201712210947, Platform: Eclipse Oxygen.2 (4.7.2).
I've seen textboxes in web browsers that show syntax highlighting based on the validity of the input as per the grammar rules. Also, I'm aware that unit testing is a possibility.
What's the simplest way, minimal fuss, of verifying that the grammar works as expected?
Your help is greatly appreciated.
Thanks in advance,
Ryan
Writing a bunch of unit tests using ParseHelper and ValidationTestHelper should be the most sustainable way to do this.
e.g. https://github.com/eclipse/xtext-eclipse/blob/master/org.eclipse.xtext.xtext.ui.examples/projects/domainmodel/org.eclipse.xtext.example.domainmodel.tests/src/org/eclipse/xtext/example/domainmodel/tests/ValidationTests.xtend
The answer depends on what you mean by 'verifying that the grammar works as expected'. As Christian noted, unit tests using ParseHelper and ValidationTestHelper will tell you if your grammar is being parsed into the correct model and generating the appropriate errors otherwise. If however you want to test things like content assist, syntax higlighting and such, you have to go a little further and write some tests using AbstactEditorTest, AbstractOutlineTest, etc. in the ui.tests package for your Xtext project. After looking at a lot of tutorials I finally went ahead and bought Lorenzo Bettini's book:
Implementing Domain-Specific Languages with Xtext and Xtend - Second Edition
It was a great help in understanding Xtext, and how to test a grammar as you create it.

Natural Language Process using SharpNLP with a sample

I am really new to C# and want to do a NLP project using SharpNLP. I know Currently it provides the following NLP tools:
sentence splitter
tokenizer
part-of-speech tagger
chunker
parser
name finder
coreference tool
interface to the WordNet lexical database
I tried several examples (i have those .nbin models) but failed to integrate the SharNLP tools to VS 2015. Can anyone give some guidance or samples to use this sharpNLP tool with VS.
Thanks
I have successfully created a sample project for newbies. You can get the project from the following link. PS:Please change the nbin file path as your's computer file path. Hope this will help.
Click HERE for Sample Project or as below.
https://drive.google.com/file/d/0B3XcMZLArSF1UURzODRiVmE0RUE/view?usp=sharing

Whats the best way to get started on a SonarQube plugin for a new language

I want to develop a sonarqube plugin for analyzing a new language. The language's grammar is developed. There is a parser available for it. The parser throws out an AST.
I want to write visitors for this AST and then develop rules. Is there a sample plugin(I saw the github sonar-examples but I didnt find it to be clear) or good documentation on what steps I should take?
Guidance from people who have developed Sonarqube plugins for languages much appreciated!
This Supporting New Languages outline should get you started. Beyond that, go to the Google Group to ask specific questions.

Advantage of using SideWaffle to create templates compared to writing a VSIX

I understand that SideWaffle provides a bunch of community-driven templates for web developers.
What I don't get is whether there is an advantage to using SideWaffle for writing my own templates for corporate use. The instructions provided, eg:
https://github.com/ligershark/side-waffle/wiki/How-SideWaffle-Works
https://github.com/ligershark/side-waffle/wiki/How-to-create-a-project-template
https://github.com/ligershark/side-waffle/wiki/How-to-create-a-multi-project-template
don't seem any easier than just writing a VSIX package (eg http://msdn.microsoft.com/en-us/library/ms185308.aspx ).
Am I missing something? As a template author, what does SideWaffle do for me?

Syntax higlighters for RPG And CLP that generate HTML and/or RTF?

I found that ToHtml.com has a nice bunch of syntax highlightes that generate HTML.
But they don't include RPG or CLP.
So: anyone who knows a syntax highlighter for RPG or/and CLP that generates either HTML or RTF?
Some more references
the custom brushes for SyntaxHighlighter does display RPG, but it doesn't generate HTML that you can copy to the clipboard; SyntaxHighlighterModified does, but it is hard to integrate custom brushes like the RPG one
GeSHi, BlogTrog, CodeHtmlEr and Gist do not do CLP nor RPG
I've had the same need for awhile and finally bit the bullet and created an RPG mode for the Ace Editor. You can see it here. I also modified the Ace "Tomorrow" theme to have more RPG features.
I was going to fork/pull the Ace Editor and add this, but they have a more laborious contribution scenario so I haven't taken the time to do that yet.
Been using it for browser-based code documentation. See below.
EDIT:
Another option is using VSCode. They added a feature to the latest version that allows copying the source from VSCode and pasting it into the medium of your choice (presentation, email, etc) fully marked up with syntax coloring. Couple that with the VSCode RPG Syntax plugin and you have a winning solution.
We would have to create the highlighters. I haven't looked and any in dept to see how complicated it would would be. Most of them are open-source and would gladly accept the new languages.

Resources