+# include <stdlib.h>
+# include "A.h"
+
+/*
+ * node constructor functions
+ */
+
+/* A_CompoundStm - returns a compound statement of stm1, stm2 */
+A_stm A_CompoundStm (A_stm stm1, A_stm stm2) {
+ A_stm s = malloc(sizeof(*s));
+ s->type = A_compoundStm;
+ s->u.compound.stm1 = stm1;
+ s->u.compound.stm2 = stm2;
+ return s;
+}
+
+/* A_AssignStm - returns a assign statement of id, exp */
+A_stm A_AssignStm (char *id, A_exp exp) {
+ A_stm s = malloc(sizeof(*s));
+ s->type = A_assignStm;
+ s->u.assign.id = id;
+ s->u.assign.exp = exp;
+ return s;
+}
+
+/* A_PrintStm - returns a print statement of exps */
+A_stm A_PrintStm (A_expList exps) {
+ A_stm s = malloc(sizeof(*s));
+ s->type = A_printStm;
+ s->u.print.exps = exps;
+ return s;
+}
+
+/* A_IdExp - returns an id expression of id */
+A_exp A_IdExp (char *id) {
+ A_exp e = malloc(sizeof(*e));
+ e->type = A_idExp;
+ e->u.id = id;
+ return e;
+}
+
+/* A_NumExp - returns a number expression of num */
+A_exp A_NumExp (int num) {
+ A_exp e = malloc(sizeof(*e));
+ e->type = A_numExp;
+ e->u.num = num;
+ return e;
+}
+
+/* A_OpExp - returns an operation expression of exp1, op, exp2 */
+A_exp A_OpExp (A_exp exp1, A_binop op, A_exp exp2) {
+ A_exp e = malloc(sizeof(*e));
+ e->type = A_opExp;
+ e->u.op.exp1 = exp1;
+ e->u.op.op = op;
+ e->u.op.exp2 = exp2;
+ return e;
+}
+
+/* A_EseqExp - returns a seqeunce expression of stm, exp */
+A_exp A_EseqExp (A_stm stm, A_exp exp) {
+ A_exp e = malloc(sizeof(*e));
+ e->type = A_eseqExp;
+ e->u.eseq.stm = stm;
+ e->u.eseq.exp = exp;
+ return e;
+}
+
+/* A_PairExpList - returns a list expression pair of head, tail */
+A_expList A_PairExpList (A_exp head, A_expList tail) {
+ A_expList l = malloc(sizeof(*l));
+ l->type = A_pairExpList;
+ l->u.pair.head = head;
+ l->u.pair.tail = tail;
+ return l;
+}
+
+/* A_LastExpList - returns a expression list end of last */
+A_expList A_LastExpList (A_exp last) {
+ A_expList l = malloc(sizeof(*l));
+ l->type = A_lastExpList;
+ l->u.last = last;
+ return l;
+}
+
+int main (int argc, char** argv) {
+ return 0;
+}