public Operand buildFalse() { return manager.getFalse(); }
public Operand buildFalse() { return manager.getFalse(); }
public Operand buildToAry(ToAryNode node, IRScope s) { Operand array = build(node.getValue(), s); Variable result = s.getNewTemporaryVariable(); s.addInstr(new ToAryInstr(result, array, manager.getFalse())); return result; }
@Override public void buildVersionSpecificAssignment(Node node, IRScope s, Variable v) { switch (node.getNodeType()) { case MULTIPLEASGN19NODE: { s.addInstr(new ToAryInstr(v, v, manager.getFalse())); buildMultipleAsgn19Assignment((MultipleAsgn19Node)node, s, null, v); break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }
@Override public void buildVersionSpecificAssignment(Node node, IRScope s, Variable v) { switch (node.getNodeType()) { case MULTIPLEASGN19NODE: { s.addInstr(new ToAryInstr(v, v, manager.getFalse())); buildMultipleAsgn19Assignment((MultipleAsgn19Node)node, s, null, v); break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }
public Operand buildToAry(ToAryNode node, IRScope s) { Operand array = build(node.getValue(), s); Variable result = s.getNewTemporaryVariable(); s.addInstr(new ToAryInstr(result, array, manager.getFalse())); return result; }
public Operand buildOpElementAsgn(OpElementAsgnNode node) { // Translate "a[x] ||= n" --> "a[x] = n if !is_true(a[x])" if (node.isOr()) return buildOpElementAsgnWith(node, manager.getTrue()); // Translate "a[x] &&= n" --> "a[x] = n if is_true(a[x])" if (node.isAnd()) return buildOpElementAsgnWith(node, manager.getFalse()); // a[i] *= n, etc. anything that is not "a[i] &&= .. or a[i] ||= .." return buildOpElementAsgnWithMethod(node); }
public Operand buildMultipleAsgn19(MultipleAsgn19Node multipleAsgnNode, IRScope s) { Operand values = build(multipleAsgnNode.getValueNode(), s); Variable ret = getValueInTemporaryVariable(s, values); s.addInstr(new ToAryInstr(ret, ret, manager.getFalse())); buildMultipleAsgn19Assignment(multipleAsgnNode, s, null, ret); return ret; }
public Operand buildMultipleAsgn19(MultipleAsgn19Node multipleAsgnNode, IRScope s) { Operand values = build(multipleAsgnNode.getValueNode(), s); Variable ret = getValueInTemporaryVariable(s, values); s.addInstr(new ToAryInstr(ret, ret, manager.getFalse())); buildMultipleAsgn19Assignment(multipleAsgnNode, s, null, ret); return ret; }
public static Boolean decode(IRReaderDecoder d) { return d.decodeBoolean() ? d.getCurrentScope().getManager().getTrue() : d.getCurrentScope().getManager().getFalse(); }
public Operand buildOpElementAsgn(OpElementAsgnNode node) { // Translate "a[x] ||= n" --> "a[x] = n if !is_true(a[x])" if (node.isOr()) return buildOpElementAsgnWith(node, manager.getTrue()); // Translate "a[x] &&= n" --> "a[x] = n if is_true(a[x])" if (node.isAnd()) return buildOpElementAsgnWith(node, manager.getFalse()); // a[i] *= n, etc. anything that is not "a[i] &&= .. or a[i] ||= .." return buildOpElementAsgnWithMethod(node); }
public static Boolean decode(IRReaderDecoder d) { return d.decodeBoolean() ? d.getCurrentScope().getManager().getTrue() : d.getCurrentScope().getManager().getFalse(); }
protected Variable buildDefinitionCheck(ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = getNewLabel(); addInstr((Instr) definedInstr); addInstr(createBranch(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(undefLabel, new FrozenString(definedReturnValue)); }
protected Variable buildDefinitionCheck(ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = getNewLabel(); addInstr((Instr) definedInstr); addInstr(createBranch(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(undefLabel, new FrozenString(definedReturnValue)); }
protected Variable buildDefinitionCheck(IRScope s, ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = s.getNewLabel(); s.addInstr((Instr) definedInstr); s.addInstr(BEQInstr.create(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(s, undefLabel, new StringLiteral(definedReturnValue)); }
protected Variable buildDefinitionCheck(IRScope s, ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = s.getNewLabel(); s.addInstr((Instr) definedInstr); s.addInstr(BEQInstr.create(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(s, undefLabel, new StringLiteral(definedReturnValue)); }
public Operand buildOpAsgnAnd(OpAsgnAndNode andNode) { Label l = getNewLabel(); Operand v1 = build(andNode.getFirstNode()); Variable result = getValueInTemporaryVariable(v1); addInstr(createBranch(v1, manager.getFalse(), l)); Operand v2 = build(andNode.getSecondNode()); // This does the assignment! addInstr(new CopyInstr(result, v2)); addInstr(new LabelInstr(l)); return result; }
public Operand buildOpAsgnAnd(OpAsgnAndNode andNode, IRScope s) { Label l = s.getNewLabel(); Operand v1 = build(andNode.getFirstNode(), s); Variable result = getValueInTemporaryVariable(s, v1); s.addInstr(BEQInstr.create(v1, manager.getFalse(), l)); Operand v2 = build(andNode.getSecondNode(), s); // This does the assignment! s.addInstr(new CopyInstr(result, v2)); s.addInstr(new LabelInstr(l)); return result; }
public Operand buildOpAsgnAnd(OpAsgnAndNode andNode) { Label l = getNewLabel(); Operand v1 = build(andNode.getFirstNode()); Variable result = getValueInTemporaryVariable(v1); addInstr(createBranch(v1, manager.getFalse(), l)); Operand v2 = build(andNode.getSecondNode()); // This does the assignment! addInstr(new CopyInstr(result, v2)); addInstr(new LabelInstr(l)); return result; }
public Operand buildOpAsgnAnd(OpAsgnAndNode andNode, IRScope s) { Label l = s.getNewLabel(); Operand v1 = build(andNode.getFirstNode(), s); Variable result = getValueInTemporaryVariable(s, v1); s.addInstr(BEQInstr.create(v1, manager.getFalse(), l)); Operand v2 = build(andNode.getSecondNode(), s); // This does the assignment! s.addInstr(new CopyInstr(result, v2)); s.addInstr(new LabelInstr(l)); return result; }