Example #1
0
        private Node ParseOr()
        {
            Node lhs = ParseAnd();

            while (true)
            {
                switch (Tokens.CurrentToken)
                {
                case TokenType.Or:
                {
                    Tokens.ReadNext();
                    Node rhs = ParseAnd();
                    lhs = new NodeOr(lhs, rhs);
                    continue;
                }

                case TokenType.ConditionalOr:
                {
                    Tokens.ReadNext();
                    Node rhs = ParseAnd();
                    lhs = new NodeConditionalOr(lhs, rhs);
                    continue;
                }

                default:
                    return(lhs);
                }
            }
        }
Example #2
0
 internal void Accept(NodeOr or)
 {
     or.left.Visit(this);
     uint pass = builder.OpOr(0);
     or.right.Visit(this);
     builder.SetOpC(pass, builder.InsnCount);
 }
Example #3
0
 void ASTVisitor.Accept(NodeOr value)
 {
     Accept(value);
 }