LLK 0.4.2

Release notes

LLK Changes

Grammar

  • NEW - Added grammar option VisitorException = "string" for parser and treeparser to specify name of exception that the generated visitor.visit() methods should throws. Default is null, ie. throws no execption.
  • NEW - Added grammar option PublicConstructor = boolean for lexer, parser and treeparser to specify if code generator should generate a public or private constructor.

Implementation

  • CHANGE - ILLKNode.clone(), ILLKToken.clone(), LLKNode.clone(), LLKToken.clone() and all AST nodes should support clone() and no longer throws a CloneNotSupportedException. A RuntimeException would be thrown instead if clone() failed.
  • CHANGE - ISourceLocation.clone(), SourceLocation.clone(), IntList.clone() no longer throws a CloneNotSupportedException. A RuntimeException would be thrown if clone() failed.
  • CHANGE - All interfaces no longer extends Cloneable, concrete class should explicitly implements the Cloneable interface to support clone().
  • CHANGE - SourceLocator.toFile(String path, int linear, int line, Object data) now use previous filepath as filepath if input path argument is null.
  • CHANGE - When grammar option Multi=true, LLK now generate node files with default constructor that hard coded the node type instead of constructor that require a node type id.
  • FIXED - When grammar option Multi=false, LLK now create LLKNode with distinct type id although there are no distinct node classes for the nodes.
  • NEW - Added
    void setEnabled(boolean yes);
    boolean isEnabled();
    ILLKToken IDirectiveHandler.handle(ILLKToken directive)
    
    method that can be used to handle directives other than conditional directives.
  • NEW - Added Object ILLKMain.getOpt(String key) and Object SimpleLLKMain.getOpt(String key).
  • NEW - Lexer and Parser no longer has import java.util.* automatically since they are not used outside user code. If they are used in user code, user should add import statement for that.
  • NEW - Added ILLKLexer.llkSetTokenStart(int offset) method.
  • NEW - Added ILLKNode.addAll(ILLKNode list).
  • NEW - Added -spath options that specified a classpath style search path for looking up files that would not be regenerated if file exists (eg. support files, node files, ... etc.). Files that are always regenerated (eg. the visitor) would lookup and generated in the -dir or -sdir locations only.
  • CHANGE - SimpleLLKMain.getOptBool(String name) now return Boolean.valueOf(value) if value of the options is of type String instead of simply return true whenever the value is not null.
  • Removed some unused debugging stuffs, in particular DebugSupport.javam ISemanticPredictListener.java, ISyntacticPredictListener.java, ... etc.

Bugs

  • FIXED - NodeFileGenerator generated header without // comment prefix.
  • FIXED - ISourceLocator.FileInfo methods are now public.
  • FIXED - LLKNode.java template.

Sample Grammar Changes

llk-java5

  • NEW - Added JavaCodeFormatter stuffs.

llk-csharp

  • FIXED - partial not as a keyword.
  • CHANGE - No longer use get, set, add, remove as context dependent keywords. Now use semantic predict to check for matching identifiers.
  • Splitted all model building and conditional parsing stuffs to the llk-csharp-model project. llk-csharp project now host a minimal CSharp 2.0 parser.

llk-csharp-model

  • NEW - Spinned off from llk-csharp project. This project host stuffs for conditional parsing and building of a merged AST model for CSharp 2.0 source. There is also a CSharp code formatter.
    DISCLAIMER: This project is still experimental and there is no guarantee that it would reach a mature state.

Requirement to run

See release 0.4.1 for details

Requirement to run generated parsers

See release 0.4.1 for details.

Requirement to compile

See release 0.4.1 for details.

Installation and Running

See release 0.4.1 for details.

Status and plans