Introduction for developers
GeLB
is a community project.
If you want to join us, this guide is for you!
#
How you can contributeTODO docs (you don't need to be a programmer -- or you can be "just" a GeLB programmer :) in order to contribute) or code (for contributing to the compiler)
#
General recommendationsIf you want to contribute to GeLB
, we recommend to:
- [first] Familiarize yourself with
GeLB
, by reading this manual, - Read the TODO-linkto-ARCHITECTURE.md file, to get a high-level overview of how GeLB works under the hood.
- Head over to the TODO-linkto-devguide, for more developer-oriented information.
#
Implementation languagesMost of the code (especially the gelbc
compiler) is implemented in Python
(and distributed as the gelb
package on PyPI).
Code written in other languages is usually related to editor/IDE plugins,
which make working with .gelb
files much more pleasant.
:::todo Integrate in dev-docs
ANTLR4 context objects record everything we know about the recognition of a phrase by a rule [REF: A4 book, pp. 29, Sec. 2.4]
:::
#
Annotated list of referencesPrior knowledge about compilers is great, but not a requirement for you to be able to contribute to the development of GeLB. However, if you want to contribute to the compiler, you will want to become accustomed to some of the basic concepts. The following list of references should serve as a good start:
Parr, Terence. The definitive ANTLR 4 reference. Pragmatic Bookshelf, 2013.
Since
gelbc
is based onANTLR4
, this is the first reference we recommend. In particular, pay attention to:- the Visitor mechanism, which is used for constructing the initial abstract syntax tree (AST), and to
- the Listener mechanism, which is used for validating the syntax of GeLB programs.
Unfortunately, this reference does not focus on compiler design, which is why the next reference (also by Terence Parr) is still valuable.
Parr, Terence. Language implementation patterns: create your own domain-specific and general programming languages. Pragmatic Bookshelf, 2009
Although the examples in this book are for
ANTLR3
, it is worth reading for its (low-theory) explanations of compiler design and internals.Tomassetti book
Dragon book (2ed)
Stephen A. Edwards' "Programming Languages and Translators" lectures notes (COMW W4115, Columbia University, Fall 2003)