Main Page

From Laja
Jump to: navigation, search

What Laja is

  • Laja is a code generator.
  • Laja is a parser generator that uses the code generator and generates parsers for Java.
  • Laja supports Context Driven Development (CDD) where the target language is Java.
  • It should be possible to run Laja on most variants of Windows, Unix/Linux.
  • Laja is Open Source, using GNU General Publi License version 3.0.
  • Laja is written to be used by developers with easy of use as the primary goal. Generating text files or creating DSL's should be both easy and fun!
  • Laja is flexible and extendible:
    • Jar files can be added just by putting them in directory LAJA_HOME/lib.
    • Support for Groovy.
  • Laja is written in Java.

The code generator

  • Has support for creating files out of the box, no add-ons is needed.
  • Is integrated with Groovy. You can write Groovy code to gather data to be used by your templates.
  • Templates used to generate text files has support for indentation for increased readability, e.g:
#set (separator = "")

#write "output.txt"
  #foreach (x in ["one", "two", "three"])
    #set (separator=", ")

instead of:

#set (separator = "")

#write "output.txt"
#foreach (x in ["one", "two", "three"])
#set (separator=", ")

The parser generator

Laja is a two-phase scannerless, top-down, backtracking parser generator with support for runtime grammar rules. One of the main ideas of the parser generator has been to introduce a more object-oriented approach when working with parsing. Another idea was to make it as easy as possible to use without sacrificing functionality.

  • With little practice you will be able to create your own external DSLs, even complex ones.
  • Spaces and comments are handled the same way as other grammar rules, with no exceptions.
  • No configuration files (e.g XML files) is needed when generating a parser.
  • You can control the output that will come out from the parsing. This is done by mapping the grammar rules into object structures, which is both simple and powerful.
  • The generated parser code and the implementing output classes is separated, which is good!
  • You will get compilation failures if the implementing output classes does not follow the interface defined in the grammar, which makes it easy to implement the output classes.
  • Laja is prepared to support more languages than Java in the future.


Context Driven Development (CDD) brings the concept context to object orientation and has its own wiki at

This website is a Wiki using MediaWiki.

Laja is developed by Joakim Tengstrand

Feel free to contact me at: laja.mailbox@g-m-a-i-l.c-o-m (remove all -)