コード例 #1
0
ファイル: clightParser.cs プロジェクト: free2fqn/csLabs
    public ForContext @for()
    {
        ForContext _localctx = new ForContext(Context, State);

        EnterRule(_localctx, 12, RULE_for);
        try {
            EnterOuterAlt(_localctx, 1);
            {
                State = 55; Match(T__9);
                State = 56; Match(T__1);
                State = 57; declaration();
                State = 58; Match(T__8);
                State = 59; bool_expression();
                State = 60; Match(T__8);
                State = 61; Match(T__2);
            }
        }
        catch (RecognitionException re) {
            _localctx.exception = re;
            ErrorHandler.ReportError(this, re);
            ErrorHandler.Recover(this, re);
        }
        finally {
            ExitRule();
        }
        return(_localctx);
    }
コード例 #2
0
ファイル: Algorithm.cs プロジェクト: lukianol/CCI
        protected void For(int start, int end, Action <ForContext> body)
        {
            var context = new ForContext();

            for (context.Seed = start; context.Seed < end; context.Seed++)
            {
                IncrementIteration();
                body(context);

                if (context.Break)
                {
                    break;
                }
            }
        }