hime
hime copied to clipboard
How to make language specific AST?
I want to produce my own AST like this:
pub struct Expr {
Atom(Identifier),
Constant(Constant),
Unary(Operator, Box<Expr>),
Binary(Box<Expr>, Operator, Box<Expr>),
Declare(Type, Identifier, Option<Box<Expr>>),
}
What is the best way to let us handle the AST forming part?