カスタムレキサーの作成
Whitespace言語のパースにおけるレキサー実装
Whitespace言語をパースする際、次のような文法構造を想定します:
pub Program = <Statement*>;
Statement: ast::Stmt = {
" " <StackOp>,
"\t" " " <MathOp>,
"\t" "\t" <HeapOp>,
"\n" <FlowCtrl>,
"\t" "\n" <Io>,
};
StackOp: ast::Stmt = {
" " <Nu ...
5月24日 06:29 投稿