mirror of
https://github.com/Noratrieb/uwucc.git
synced 2026-01-16 09:35:07 +01:00
parse hello world
This commit is contained in:
parent
727cfc692c
commit
f229dd7fdc
7 changed files with 239 additions and 29 deletions
|
|
@ -78,11 +78,27 @@ pub struct ExprBinary {
|
|||
pub op: BinaryOp,
|
||||
}
|
||||
|
||||
#[derive(Debug, DebugPls)]
|
||||
pub enum PostfixOp {
|
||||
Call(Vec<Spanned<Expr>>),
|
||||
Member(Ident),
|
||||
ArrowMember(Ident),
|
||||
Increment,
|
||||
Decrement,
|
||||
}
|
||||
|
||||
#[derive(Debug, DebugPls)]
|
||||
pub struct ExprPostfix {
|
||||
pub lhs: Box<Spanned<Expr>>,
|
||||
pub op: PostfixOp,
|
||||
}
|
||||
|
||||
#[derive(Debug, DebugPls)]
|
||||
pub enum Expr {
|
||||
Atom(Atom),
|
||||
Unary(ExprUnary),
|
||||
Binary(ExprBinary),
|
||||
Postfix(ExprPostfix),
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -92,7 +108,10 @@ pub enum Expr {
|
|||
#[derive(Debug, DebugPls)]
|
||||
pub enum Stmt {
|
||||
Decl(Decl),
|
||||
Labeled{label: Ident, stmt: Box<Spanned<Stmt>>},
|
||||
Labeled {
|
||||
label: Ident,
|
||||
stmt: Box<Spanned<Stmt>>,
|
||||
},
|
||||
Compound(Vec<Spanned<Stmt>>),
|
||||
If {
|
||||
cond: Expr,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue