Related articles |
---|
Announcing MetaCC framework 0.2 with forked parsing leszekpi@megapolis.pl (Leszek Piotrowicz) (2007-03-01) |
From: | Leszek Piotrowicz <leszekpi@megapolis.pl> |
Newsgroups: | comp.compilers |
Date: | 1 Mar 2007 01:09:04 -0500 |
Organization: | tp.internet - http://www.tpi.pl/ |
Keywords: | parse, available |
Posted-Date: | 01 Mar 2007 01:09:04 EST |
Announcing MetaCC framework 0.2
MetaCC is a framework for compiler construction implemented in Java.
It is available for download from http://metacc.sourceforge.net
The ultimate goal of MetaCC framework is to make a programming language
(whatever one is processed by the framework) extendable.
Extendable means that the language itself or a programming environment
can influence language tokenizing, parsing, semantic analysis and other
phases of its processing. The influence can manifest in example in
adding or modifying language constructions on the fly, during compile
time.
To reach this goal rules for tokenizing, parsing, code generation cannot
be static or precompiled by some other tool, but instead they must be
dynamic and embeeddable into the language. Rich metainformation (that is
information about compiler environment) must be available and
configurable by the programming environment.
For now lexer and parser generators are available. Lexer is based on
DFA algorithm and parser uses LALR(1) algorithm. Both of them construct
their tables dynamically on the fly.
In version 0.2 both generation and runtime performance was significantly
improved. Lexer and parser api was cleaned. Lexer was rewritten from
scratch and now creates direct DFA without intermediate NFA.
The most important change is introduction of "FORKED PARSING". Forked
parsing allows to parse ambiguous (non LALR(1)) grammars. Parser stack
is "forked" in the place where shift/reduce or reduce/reduce conflict
occurs and both alternatives are parsed "in parallel". One of them
eventually ends with error and is silently removed. Using of this
feature requires that parser actions which may be executed
in parallel are side-effect free.
As an example java5 lexer and parser definitions are provided.
Together they correctly parse all java5 library sources.
Leszek Piotrowicz
Return to the
comp.compilers page.
Search the
comp.compilers archives again.