Menu

LPG 2.0.21 released

Changes in 2.0.21:

Generator:
- Now expands the file name and line number macros relative to the source file where they're
being interpolated, so that #line comments cite the correct file.
- In generated code, when printing a file path (say, for a use of the file name macro), trim the
file path if its prefix matches one of the include-directory arguments, or the directory-prefix.
If a perfect prefix match could not be found, then the file name is expressed relative to the
directory-prefix.
- Generated AbstractAstList's now implement java.util.List, which has a richer API than
those classes previously had. As a result, they can now be passed to other clients that
need a List/Collection, and can be used with the Java 5 "foreach" construct.
- The generator now provides a "-version" option for tools to automatically detect the LPG
generator version at runtime.

Java templates/include files:
- Added #line comments to most of the macros that were missing them, so that the
generated Java code is properly attributed to the right source files.
- Added support to the various lexer templates for incremental lexing.
- The parser class template now provides a macro, $super_class, to specify the superclass of the generated parser class.

Java runtime:
- Removed a line from LexParser.parseActions() that caused a problem for incremental
lexing via calls to LexParser.parseCharacters(Monitor, int, int).
- Added new class SegmentedTuple for use in the implementation of the recently-introduced
List-based API on certain auto-generated AST classes.
- Fixed LexStream.getLineNumberOfCharAt() and LexStream.getLineOffset(): the invariant
getLineOffset(getLineNumberOfCharAt(0)) == 0 didn't used to hold; now it does.

Posted by Robert Fuhrer 2011-02-28

Log in to post a comment.