public void receiveRequiredArg(Node node, IRScope s, int argIndex, boolean post, int numPreReqd, int numPostRead) { switch (node.getNodeType()) { case ARGUMENTNODE: { ArgumentNode a = (ArgumentNode)node; String argName = a.getName(); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("req", argName); addArgReceiveInstr(s, s.getNewLocalVariable(argName, 0), argIndex, post, numPreReqd, numPostRead); break; } case MULTIPLEASGN19NODE: { MultipleAsgn19Node childNode = (MultipleAsgn19Node) node; Variable v = s.getNewTemporaryVariable(); addArgReceiveInstr(s, v, argIndex, post, numPreReqd, numPostRead); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("rest", ""); s.addInstr(new ToAryInstr(v, v, manager.getFalse())); buildMultipleAsgn19Assignment(childNode, s, v, null); break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }
public void receiveRequiredArg(Node node, IRScope s, int argIndex, boolean post, int numPreReqd, int numPostRead) { switch (node.getNodeType()) { case ARGUMENTNODE: { ArgumentNode a = (ArgumentNode)node; String argName = a.getName(); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("req", argName); addArgReceiveInstr(s, s.getNewLocalVariable(argName, 0), argIndex, post, numPreReqd, numPostRead); break; } case MULTIPLEASGN19NODE: { MultipleAsgn19Node childNode = (MultipleAsgn19Node) node; Variable v = s.getNewTemporaryVariable(); addArgReceiveInstr(s, v, argIndex, post, numPreReqd, numPostRead); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("rest", ""); s.addInstr(new ToAryInstr(v, v, manager.getFalse())); buildMultipleAsgn19Assignment(childNode, s, v, null); break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }