feat: initial parallel type-checker implementation
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package wacc
|
||||
|
||||
import cats.data.Chain
|
||||
|
||||
object microWacc {
|
||||
import wacc.types._
|
||||
|
||||
@@ -78,12 +80,12 @@ object microWacc {
|
||||
}
|
||||
|
||||
case class Assign(lhs: LValue, rhs: Expr) extends Stmt
|
||||
case class If(cond: Expr, thenBranch: List[Stmt], elseBranch: List[Stmt]) extends Stmt
|
||||
case class While(cond: Expr, body: List[Stmt]) extends Stmt
|
||||
case class If(cond: Expr, thenBranch: Chain[Stmt], elseBranch: Chain[Stmt]) extends Stmt
|
||||
case class While(cond: Expr, body: Chain[Stmt]) extends Stmt
|
||||
case class Call(target: CallTarget, args: List[Expr]) extends Stmt with Expr(target.retTy)
|
||||
case class Return(expr: Expr) extends Stmt
|
||||
|
||||
// Program
|
||||
case class FuncDecl(name: Ident, params: List[Ident], body: List[Stmt])
|
||||
case class Program(funcs: List[FuncDecl], stmts: List[Stmt])
|
||||
case class FuncDecl(name: Ident, params: List[Ident], body: Chain[Stmt])
|
||||
case class Program(funcs: Chain[FuncDecl], stmts: Chain[Stmt])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user