/** Returns a local variable that single or double words can be stored in. */ protected int getTempVar() { if (tempVar < 0) { tempVar = getMaxLocals(); incMaxLocals(2); } return tempVar; }
protected int getLocalVar(Declarator d) { int v = d.getLocalVar(); if (v < 0) { v = getMaxLocals(); // delayed variable allocation. d.setLocalVar(v); incMaxLocals(1); } return v; }
public void atDeclarator(Declarator d) throws CompileError { d.setLocalVar(getMaxLocals()); d.setClassName(resolveClassName(d.getClassName())); int size; if (is2word(d.getType(), d.getArrayDim())) size = 2; else size = 1; incMaxLocals(size); /* NOTE: Array initializers has not been supported. */ ASTree init = d.getInitializer(); if (init != null) { doTypeCheck(init); atVariableAssign(null, '=', null, d, init, false); } }