DSL & ANTLR

Martin Fawler in his good "Domain Specific Languages" book heavily uses ANTLR to describe topics related to external DSLs. So, I pick the thing up and got to use it. It can generate lexers and parsers in C# (as well as in some other languages - java, c, c++, python). ANTLRWorks is a IDE with syntax highlighting, grammars visualization and even graphic debugger!

What's rather strange and annoying that the latest ANTLR (3.2) and ANTLRWorks (1.4.2) generate wrong C# code - some attribute classes are just not defined in any assemblies. However, as ANTLRWorks 1.4 (with ANTLR 3.2 integrated) generates proper sources, I quite happy with the tool :)

I recommend the DSL book and ANTLR to every senior developer who needs introduce a DSL into his project instead of tedious XML files or handwritten parsers.

Comments

Popular posts from this blog

Haskell: performance

Regular expressions: Rust vs F# vs Scala

Hash maps: Rust, F#, D, Go, Scala