-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from zirco-lang/docs
add documentation to most compiler functions
- Loading branch information
Showing
10 changed files
with
169 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
# zrc | ||
# The Zirco Programming Language | ||
|
||
This is the main source code repository for `zrc`, the compiler of the Zirco programming language. | ||
|
||
The compiler is written solely in Rust. | ||
|
||
To compile a Zirco file, you can use: | ||
|
||
`cargo run -- ./FILE.zr` | ||
to llvm ir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# `zrc` --- the official Zirco compiler | ||
|
||
This crate serves as the frontend and binary for `zrc`, the official compiler for the Zirco | ||
programming language. | ||
|
||
When running `zrc`, you simply invoke it with one argument, which is the file to compile. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
//! The Zirco compiler | ||
#![doc=include_str!("../README.md")] | ||
#![warn( | ||
clippy::cargo, | ||
clippy::nursery, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Parser for the Zirco programming language | ||
|
||
This crate consists of a few modules that all wrap around the first step in the compilation process: | ||
Converting the input source file to something machine-processable. | ||
|
||
It contains the lexer, parser, and abstract syntax tree representation for the compiler. | ||
|
||
The majority of your interaction with this crate will be through the [`parser::parse_program`] function and the structures present within the [`ast`] module. | ||
|
||
For more information on how to use the parser, [read the parser documentation](parser). | ||
If you're looking to work with the AST, [read the AST's documentation](ast). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
extern crate lalrpop; | ||
|
||
fn main() { | ||
// Generate the LR parser from our grammar | ||
lalrpop::process_root().unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters