ferrugocc 0.4.0

An experimental C compiler and obfuscating compiler written in Rust, targeting x86_64 SysV ABI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! 構文解析(Parser)モジュール
//!
//! トークン列を受け取り、抽象構文木(AST)を構築する。
//! 再帰下降パーサーにより、Cの文法に従ってトークンを消費していく。
//!
//! ```text
//! [KwInt, Identifier("main"), OpenParen, KwVoid, CloseParen,
//!  OpenBrace, KwReturn, IntLiteral(2), Semicolon, CloseBrace]
//!   → Program { declarations: [TopLevelDecl::Function(FunctionDecl { name: "main",
//!       body: [Statement(Return(Constant(2)))] })] }
//! ```

pub mod ast;
pub mod parser;

pub use parser::parse;