/**
 * 
 */
package ca.uwaterloo.joos.ast.expr;

import java.util.List;

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

/**
 * @author Greg Wang
 *
 */
public class Expression extends ASTNode {

	/**
	 * @param node
	 * @param parent
	 * @throws Exception
	 */
	public Expression(Node node, ASTNode parent) throws Exception {
		super(node, parent);
		// TODO Auto-generated constructor stub
	}

	/* (non-Javadoc)
	 * @see ca.uwaterloo.joos.parser.ParseTreeTraverse.Traverser#processTreeNode(ca.uwaterloo.joos.parser.ParseTree.TreeNode)
	 */
	@Override
	public List<Node> processTreeNode(TreeNode treeNode) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see ca.uwaterloo.joos.parser.ParseTreeTraverse.Traverser#processLeafNode(ca.uwaterloo.joos.parser.ParseTree.LeafNode)
	 */
	@Override
	public void processLeafNode(LeafNode leafNode) throws Exception {
		// TODO Auto-generated method stub

	}

}

@@ -63,14 +63,98 @@
 til.
+Array
 List;%0A
+import java.util.List;%0A%0Aimport ca.uwaterloo.joos.ast.AST.ASTConstructException;
 %0Aimp
@@ -339,16 +339,128 @@
 reeNode;
+%0Aimport ca.uwaterloo.joos.parser.ParseTreeTraverse;%0Aimport ca.uwaterloo.joos.parser.ParseTreeTraverse.Traverser;
 %0A%0A/**%0A *
@@ -532,74 +532,8 @@
  %7B%0A%0A
-%09/**%0A%09 * @param node%0A%09 * @param parent%0A%09 * @throws Exception%0A%09 */%0A
 %09pub
@@ -665,155 +665,206 @@
 %0A%09%7D%0A
-%0A%09/* (non-Javadoc)%0A%09 * @see ca.uwaterloo.joos.parser.ParseTreeTraverse.Traverser#processTreeNode(ca.uwaterloo.joos.parser.ParseTree.TreeNode)%0A%09 */%0A
+%09%0A%0A%09private static class ExpressionTraverser implements Traverser %7B%0A%09%09public ASTNode node;%0A%09%09private ASTNode parent;%0A%09%09%0A%09%09public ExpressionTraverser(ASTNode parent) %7B%0A%09%09%09this.parent = parent;%0A%09%09%7D%0A%0A%09
 %09@Ov
@@ -862,32 +862,33 @@
 %09%7D%0A%0A%09%09@Override%0A
+%09
 %09public List%3CNod
@@ -950,208 +950,275 @@
 %7B%0A%09%09
-// TODO Auto-generated method stub%0A%09%09return null;%0A%09%7D%0A%0A%09/* (non-Javadoc)%0A%09 * @see ca.uwaterloo.joos.parser.ParseTreeTraverse.Traverser#processLeafNode(ca.uwaterloo.joos.parser.ParseTree.LeafNode)%0A%09 */%0A
+%09if (treeNode.productionRule.getLefthand().equals(%22assignexpr%22)) %7B%0A//%09%09%09%09node = new AssignmentExpression(treeNode, parent);%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@Ov
@@ -1224,16 +1224,17 @@
 verride%0A
+%09
 %09public 
@@ -1298,43 +1298,413 @@
 %7B%0A%09%09
-// TODO Auto-generated method stub%0A
+%09%0A%09%09%7D%0A%09%7D%0A%09%0A%09public static ASTNode newExpression(Node node, ASTNode parent) throws Exception %7B%0A%09%09%0A%09%09ExpressionTraverser traverser = new ExpressionTraverser(parent);%0A%09%09ParseTreeTraverse traverse = new ParseTreeTraverse(traverser);%0A%09%09traverse.traverse(node);%0A%09%09%0A%09%09if (traverser.node == null) %7B%0A%09%09%09throw new ASTConstructException(node + %22 is not / does not contain a primary%22);%0A%09%09%7D%0A%09%09%0A%09%09return traverser.node;
 %0A%09%7D%0A

Insert basic template to Expression