Skip to content

Tsukuba-Programming-Lab/Copager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copager

「言語処理系生成系」の生成系(Constructible Parser Generator on Rust)

Features

Common

  • all
  • derive
  • prebuild
  • template
  • dev

Lex

Parse

IR

// RegexLex(lex) + LR1(parse) + SExp(ir)
copager = { ..., features = ["derive", "regexlex", "lr1", "sexp"] }

// RegexLex(lex) + LALR1(parse) + Void(ir)
copager = { ..., features = ["derive", "regexlex", "lalr1", "void"] }

Examples

$ cargo run -p example_build_oneshot
Example <one-shot>
Input: 10 * 20 + 30
Success: (Expr (Expr (Term (Term (Num "10")) "*" (Num "20"))) "+" (Term (Num "30")))

Test

$ cargo test