package ca.uwaterloo.joos.ast.statement;

import ca.uwaterloo.joos.ast.ASTNode;
import ca.uwaterloo.joos.parser.ParseTree.Node;

public abstract class Statement extends ASTNode {

	public Statement(Node node, ASTNode parent) throws Exception {
		super(node, parent);
	}

}

@@ -35,16 +35,124 @@
 ement;%0A%0A
+import java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport ca.uwaterloo.joos.ast.AST.ASTConstructException;%0A
 import c
@@ -227,151 +227,2027 @@
 ree.
+Leaf
 Node;%0A
-%0Apublic abstract class Statement extends ASTNode %7B%0A%0A%09public Statement(Node node, ASTNode parent) throws Exception %7B%0A%09%09super(node, parent)
+import ca.uwaterloo.joos.parser.ParseTree.Node;%0Aimport ca.uwaterloo.joos.parser.ParseTree.TreeNode;%0Aimport ca.uwaterloo.joos.parser.ParseTreeTraverse;%0Aimport ca.uwaterloo.joos.parser.ParseTreeTraverse.Traverser;%0A%0Apublic abstract class Statement extends ASTNode %7B%0A%0A%09public Statement(Node node, ASTNode parent) throws Exception %7B%0A%09%09super(node, parent);%0A%09%7D%0A%0A%09private static class StatementTraverser implements Traverser %7B%0A%09%09public ASTNode node;%0A%09%09private ASTNode parent;%0A%0A%09%09public StatementTraverser(ASTNode parent) %7B%0A%09%09%09this.parent = parent;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public List%3CNode%3E processTreeNode(TreeNode treeNode) throws Exception %7B%0A%09%09%09if (treeNode.productionRule.getLefthand().equals(%22block%22)) %7B%0A%09%09%09%09node = new Block(treeNode, parent);%0A%09%09%09%7D else if (treeNode.productionRule.getLefthand().equals(%22for%22) %7C%7C %0A%09%09%09%09%09treeNode.productionRule.getLefthand().equals(%22fornoshort%22)) %7B%0A%0A%09%09%09%7D else if (treeNode.productionRule.getLefthand().equals(%22ifthen%22)) %7B%0A%0A%09%09%09%7D else if (treeNode.productionRule.getLefthand().equals(%22ifthenelse%22) %7C%7C %0A%09%09%09%09%09treeNode.productionRule.getLefthand().equals(%22ifthenelsenoshort%22)) %7B%0A%0A%09%09%09%7D else if (treeNode.productionRule.getLefthand().equals(%22while%22) %7C%7C %0A%09%09%09%09%09treeNode.productionRule.getLefthand().equals(%22whilenoshort%22)) %7B%0A%0A%09%09%09%7D else if (treeNode.productionRule.getLefthand().equals(%22retstmnt%22)) %7B%0A%0A%09%09%09%7D else if (treeNode.productionRule.getLefthand().equals(%22emptystmnt%22)) %7B%0A%0A%09%09%09%7D else %7B%0A%09%09%09%09List%3CNode%3E offers = new ArrayList%3CNode%3E();%0A%09%09%09%09offers.addAll(treeNode.children);%0A%09%09%09%09return offers;%0A%09%09%09%7D%0A%09%09%09return null;%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public void processLeafNode(LeafNode leafNode) throws Exception %7B%0A%0A%09%09%7D%0A%09%7D%0A%0A%09public static ASTNode newStatement(Node node, ASTNode parent) throws Exception %7B%0A%0A%09%09StatementTraverser traverser = new StatementTraverser(parent);%0A%09%09ParseTreeTraverse traverse = new ParseTreeTraverse(traverser);%0A%09%09traverse.traverse(node);%0A%0A%09%09if (traverser.node == null) %7B%0A%09%09%09throw new ASTConstructException(node + %22 is not / does not contain a statement%22);%0A%09%09%7D%0A%0A%09%09return traverser.node
 ;%0A%09%7D

Implement Statement with basic placeholders