This note explains how to map my grammar/action oriented lectures to your AST (Abstract Syntax Tree) code, if that's the way you are implementing your compiler. In class, I explain how to do the right check for this rule, which is the focus of the phase I milestone: Expr ::= Expr MulOp Expr { /* what goes here? */ } and my first piece of advice was to isolate the actions from the grammar through procedures: Expr ::= Expr:e1 MulOp:op Expr:e2 {: RESULT = BinaryExpr.action(e1, symTab.lookup(op), e2); :} I then elaborate what this action had to do top-down (see Type Checking lecture): 1. First the Action's body. 2. Then the Check's body. 3. Then the Op's code. 4. And then the type's code and mods to VarSTO. The question is, how do you use this code if you are doing the AST approach? The answer is as follows. The checking code (BinaryExprCheck) is the same for this rule: Expr ::= Expr T_MUL Expr as it is for a multiply expression in your tree: * / \ x y In particular, you must retrieve the STO's for all the entities and do the requisite check. So, you can safely ignore step 1. above, and skip to 2. Then you probably want to write a recursive AST check something like this in place of step 1: class BinaryExprAST { ... public boolean typeCheck() { boolean ok; VarSTO resultSTO = varSTO(); // constructor with no name makes fake name ok = this.leftChild().typeCheck(); ok = this.rightChild().typeCheck() && ok; // beware &&'s short-circuiting! ok = TypeCheck.BinaryExpr(resultSTO, this.leftChild().sym(), this.operatorSTO(), this.rightChild().sym()) && ok; this.putSTO(resultSTO); return ok; } } As you can see, BinaryExprCheck has not changed at all. You may, however, want to define it as a private member function (method) of BinaryExprAST: // highly specific name suggests this is non-generic, local member function private boolean BinaryExprCheck(VarSTO result, STO a, OpSTO op, STO b); However, the BinaryExprCheck function/method could go in other classes as well. Including STO classes and Type classes for binary arithmetic operators.