kiama 1.2.0
The Kiama team are pleased to bring you the next release of the library.
This release includes some breaking changes that improve the reliability and safety of Kiama-based applications. All users should take careful note of these changes.
In addition, there are quite a few new features and bug fixes, most notably a new chain decorator for threading attributes through a tree, support for minimal parenthesisation in pretty printing, and callback support for rewriting. A new version of the Oberon-0 example shows how Kiama can be used in an extensible, modular way.
Breaking changes
General
- Kiama's group ID is now
com.googlecode.kiamainstead ofcom.googlecodeto fit with Maven Central policies. In sbt you can use it with the following dependency.
"com.googlecode.kiama" %% "kiama" % "1.2.0"- Kiama's group ID is now
- Basic attributes are now normal functions, not partial functions, so pattern match completion checking works on their definitions. This change may require some fixes to declared types and may reveal incompleteness that was hidden before.
- Node properties in
Attributablesuch asparentare not automatically set any more. If you want to use them, first call theAttribution.initTreemethod, passing the root of your tree. This change removes a set of bad behaviours caused by setting these properties at node construction time. Attributabledoes not extendscala.util.parsing.input.Positionalany more, since it didn't use it.
- Pretty printing library moved to new
org.kiama.outputpackage fromorg.kiama.util.
- Pretty printing library moved to new
New features
- Add
chaindecorator for threading attributes through a tree. - Non-circular attributes now have a
resetmethod which clears their cache. - Add
cloneanddeepclonesupport toAttributable. Cloning is important if you intend to calculate some attributes on a structure that would otherwise contain duplicate occurrences of nodes. - The current node is now reported in the exception thrown when a cycle is detected during calculation of a non-circular attribute.
- Support for node properties of tuple,
SomeandGenTraversablechildren.
- Add
- Add
ParenPrettyPrintertrait for pretty-printing with minimal parenthesisation. Updates to
PrettyPrinter- Make conversions from
StringandCharto pretty-printerDoctype implicit. - Split
listcombinator intolist(for lists of values) andplist(for list of pretty printables). - Add
hsep,vsepandfillsepvariants that allow a separator to be given. productcombinator now does something sensible for vectors, maps and tuples.- Add
ltermcombinator for lists with terminated elements.
- Make conversions from
- Add
- Add
logandlogfailcombinators toRewriterto improve debugging of rewriting phases. - Add
CallbackRewriterextension ofRewriterthat adds callbacks to various rewriting operations. The callback provides both the node that is being rewritten and the node to which it is being rewritten. - Add
PositionalRewriterextension ofCallbackRewriterthat automatically copies positions when rewritingscala.util.parsing.input.Positionalnodes .
- Add
- Add
ParserUtilitiestrait containing helper support for using Scala combinator parsers, most notably implicit conversions so thatcaseclassconstructors can take "tilde" tuples, thereby eliminating a lot of the pattern matching that you normally need to do in parser actions. - Add
WhitespaceParsertrait which allows white space to be defined using a parser instead of a regular expression when usingRegexParsersandPackratParsers. This capability is useful when white space contains comments that are nestable. - Add
Patternsmodule to contain useful extractors (justHasParentforAttributablenow).
- Add
Examples
- Add Oberon-0 example including attribution, rewriting and pretty-printing, plus assembly of processors from smaller components in a modular fashion.
- Add small JSON example.
- 101companies example now includes some attribution.
Testing
- Add tests to improve code coverage.
- Allow tests to capture output during command-line argument processing.
General
- Move to Scala 2.9.1, ScalaTest 1.7.1, JLine 1.0 and sbt 0.11.
- Add console import commands to
build.sbtso that interactive testing is easier.
Fixes
- Use while loops instead of for comprehensions to iterate over children in generic traversal combinators to gain significant speed-up.
- The
Productnode duplication operation now caches constructors to reduce reflection overhead.
Messaging.reportnow defaults itsEmitterargument to standard output.
Examples
- Ignore lines that only contain white space in REPLs.
Testing
- Change some test names so that bits don't disappear when run by Eclipse JUnit runner.
- Make a better split between basic code and test code so that normal compile doesn't need the test libraries.
General
- Publish in Sonatype OSS repository (and hence Maven Central) instead of on
www.scala-tools.org. - API documentation on
http://kiama.googlecode.comnow includes links to source. - Example and test API documentation is now published as well.
- Add tree-oriented navigation links to the wiki documentation.
- Many other small bug fixes, improvements and documentation clarifications.
- Publish in Sonatype OSS repository (and hence Maven Central) instead of on
Kiama is a Scala library for language processing including attribute grammars, term rewriting, abstract state machines and pretty printing.
