A programming language interpreter and compiler for the Dendron language, built with Java.
Dendron is a simple stack-based programming language that supports:
- Variable assignment (
:=) - Arithmetic operations (
+,-,*,/) - Unary operations (negation
_, square root#) - Print statements (
@)
src/dendron/tree/- Parse tree node implementationssrc/dendron/machine/- Virtual machine and instruction setsrc/test/- Test runnerassy/- Assembly code examplessource/- Source code examples
- Parse Tree Construction: Builds abstract syntax trees from token lists
- Interpreter Mode: Direct execution of parse trees
- Compiler Mode: Generates stack-based machine instructions
- Virtual Machine: Executes compiled bytecode
Run the test suite:
java -cp build/classes test.DendronTest <test_directory>Example Dendron programs:
:= x 5
:= y 3
@ + x y
This is a NetBeans project. To build:
ant compile- Java 8
- NetBeans IDE
- Ant build system