public bool Alternative(Func <Ast> action) { using (ISnapshot snapshot = TakeSnapshot()) { bool found = false; try { int currIndex = Index; Ast ast = action(); if (ast != null) { found = true; _cachedAst[currIndex] = new Memo(ast, Index); } } catch { } snapshot.Rollback(); return(found); } }