Skip to content

jsfpdn/yatlc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yatlc: yet-another-toy-language compiler

This is a repository for the yatl compiler, a project for a compiler course. yatlc is written in Zig 0.11.0 and uses LLVM.

yatl is an imperative, statically typed, lexically scoped and memory-unsafe language. Sample code can be found in the /examples directory. See DOCS for more information.

yatlc is a single-pass compiler. The recursive descent parser does not explicitely build the abstract syntax tree but directly emits the LLVM IR.

Building yatlc

To build the compiler, run zig build, emitting ./zig-out/bin/yatlc binary.

Running yatlc

To see help, run ./zig-out/bin/yatlc --help.

To compile a yatl program, run ./zig-out/bin/yatlc path/to/file.ytl -o binary_name.

Testing yatlc

To run tests, run zig test src/tests.zig.

When testing an unexpected compiler error, it is helpful to build yatlc with zig build -Doptimize=debug to emit more information during runtime when something happens.

About

yet-another-toy-language compiler

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages