SableCC is an object-oriented framework that generates compilers (and interpreters) in the Java programming language. This framework is based on two fundamental design decisions. Firstly, the framework uses object-oriented techniques to automatically build a strictly-typed abstract syntax tree. Secondly, the framework generates tree-walker classes using an extended version of the visitor design pattern which enables the implementation of actions on the nodes of the abstract syntax tree using inheritance. These two design decisions lead to a tool that supports a shorter development cycle for constructing compilers.

SableCC includes all the following features:

  • Deterministic Finite Automaton (DFA) based lexers with full Unicode support and lexical states.
  • Extended Backus-Naur Form grammar syntax. (Supports the *, ? and + operators).
  • LALR(1) based parsers.
  • Automatic generation of strictly-typed abstract syntax trees.
  • Automatic generation of tree-walker classes.
  • Grammar-specified transformation of concrete syntax trees into abstract syntax trees.
  • Automatic and fully transparent resolution of a subset of LALR(1) conflicts.
  • Intuitive syntax.
  • Clean separation of generated and user-written code.

Licence: Proprietary