LLK 0.6

Release notes

LLK Changes

The major change that may given to many troubles is change in util project CLIUtil that now require to use -- for long options as in --longopt and allow multiple short options as in -aeiou.

Grammar

  • CHANGE - Renamed lexer grammar option LexerTokenUseText to TokenUseText.
  • NEW - Added lexer grammar option TokenUseIntern. When it is on and TokenUseText options is on, the llkCreateToken methods:
        llkCreateToken(int type);
        llkCreateToken(int type, int start, int end);
        llkCreateToken(int type, int start, int end, Object data);
    
    automatically intern all the literal token text and token text that is 8 characters or less using an SingletonSet. Default is disabled. This is also an String llkIntern(String s) method that can be used to intern any text, eg:
        llkCreateToken(type, start, end, llkIntern(text), null);
    

Implementation

  • CHANGE - Code generator no longer add final modifier to the generated rule methods.

Support Projects Changes

llk-share

  • NEW - Added ILLKTreeParser.
  • CHANGE - Renamed ILLKNode.getModifier() and ILLKNode.setModifier(int mod) to getModifiers() and setModifiers(int mod).
  • CHANGE - ILLKNode now extends List<ILLKNode> although LLKNode.template left most extra methods in the List interface as unsupported.
  • CHANGE - Removed ILLKMain.exit() and SimpleLLKMain.exit() method which is not a good practice, throw a RuntimeException instead.
  • CHANGE - SimpleLLKMain.getFileContent(String fpath, Charset charset) now read from System.in if file path is "-".

llk-share-formatter

  • FIXED - emitDotSuffix() that emitted extra spaces when oneliner fails.

util

  • CHANGE - Getopt support stuffs are moved from the Msg class to the CLIUtil class.
  • CHANGE - Long options now must be prefixed by "--" and multiple short options can now be specified in single option (eg. -abc stands for -a -b -c). This affects all command line utilities in the LLK and support projects.
  • CHANGE- TextUtil.splitLines() and TextUtil.removeFirstLine() now ignore \\ escaped CR and LF.
  • CHANGE - Refactored TextUtil.readFile() methods to FileUtil.asChars(), ... etc. methods.

fireant

  • See change for fireant project here.

Sample Grammar Changes

General

llk-java-model

  • NEW - Added formatter options:
    • compactStatementBlock - remove blank lines between statements.
    • compactCloseBrace - put multiple consecutive close braces on the same line.
  • FIXED - Parser grammar to accept interface, enum declarations inside compound statements.
  • FIXED - Special tokens eg. CPPCOMMENT that follows on the same line as end of a multi-line comment is not formatted correctly.
  • FIXED - Fixed problem that blank lines between statements in constructor is not preserved.

llk-csharp-model

  • NEW - Added formatter options:
    • compactStatementBlock - remove blank lines between statements.
    • compactCloseBrace - put multiple consecutive close braces on the same line.
  • FIXED - Special tokens eg. CPPCOMMENT that follows on the same line as end of a multi-line comment is not formatted correctly.

llk-html

  • CHANGE - End tag for empty tag (eg. link) is now ignored and generate warnings instead of generating end tag mismatch error.
  • CHANGE - Added format style BLOCK1 which format the block tag as oneliner only if it has no more than one child (eg. for TR tag).

llk-xhtml

  • CHANGE - XHTML tag not lower case is now a warning instead of error.
  • CHANGE - Added format style BLOCK1 which format the block tag as oneliner only if it has no more than one child (eg. for TR tag).

llk-xml

  • CHANGE - Moved XMLSpaceUtil.java to util project.
  • CHANGE - XMLFormatter now would not put more than one element on the same line and only try to format leaf elements as oneliner.

Requirements

Requirements to run LLK

See v0.5 release notes for details.

Requirement to run generated parsers

Same as requirement to run LLK above.

Requirement to compile LLK

See v0.5 release notes for details.

Running the binary

See v0.5 release notes for details.

Compiling the source

This version is developed in Eclipse 3.1.2 Linux/GTK. Building is now easier with the fireant.sh (fireant.bat for DOS) script in the llk-fireant project directory:
  • Make sure org.apache.ant plugin from Eclipse exists at the proper location. See v0.5 release note for details.
  • Unpack the source distribution to the workspace and the binary distribution into the ext/ directory.
  • Make sure environment variables JAVA_HOME and ECLIPSE_HOME are pointing to the correct JDK and Eclipse installations. Then from the llk-fireant project directory, run (for Linux):
        bash ./fireant.sh Build
        bash ./fireant.sh Install
    
    or for DOS
        fireant.bat Build
        fireant.bat Install
    
    and it is done.
If you need to work with the source code, use Eclipse and see v0.5 release notes for details.

Status and plans