Portrait of Edmund

Edmund Kapusniak

Welcome to my web site. I have released several hobby projects as open source in the hope that someone will find them useful.

You can contact me.

Apollua

Apollua is an implementation of the Lua 5.1 programming language written in C#. It does not use any unsafe code, and is faithful to the C implementation, with the VM supporting the same bytecode format.

In my implementation, all values, even those of primitive types, are boxed into a subclass of LuaValue, allowing the interpreter to treat every object in exactly the same way. Clients of the library can add their own subclasses to add new types to the language. Benchmarks suggest that the performance loss involved in manipulating boxed objects instead of value types is not great. Future improvements would instead focus on adding a compiler directly to CLR bytecode, getting rid of the VM overhead. Coroutines could be supported in the manner described in this paper.

It currently supports only a subset of the Lua standard library.

Obtain the code through anonymous SVN:

	svn co http://svn.birotanker.com/Apollua Apollua

GrammarC

I present GrammarC, a parser generator similar to yacc, bison, antlr, or elkhound. It also includes a lexer generation mode which does a job similar to flex. I was inspired by these tools to produce one of my own. I wanted a tool that would support extended grammar syntax directly, produce readable C++ output, and support pull parsing instead of the more traditional semantic actions. GrammarC produces GLC(1) parsers rather than the more usual GLR(1) or LL(*).

The parsers this tool generates are pull parsers, meaning that there are no semantic actions or callbacks specified in the grammar. Instead the client code can traverse the parse tree in two ways. First, it can drive the parse process incrementally by requesting productions one-by-one. Second, the parser can generating the entire parse tree for a particular production. This second option allows the analysis of ambiguous productions - each alternative derivation is specified as its own sub-tree.

This decouples the grammar from your program and allows reuse of the same grammar in multiple tools. Additionally, the left-corner parsing approach means that only the minimum section of the parse tree is kept in memory.

Obtain the code through anonymous SVN:

	svn co http://svn.birotanker.com/Grammar Grammar

CppParser

C++ is extremely difficult to parse. GCC, elsa, and clang are the only open source projects I know of which attempt to analyse it, each of which is at various stages of completion. CppParser is my attempt.

Parsing real programming languages is hard. Most real-world programming languages have various ambiguities that make them very difficult to parse with a deterministic grammar. Traditionally, C and C++ assume a lexer hack to feed back information about identifiers to the parser, which means that symbol table construction has to happen at the same time as syntax analysis. By using GrammarC, which supports ambiguous grammars, I can remove the need for this lexer hack by returning a parse forest of possible parse trees. Those alternatives that are invalid can be pruned by subsequent translation phases. This approach is similar to that taken by elsa.

It has only been tested on very simple inputs, and the semantic analysis phase, including ambiguity resolution, is very primitive. I hope someone finds it useful despite these limitations.

Obtain the code through anonymous SVN:

	svn co http://svn.birotanker.com/Cpp Cpp