ANTLR4 what does ATN stand for? - antlr

I'm surprised this is not explained anywhere on the ANTLR website nor in any of the documentation, but what does ATN (not ANT) stand for? Knowing what the acronym stands for would help me understand the role of the ATN, ATNSimulator, etc. components of the library. Can anyone clear this up for me?

Augmented Transition Networks, the description in the context of ANTLR could be found e.g. here
http://www.antlr.org/papers/LL-star-PLDI11.pdf

Related

Focus language grammar

I need to extract some info from a list of mainframe scripts written in focus language.
I'm trying to write a java program for parsing source code. Due to the name of the language it is difficult to find any useful information on the internet. Maybe someone know if exist a grammar for this language on internet(for example for antlr4) or maybe an implemented lexer.
Thanks in advance for any response!
Follow this link to the Focus Developer Manuals, then click on the left side to open the list of manuals available.
Note: The link to "FOCUS Developer Manuals" at the bottom of the the WikiPedia page was http://... instead of https://..., and resulted in a connection refused error. I have corrected the Wiki page.
There is a curated list of ANTLR grammars here. Unfortunately, there is no grammar for the focus product.
Not all authors make their grammars available at the above link, you might try searching github and other code repositories.

antlr tooling recommendations

I'm trying to use Antlr4.5 to generate a lexer/parser (in C#) for a SQL grammar. What sort of tools would you recommend in order to write the grammar and to test it?
I'm trying antlrworks2 but I find it a bit confusing (can't find a way to enter sample text and see the parse tree - not sure if it's not there or I'm blind or just plain dumb, but I'm pretty sure antlrworks v1 had such a feature).
The Visual Studio VSIX plugin from Sam Harwell looks great but it also confuses the heck out of me, the lexer and parser get generated in the obj\ folder instead of inside the project. Also, it won't help me much when writing the grammar as far as showing me a syntax diagram, letting me try out the grammar with sample text and so on.
I'm pretty confident that antlr is a good way to go, but I'm really not sure about the tooling and the approach I should take when defining and testing my grammar. I would appreciate any suggestions.
My question wasn't brilliant because tooling is pretty independent of the antlr target language, but FWIW I ended up using the free version of IntelliJ IDEA with the antlr plugin. I started liking IntelliJ, it's very good. The antl plugin is also very good for the most part, it a bit rough around the edges here and there, but all the important stuff works very well and in general it's amazingly useful.

Where can I find actual ANTLR Objective-C examples?

There are pages that indicate ANTLR works with Objective-C, but I can find no documentation or examples of actually using ANTLR with an Objective-C target. I even dug through the source code and have found no examples.
Any guidance, anyone?
The parser generator that emits Objective-C code is old and doesn't work. You'll have to use the C generator, and the C generator's documentation is worse than useless.

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.

Creating your own language

If I were looking to create my own language are there any tools that would help me along? I have heard of yacc but I'm wondering how I would implement features that I want in the language.
Closely related questions (all taken by searching on [compiler] on stackoverflow):
Learning Resources on Parsers, Interpreters, and Compilers
Learning to write a compiler
Constructing a simple interpreter
...
And similar topics (from the same search):
Bootstrapping a language
How much of the compiler should we know?
Writing a compiler in its own language
...
Edit: I know the stackoverflow related question search isn't what we'd like it to be, but
did we really need the nth iteration of this topic? Meh!
The first tool I would recommend is the Dragon Book. That is the reference for building compilers. Designing a language is no easy task, implementing it is even more difficult. The dragon book helps there. The book even reference to the standard unix tools lex and yacc. The gnu equivalent tools are called flex and bison. They both generate lexer and parser. There exist also more modern tools for generating lexer and parser, e.g. for java there are ANTLR (I also remember javacc and CUP, but I used myself only ANTLR). The fact that ANTLR combines parser and lexer and that eclipse plugin is availabe make it very comfortable to use. But to compare them, the type of parser you need, and know for what you need them, you should read the Dragon book. There are also other things you have to consider, like runtime environment, programming paradigm, ....
If you have already certain design ideas and need help for a certain step or detail the anwsers could be more helpful.
ANTLR is a very nice parser generator written in Java. There's a terrific book available, too.
I like Flex (Fast Lex) [Lexical scanner]
and Bison (A Hairy Yacc) [Yet another compiler compiler]
Both are free and available on all *NIX installations. For Windows just install cygwin.
But I old school.
By using these tools you can also find the lex rules and yacc gramers for a lot of popular languages on the internet. Thus providing you with a quick way to get up and running and then you can customize the grammers as you go.
Example: Arithmetic expression handling [order of precedence etc is a done to death problem] you can quickly get the grammer for this from the web.
An alternative to think about is to write a front-end extension to GCC.
Non Trivial but if you want a compiled language it saves a lot of work in the code generation section (you will still need to know love and understand flex/bison).
I never finished the complete language, I had used rply and llvmlite implements a simple foxbase language, in https://github.com/acekingke/foxbase_compiler
so if you want use python, rply or llvmlite is helpful.
if you want use golang, goyacc maybe useful. But you should write a lexical analyzer by hard coding by hand. Or you can use https://github.com/acekingke/lexergo to simplify it.