bleibig / rust-grammar

LALR grammar and parser for Rust using flex and bison
MIT License
47 stars 15 forks source link

Enhance parser-lalr to the point of parsing/printing sexps for basic fns #3

Closed ptgreen closed 10 years ago

ptgreen commented 10 years ago
$ echo 'fn foo() { {10} - 1 }' | ./parser-lalr | grep -v '^#'
--- PARSE COMPLETE: ret:0, n_nodes:9 ---
(crate
    (mod-items
        (fn
            (stmts
                (block
                    (stmts
                        (lit-int
                        )
                    )
                )
                (-
                    (lit-int
                    )
                )
            )
        )
    )
)