private void define(String id, Type type, CommonTree decl) { // Add id with its type to the type table, checking // that id is not already declared in the same scope. boolean ok = typeTable.put(id, type); if (!ok) reportError(id + " is redeclared", decl); }
private void predefine() { // Add predefined procedures to the type table. typeTable.put("read", new Type.Mapping(Type.VOID, Type.INT)); typeTable.put("write", new Type.Mapping(Type.INT, Type.VOID)); }