LLK Release 0.1

release notes

Changes

  • Initial beta release.
  • Package is usable and indeed working in generating parser for LLK itself and parser for C# used in Black-sun CSharp editor.

Bugs

Some major known bugs or limitations:
  • Tree parser support is incomplete and not workable.
  • Creating nodes through node factory (Grammar options NodeFactory) is not suported yet.
  • DefaultErrorHandler although working for some simple cases, is not completed yet.
  • Error reporting (and warning) is primitive. However, since each rule is a method, the stack trace should be sufficient to diagnose most errors.

Requirement

The current distribution is developed and tested only in Linux. Since it is written completely in Java, it may work in other environment. These are packages required and being tested on. There are a number of support packages required that are bundled (with source) in the binary and source distribution:

Installation and Running

Running the binary

LLK distribution include the ready to run binary, port80_llk.jar, in the ext/ directory. The binary for the main program (org.port80.llk.impl.LLKMain) should run without Eclipse provided the jar files to Xerces, Jakarta-oro, getopt, port80_util.jar and the port80_llk.jar package is in the classpath. To run the binary, for example:
java -classpath $(ExtDir):$(CLASSPATH) \
    org.port80.llk.impl.LLKMain \
    -trim -o $(OutputDir) \
    LLK.ll

Compiling from the source

The package is developed in Eclipse. As such all makefiles and settings works only under Eclipse (v2.1.1 GTK for Linux).

The makefiles assumed the following directory structure:

eclipse/
    plugins/
        ...
ext/
    getopt.jar
    Jakarta-oro-2.0.6.jar
    port80_util.jar
    port80_llk.jar
    ...
llk/
    src/
    bin/
    ...
where eclipse/ is the Eclipse installation. ext/ is the directory that contains the support libraries (eg. Jakarta-oro). llk/ is the project directory for the source distribution.

To build from the source:

  • Setup directory structure as above.
  • Add ECLIPSE_HOME classpath variable at Eclipse menu Window/Preferences/Java/Classpath Variables and point it to the {Workspace}/eclipse/ directory.
  • Inside the llk/ project directory, run make check and check that the directories are correct. If not, edit llk/Makefile.
  • Import the llk project with Import.../Existing project into Workspace
  • Setup the build path in the project Properties/Java Build Path page. Add the following libraries:
    • ext/getopt.jar
    • ext/Jakarta-oro-2.0.6.jar
    • ext/port80_util.jar
    • ECLIPSE_HOME/plugins/org.apache/xerces_4.0.13/xercesImpl.jar
    • ECLIPSE_HOME/plugins/org.apache/xerces_4.0.13/xmlParserAPIs.jar
    • ECLIPSE_HOME/plugins/org.apache/org.junit_3.8.1/junit.jar
  • Now when the project is rebuilt, it should build correctly, provided you have not touched the grammar file LLK.ll.
  • Inside the llk/ directory, run
    make install
    would create (and overwrite) the port80_llk.jar file in the ext/ directory.

Rebuilding the LLK parser

LLK is self hosting, ie. it generate the LLK parser itself. To regenerate the LLKLexer.java and LLKParser.java from LLK.ll, a LLK binary is required (one is included in the source distribution under ext/).
  • Make sure you setup the correct environment as described in Compiling the source distribution section above.
  • Make sure ext/port80_llk.jar is there.
  • Modify or touch LLK.ll.
  • If you have the Black-sun builder plugin installed, any changes to LLK.ll would trigger a rebuild of LLKParser.java. Otherwise inside the llk/ project directory, run:
    make llkparser

NOTE: All web pages and documents are available in source distribution under doc/release/ directory.

Status and plans

The code is considered to be beta quality. It is usable for some real life work. However, it is by no means thoroughly tested.

For now, there is plan to port the Java and GnuC grammar in ANTLR to LLK, in addition to maintain the C# grammar used in the Black-sun C# editor. Preliminary version of the Java and GnuC grammar is available under llk-java and llk-gnuc projects in the source distribution.