public Equals(String input, Map vars) { LispReader lr = new LispReader(new StringReader(input)); String t = lr.next(); // read type if (!t.equals("=")) { System.err.println("= not found in Equals constructor"); System.exit(-1); } left = Exp.makeExp(lr.next(), vars); right = Exp.makeExp(lr.next(), vars); if (!wellTyped()) { System.out.println("MISTYPED in Equals.java: " + this); } addToNameMap(Arrays.asList(left, right)); }
public Count(String input, Map vars) { LispReader lr = new LispReader(new StringReader(input)); String stype = lr.next(); // read 'count'; // always count entities arg = new Var(PType.E); String argname = lr.next(); vars.put(argname, arg); body = Exp.makeExp(lr.next(), vars); // body = body.replace(a,arg); }
public IntSet(String input, Map vars) { exps = new LinkedList(); LispReader lr = new LispReader(new StringReader(input)); String t = lr.next(); // read the identifier "set" if (!t.equals("intset")) { System.err.println("Bad IntSet identifier: " + t); System.exit(-1); } while (lr.hasNext()) { exps.add(Exp.makeExp(lr.next(), vars)); } }