CSCI 310 Day 29
- Administrivia
- Celebration of Student Research -- support your peers!
- office hours pushed back today: 4:30 - 6 pm.
- Project 5 questions?
- Intermediate representation trees, continued
- Expressions
- CONST(value)
- NAME(n)
- TEMP(t)
- BINOP(op, left, right) (op one of PLUS, MINUS, MUL, DIV, AND, OR, XOR, LSHIFT, RSHIFT)
- MEM(exp)
- CALL(f, l) f is a label for a method, l is a list of expressions
- ESEQ(s, exp)
- Statements
- MOVE(TEMP t, Expression e)
- MOVE(MEM(e1), e2)
- EXP(e)
- JUMP(Expression e, labels) e is a name or address, labels is a list of valid labels/addresses that the expression can evaluate to.
(Abbreviate as JUMP(e) if e is an obvious label or memory expression.)
- CJUMP(op, e1, e2, t, f) t, f labels to jump to on true or false. op is one of EQ, NE, LT, GT, LE, GE.
- SEQ(s1, s2) s1 evaluated, then s2
- LABEL(n) (label this tree as n)
- What we did last time: trees for
- variable x
- x + 5
- y = x + 5
- a[i] = x+ 5
- a = new int [n]
- Today
- Continue a = new int[n]. Do we initialize to all 0's? how?
- if (x < 5) a[i] = x + 5; else y = x + 5;
- while (x < 5) { a[i] = x+5; x = x+1; i = i+1;}
- x = new Foo();
Gary Lewandowski
Last modified: Mon Apr 4 10:51:14 EDT 2005