Пример #1
0
        private void GenCase(AegisCase ac)
        {
            WriteNew("case ");

            Write(TranslateExpr(ac.Exp));

            WriteLine(":");

            tabLevel++;

            GenBlock(ac.Items);

            if (lastFunc.Name != "break")
            {
                WriteNewLine("break;");
            }

            tabLevel--;
        }
Пример #2
0
        private AegisCase MatchCase()
        {
            Match(TokenType.Case);

            Expr exp = MatchExpr();

            MatchNewline();

            var ac = new AegisCase();

            ac.Exp = exp;
            PushNode(ac);
            curNode.Items = MatchCaseBlock().Items;
            ac            = (AegisCase)PopNode();

            while (tk.Type == TokenType.NewLine)
            {
                MatchNewline();
            }
            return(ac);
        }