public virtual void Visit(GuardedAlternative guardedAlternative) { Visit(guardedAlternative.Guard); foreach (var statement in guardedAlternative.Body) { Visit(statement); } }
public GuardedAlternative CloneGuardedAlternative(GuardedAlternative alt) { return new GuardedAlternative(Tok(alt.Tok), alt.IsExistentialGuard, CloneExpr(alt.Guard), alt.Body.ConvertAll(CloneStmt)); }
void AlternativeBlockCase(bool allowExistentialGuards, out GuardedAlternative alt) { IToken x; Expression e; bool isExistentialGuard; List<Statement> body; Expect(35); x = t; isExistentialGuard = false; e = dummyExpr; if (allowExistentialGuards && IsExistentialGuard()) { ExistentialGuard(out e, false ); isExistentialGuard = true; } else if (StartOf(10)) { Expression(out e, true, false); } else SynErr(223); Expect(31); body = new List<Statement>(); while (!(StartOf(32))) {SynErr(224); Get();} while (IsNotEndOfCase()) { Stmt(body); while (!(StartOf(32))) {SynErr(225); Get();} } alt = new GuardedAlternative(x, isExistentialGuard, e, body); }