private static ArrayList<String> pushVariable(Token t) throws Exception { ArrayList<String> res = new ArrayList<>(); Variable v = Alzheimer.variables.get(t.valueWithoutIndex()); if (v == null) { if (!t.isNumber() && !t.isString() && !t.isCharacter()) { if (!t.isType()) { throw new CompilerException("Unknown variable " + t.value, t.file, t.line); } else { Type T = Alzheimer.types.get(t.valueBeforeFirstDot()); if (T == null) { throw new CompilerException("Unknown type " + t.valueBeforeFirstDot(), t.file, t.line); } else { switch (t.valueAfterFirstDot()) { case "size": exec("push " + T.size() + "; " + t.value, res); break; default: throw new CompilerException( "Type '" + t.valueBeforeFirstDot() + "' does not have property '" + t.valueAfterFirstDot() + "' ", t.file, t.line); } } } } else { exec("push " + t.value + ";", res); } } else { if (v.isArray && !t.isArray()) { res.addAll(pushArray(v, t.file, t.line)); } else { if (t.isArray()) { v = new Variable(); v.name = t.value; String alz = "" + v.accessVarName() + "=( " + v.arrayIndex() + " );\n"; res.addAll(Alzheimer.compile(alz)); res.addAll(v.type.push(v.nameWithoutIndex() + "[" + v.accessVarName() + "]")); } else { res.addAll(v.type.push(t.value)); } } } return res; }