예제 #1
0
 override public void Visit(AST_unary_operator unary_operator)
 {
     base.Visit(unary_operator);
     if (unary_operator.Operand.DataType != bool_type)
     {
         Error("Unary operator '!' requires a bool operand.", unary_operator);
     }
     unary_operator.DataType = bool_type;
 }
예제 #2
0
        private AST_unary_operator Parse_unary_operator_operand(TokenKind followSet)
        {
            IncrementDepth();

            Token t = LookAheadToken();
            AST_unary_operator unary_operator;

            DebugPrint("unary_op_opnd");
            Match(Exclamation);
            unary_operator        = new AST_unary_operator(Parse_operand(followSet));
            unary_operator.Row    = t.Row;
            unary_operator.Column = t.Column;

            DecrementDepth();

            return(unary_operator);
        }
예제 #3
0
 override public void Visit(AST_unary_operator unary_operator)
 {
     unary_operator.Operand.Accept(this);
     value.Set(!value.BoolValue);
 }
예제 #4
0
 public virtual void Visit(AST_unary_operator unary_operator)
 {
     IncrementDepth();
     unary_operator.Operand.Accept(this);
     DecrementDepth();
 }