Lecture thumbnail 0:00 / 0:00 Of course, in the real world, nobody designs passes by hand unless they’re very simple.
So for the most cases, what you do is you go ahead and you find a powerful tool which actually generates
these passes for you.
And one such tool is called antler.
So Antler is short for another tool for language recognition, and it is a parser generator framework
for translating structured text and even binary files as well.
So antler, if you go to the download page, is actually available for all sorts of languages.
So it has code generation targets in Java C Sharp and lots of other languages besides.
So this is probably the most well known framework out there, although there are more fundamental frameworks
like Lex and Yak that are typically taught in computer science courses.
Now, in addition to the framework, which is essentially just a set of tools which allow you to define
your own files for Lexing and parsing, there are also developer tools, which is another interesting
idea.
So for example, you get a plug in for, let’s say, the IntelliJ IDE.
In this case you also have Eclipse support.
Unfortunately, I don’t see any Visual Studio support here.
So that is something which is available mainly for the JVM language, but essentially you get additional
features like syntax highlighting error checking, that sort of thing.
Incidentally, if you are into Jetbrains products like Resharper or IntelliJ idea, they also come with
plug ins to support their own formats for parser and lexer generation.
And this is useful if you want to, for example, create the support for your own programming language
in an IDE such as Visual Studio in the case.
If you want to support Resharper or IntelliJ idea, if you want to go the JVM route.
So all of these tools are available to use in order to have a more industry grade, shall we say, construction
of lexers and parsers for the various languages.
And they come with examples which actually exemplify the parsers and lexis of typical languages like
C Sharp, for example.
So you can download an example which gives you a parser for some level of C sharp.
I wouldn’t guarantee that it’s every single feature of the language being covered because only serious
tools like Resharper can actually afford to do that.
But you can certainly get a fairly powerful API that way and Antlr is very well documented.
There is even a book from the pragmatic bookshelf, the definitive Antlr Guide, so I can recommend
Antlr as one of a set of tools which are available if you want to generate effectively implement the
interpreter pattern, but do it in a more industrial way rather than hand-rolling your own parsers,
Lexus and so on and so forth.
Play Play Play Stop Start Play information alert