Below is *part* of a possible schema for the AST. Even though declarations are a lot like ordinary statements, it makes sense to set them off from the representation of a block, since that way you effectively have a symbol table implicit in the tree of declarations. program node: program / \ declarations block declarations tree: ; / \ declarations declaration declaration node: : / \ type list list node: , / \ list id block node: ; / \ block-node stmt-node if-stmt node: if / \ bool-expr else / \ block-node block-node or: if / \ bool-expr block Using this scheme for the AST nodes, the following source: void main () { int i,j; bool variable; if (i > j) { i = i + j; j = i - 2; } else if (variable) if i <= j then i = 0 else j = 0 } ..... might have this output, representing the AST: (program (; (: int (, i j ) ) (: bool variable ) ) (if (> i j ) (else (; (= i (+ i j ) ) (= j (- i 2 ) (if variable (if (<= i j ) (else (= i 0 ) (= j 0 ) ) ) ) ) ) ) Note that the general idea is to represent everything as an operator. For example, "if" is an operator, whose left operand is a boolean expression. In case there's an "else", the "else" is regarded as an operator whose left operand is the tree of statements to execute if the boolean expression is true, the right operand is the tree of statements to execute if the boolean expression is false. If there's no "else" of course the right operand of an "if" is just the block of statements to execute if the boolean expression is true. The while-construct is treated similarly to the single-alternative "if."