SE250:lab-9:vpup001

From Marks Wiki
Revision as of 05:20, 3 November 2008 by Mark (Sọ̀rọ̀ | contribs) (4 revision(s))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

OK... I have chosen option 2 and I have been trying to figure out how to do.

This is my code...

Tree* Stmt( TokenStream* tokens ) {
	/*TODO*/
	Token n = current( tokens );
	advance( tokens );
	
	if (eqToken(n, TOK_IF)) {
		Tree* t =Exp(tokens,0);
		Tree* thenS;
		Tree* elseS;

		expect(tokens, TOK_THEN);
		Tree* t1 = Stmt(thenS);

		expect(tokens, TOK_ELSE);
		Tree* t2 = Stmt(elseS);
	}
	return mkNode3(n, t1, t2, t3);
}

I have got so many errors and I have no idea whats wrong with it.