public void EmitExpressionStatement(ExpressionStatement node, int si) { EmitExpression(node.Expression, si); }
public override void VisitExpressionStatement (ExpressionStatement node) { Visit (node.Expression); WriteToken (";"); WriteLine (); }
static bool TryGetAssignedVariable (ExpressionStatement node, out VariableReference variable) { variable = null; var assign = node.Expression as AssignExpression; if (assign == null) return false; var variable_reference = assign.Target as VariableReferenceExpression; if (variable_reference == null) return false; variable = variable_reference.Variable; return true; }
public override void VisitExpressionStatement (ExpressionStatement node) { switch (state) { case State.Begin: if (!TryGetAssignedVariable (node, out variable)) break; initializer = node; state = State.Initializer; return; case State.Condition: VariableReference candidate; if (!TryGetAssignedVariable (node, out candidate)) break; if (variable != candidate) break; state = State.Increment; increment = node; Match = true; break; } Continue = false; }
public virtual void VisitExpressionStatement (ExpressionStatement node) { Visit (node.Expression); }