コード例 #1
0
ファイル: Parser.cs プロジェクト: outrera/game-creator
        Expression expr()
        {
            Token      temp = next;
            Expression x    = rel();

            while (true)
            {
                switch (t)
                {
                case TokenKind.LogicalAnd:
                    move(); x = new LogicalAnd(x, rel(), temp.line, temp.col); continue;

                case TokenKind.LogicalOr:
                    move(); x = new LogicalOr(x, rel(), temp.line, temp.col); continue;

                case TokenKind.LogicalXor:
                    move(); x = new LogicalXor(x, rel(), temp.line, temp.col); continue;

                default:
                    return(x);
                }
            }
        }
コード例 #2
0
ファイル: Parser.cs プロジェクト: MilesBoulanger/game-creator
 Expression expr()
 {
     Token temp = next;
     Expression x = rel();
     while (true)
     {
         switch (t)
         {
             case TokenKind.LogicalAnd:
                 move(); x = new LogicalAnd(x, rel(), temp.line, temp.col); continue;
             case TokenKind.LogicalOr:
                 move(); x = new LogicalOr(x, rel(), temp.line, temp.col); continue;
             case TokenKind.LogicalXor:
                 move(); x = new LogicalXor(x, rel(), temp.line, temp.col); continue;
             default:
                 return x;
         }
     }
 }