@Override public void visit(AssignmentStatement statement) { if (statement.getLeftValue() != null) { statement.getLeftValue().acceptVisitor(this); } statement.getRightValue().acceptVisitor(this); }
@Override public void visit(AssignmentStatement statement) { try { output.writeByte(statement.getLeftValue() != null ? 0 : 1); writeLocation(statement.getLocation()); if (statement.getLeftValue() != null) { writeExpr(statement.getLeftValue()); } writeExpr(statement.getRightValue()); output.writeBoolean(statement.isAsync()); } catch (IOException e) { throw new IOExceptionWrapper(e); } }
@Override public void visit(AssignmentStatement statement) { Expr left = statement.getLeftValue(); if (left == null) { accept(statement.getRightValue()); result.acceptVisitor(typeInference); if (typeInference.getResult() != null) { result = new WasmDrop(result); result.setLocation(statement.getLocation()); } } else if (left instanceof VariableExpr) { VariableExpr varExpr = (VariableExpr) left; WasmLocal local = function.getLocalVariables().get(varExpr.getIndex() - firstVariable); accept(statement.getRightValue()); result = new WasmSetLocal(local, result); result.setLocation(statement.getLocation()); } else if (left instanceof QualificationExpr) { QualificationExpr lhs = (QualificationExpr) left; storeField(lhs.getQualified(), lhs.getField(), statement.getRightValue(), statement.getLocation()); } else if (left instanceof SubscriptExpr) { SubscriptExpr lhs = (SubscriptExpr) left; storeArrayItem(lhs, statement.getRightValue()); } else { throw new UnsupportedOperationException("This expression is not supported yet"); } }
@Override public void visit(AssignmentStatement statement) { if (statement.getLeftValue() != null) { statement.getLeftValue().acceptVisitor(this); writer.print(" = "); } statement.getRightValue().acceptVisitor(this); writer.println(";"); }
return false; if (!(assignment.getRightValue() instanceof NewExpr)) { return false; NewExpr constructed = (NewExpr) assignment.getRightValue(); if (!constructed.getConstructedClass().equals(expr.getMethod().getClassName())) { return false;
assignment.getRightValue().setLocation(assignment.getLocation()); assignment.getRightValue().acceptVisitor(this);
if (firstAssignment.getLeftValue() == null || secondAssignment.getRightValue() == null) { return null; ConditionalExpr conditionalExpr = new ConditionalExpr(); conditionalExpr.setCondition(statement.getCondition()); conditionalExpr.setConsequent(firstAssignment.getRightValue()); conditionalExpr.setAlternative(secondAssignment.getRightValue()); conditionalExpr.setLocation(statement.getCondition().getLocation()); AssignmentStatement assignment = new AssignmentStatement();
try { if (statement.getLeftValue() == null) { statement.getRightValue().acceptVisitor(this); if (resultExpr instanceof InvocationExpr && tryApplyConstructor((InvocationExpr) resultExpr)) { resultStmt = new SequentialStatement(); statement.getRightValue().acceptVisitor(this); Expr right = resultExpr; Expr left = statement.getLeftValue();
statement.getRightValue().acceptVisitor(this); debugEmitter.emitCallSite(); writer.append(";").softNewLine();
@Override public void visit(AssignmentStatement statement) { InvocationExpr invocation = (InvocationExpr) statement.getRightValue(); asyncCalls.add(invocation.getMethod()); }
@Override public void visit(AssignmentStatement statement) { if (statement.getLeftValue() != null) { statement.getLeftValue().acceptVisitor(this); } statement.getRightValue().acceptVisitor(this); }
return false; if (!(assignment.getRightValue() instanceof NewExpr)) { return false; NewExpr constructed = (NewExpr) assignment.getRightValue(); if (!constructed.getConstructedClass().equals(expr.getMethod().getClassName())) { return false;
@Override public void visit(AssignmentStatement statement) { try { output.writeByte(statement.getLeftValue() != null ? 0 : 1); writeLocation(statement.getLocation()); if (statement.getLeftValue() != null) { writeExpr(statement.getLeftValue()); } writeExpr(statement.getRightValue()); output.writeBoolean(statement.isAsync()); } catch (IOException e) { throw new IOExceptionWrapper(e); } }
@Override public void visit(AssignmentStatement statement) { Expr left = statement.getLeftValue(); if (left == null) { accept(statement.getRightValue()); result.acceptVisitor(typeInference); if (typeInference.getResult() != null) { result = new WasmDrop(result); result.setLocation(statement.getLocation()); } } else if (left instanceof VariableExpr) { VariableExpr varExpr = (VariableExpr) left; WasmLocal local = function.getLocalVariables().get(varExpr.getIndex() - firstVariable); accept(statement.getRightValue()); result = new WasmSetLocal(local, result); result.setLocation(statement.getLocation()); } else if (left instanceof QualificationExpr) { QualificationExpr lhs = (QualificationExpr) left; storeField(lhs.getQualified(), lhs.getField(), statement.getRightValue(), statement.getLocation()); } else if (left instanceof SubscriptExpr) { SubscriptExpr lhs = (SubscriptExpr) left; storeArrayItem(lhs, statement.getRightValue()); } else { throw new UnsupportedOperationException("This expression is not supported yet"); } }
assignment.getRightValue().setLocation(assignment.getLocation()); assignment.getRightValue().acceptVisitor(this);
if (firstAssignment.getLeftValue() == null || secondAssignment.getRightValue() == null) { return null; ConditionalExpr conditionalExpr = new ConditionalExpr(); conditionalExpr.setCondition(statement.getCondition()); conditionalExpr.setConsequent(firstAssignment.getRightValue()); conditionalExpr.setAlternative(secondAssignment.getRightValue()); conditionalExpr.setLocation(statement.getCondition().getLocation()); AssignmentStatement assignment = new AssignmentStatement();
@Override public void visit(AssignmentStatement statement) { pushLocation(statement.getLocation()); try { if (statement.getLeftValue() == null) { statement.getRightValue().acceptVisitor(this); if (resultExpr instanceof InvocationExpr && tryApplyConstructor((InvocationExpr) resultExpr)) { resultStmt = new SequentialStatement(); } else { statement.setRightValue(resultExpr); resultStmt = statement; } } else { statement.getRightValue().acceptVisitor(this); Expr right = resultExpr; Expr left = statement.getLeftValue(); if (!(statement.getLeftValue() instanceof VariableExpr)) { statement.getLeftValue().acceptVisitor(this); left = resultExpr; } statement.setLeftValue(left); statement.setRightValue(right); resultStmt = statement; } } finally { popLocation(); } }
statement.getRightValue().acceptVisitor(this); debugEmitter.emitCallSite(); writer.append(";").softNewLine();