private Value factor() throws Exception
    {
        Value rval;
        if(scan.sym == Token.openparen) {
            scan.next();
            rval = expression();
            if(scan.sym == Token.closeparen) {
                scan.next();
            } else {
                throw new Exception("Factor: no closing ')'");
            }
        } else if (scan.sym == Token.call) {
            scan.next();
            rval = funcCall_rest();
        } else if (scan.sym == Token.num) {
            rval = number();
        } else {
            Designator d = designator();
            Type t = env.getType(d.getVarName());
            rval = t.getValue(d, currentBB, env);
        }
        return rval;
    }