* expression.cs (Binary.Operator): Renamed LogicalAnd/LogicalOr to
authorJambunathan K <jambunathan@mono-cvs.ximian.com>
Sat, 26 Mar 2005 07:55:44 +0000 (07:55 -0000)
committerJambunathan K <jambunathan@mono-cvs.ximian.com>
Sat, 26 Mar 2005 07:55:44 +0000 (07:55 -0000)
LogicalAndAlso and LogicalOrElse.

* cfold.cs, gen-treedump.cs, generic.cs, mb-parser.jay: Changes
related to the above renaming.

svn path=/trunk/mcs/; revision=42263

mcs/bmcs/ChangeLog
mcs/bmcs/Makefile
mcs/bmcs/cfold.cs
mcs/bmcs/expression.cs
mcs/bmcs/gen-treedump.cs
mcs/bmcs/generic.cs
mcs/bmcs/mb-parser.jay

index db1ee4ffcf40f722919902583b43041966a34140..9824dcf11ad91fdfc47cfc7f118badf6263fa397 100644 (file)
@@ -1,3 +1,11 @@
+2005-03-26  Jambunathan K  <kjambunathan.devel@gmail.com>
+
+       * expression.cs (Binary.Operator): Renamed LogicalAnd/LogicalOr to
+       LogicalAndAlso and LogicalOrElse.
+       
+       * cfold.cs, gen-treedump.cs, generic.cs, mb-parser.jay: Changes
+       related to the above renaming.
+
 2005-03-25  Jambunathan K  <kjambunathan.devel@gmail.com>
 
        * constant.cs (DateConstant): Added (Borrowed from mbas)
index 9c035eb85e14440c769c8e4eda234bc97bf20083..28293c298ee002873390cdb1a4ed65c091bc2bea 100644 (file)
@@ -30,15 +30,8 @@ include ../build/executable.make
 bmcs.exe: mb-parser.cs
        gmcs    -d:NET_1_1 -d:ONLY_1_1 -debug /target:exe /out:bmcs.exe mb-parser.cs  @bmcs.exe.sources -nowarn:219 -nowarn:162
 
-install-as-mbas: all
-       cp ../class/lib/default/bmcs.exe $(prefix)/lib/mono/1.0/mbas.exe
-
 winstall: all
-       cp ../class/lib/default/bmcs.exe  /cygdrive/c/WINDOWS/Microsoft.NET/Framework/v1.1.4322/
-
-winstall-as-mbas: all
-       cp ../class/lib/default/bmcs.exe  /cygdrive/c/WINDOWS/Microsoft.NET/Framework/v1.1.4322/
-       cp ../class/lib/default/bmcs.exe  /cygdrive/c/WINDOWS/Microsoft.NET/Framework/v1.1.4322/mbas.exe
+       cp bmcs.exe  $(prefix)/lib/mono/2.0/
 
 diffus:
        diff --exclude='.svn' --exclude='*-parser.*' --exclude='*-tokenizer.cs' -ruN ../gmcs ../bmcs
\ No newline at end of file
index 1e4eaffc316ae1f8a889ebca724557e48af18bfd..346d981594eb804d70ff2e2973198ae38b501164 100644 (file)
@@ -999,7 +999,7 @@ namespace Mono.CSharp {
                                Binary.Error_OperatorCannotBeApplied (loc, ">>", lt, rt);
                                break;
 
-                       case Binary.Operator.LogicalAnd:
+                       case Binary.Operator.LogicalAndAlso:
                                if (left is BoolConstant && right is BoolConstant){
                                        return new BoolConstant (
                                                ((BoolConstant) left).Value &&
@@ -1007,7 +1007,7 @@ namespace Mono.CSharp {
                                }
                                break;
 
-                       case Binary.Operator.LogicalOr:
+                       case Binary.Operator.LogicalOrElse:
                                if (left is BoolConstant && right is BoolConstant){
                                        return new BoolConstant (
                                                ((BoolConstant) left).Value ||
index 545edfede593e43193681f533e417e03fc235dce..ef99bde1785382b062e52c5211d01e61ab28e06a 100644 (file)
@@ -1862,8 +1862,8 @@ namespace Mono.CSharp {
                        BitwiseAnd,
                        ExclusiveOr,
                        BitwiseOr,
-                       LogicalAnd,
-                       LogicalOr,
+                       LogicalAndAlso,
+                       LogicalOrElse,
                        TOP
                }
 
@@ -1893,8 +1893,8 @@ namespace Mono.CSharp {
                        oper_names [(int) Operator.BitwiseAnd] = "op_BitwiseAnd";
                        oper_names [(int) Operator.BitwiseOr] = "op_BitwiseOr";
                        oper_names [(int) Operator.ExclusiveOr] = "op_ExclusiveOr";
-                       oper_names [(int) Operator.LogicalOr] = "op_LogicalOr";
-                       oper_names [(int) Operator.LogicalAnd] = "op_LogicalAnd";
+                       oper_names [(int) Operator.LogicalOrElse] = "op_LogicalOr";
+                       oper_names [(int) Operator.LogicalAndAlso] = "op_LogicalAnd";
                }
 
                public Binary (Operator oper, Expression left, Expression right, Location loc)
@@ -1971,10 +1971,10 @@ namespace Mono.CSharp {
                                return "|";
                        case Operator.ExclusiveOr:
                                return "^";
-                       case Operator.LogicalOr:
-                               return "||";
-                       case Operator.LogicalAnd:
-                               return "&&";
+                       case Operator.LogicalOrElse:
+                               return "OrElse";
+                       case Operator.LogicalAndAlso:
+                               return "AndAlso";
                        }
 
                        return oper.ToString ();
@@ -2648,7 +2648,7 @@ namespace Mono.CSharp {
                        if (oper == Operator.LeftShift || oper == Operator.RightShift)
                                return CheckShiftArguments (ec);
 
-                       if (oper == Operator.LogicalOr || oper == Operator.LogicalAnd){
+                       if (oper == Operator.LogicalOrElse || oper == Operator.LogicalAndAlso){
                                if (l == TypeManager.bool_type && r == TypeManager.bool_type) {
                                        type = TypeManager.bool_type;
                                        return this;
@@ -2660,7 +2660,7 @@ namespace Mono.CSharp {
                                }
 
                                Expression e = new ConditionalLogicalOperator (
-                                       oper == Operator.LogicalAnd, left, right, l, loc);
+                                       oper == Operator.LogicalAndAlso, left, right, l, loc);
                                return e.Resolve (ec);
                        } 
 
@@ -2759,8 +2759,8 @@ namespace Mono.CSharp {
 
                        Constant lc = left as Constant;
                        if (lc != null && lc.Type == TypeManager.bool_type && 
-                               ((oper == Operator.LogicalAnd && (bool)lc.GetValue () == false) ||
-                                (oper == Operator.LogicalOr && (bool)lc.GetValue () == true))) {
+                               ((oper == Operator.LogicalAndAlso && (bool)lc.GetValue () == false) ||
+                                (oper == Operator.LogicalOrElse && (bool)lc.GetValue () == true))) {
 
                                // TODO: make a sense to resolve unreachable expression as we do for statement
                                Report.Warning (429, 4, loc, "Unreachable expression code detected");
@@ -2835,7 +2835,7 @@ namespace Mono.CSharp {
                                        return;
                                }
 
-                       } else if (oper == Operator.LogicalAnd) {
+                       } else if (oper == Operator.LogicalAndAlso) {
 
                                if (onTrue) {
                                                Label tests_end = ig.DefineLabel ();
@@ -2850,7 +2850,7 @@ namespace Mono.CSharp {
 
                                return;
                                                                
-                       } else if (oper == Operator.LogicalOr){
+                       } else if (oper == Operator.LogicalOrElse){
                                if (onTrue) {
                                        left.EmitBranchable (ec, target, true);
                                        right.EmitBranchable (ec, target, true);
@@ -2960,7 +2960,7 @@ namespace Mono.CSharp {
                        // Handle short-circuit operators differently
                        // than the rest
                        //
-                       if (oper == Operator.LogicalAnd) {
+                       if (oper == Operator.LogicalAndAlso) {
                                Label load_zero = ig.DefineLabel ();
                                Label end = ig.DefineLabel ();
 
@@ -2972,7 +2972,7 @@ namespace Mono.CSharp {
                                ig.Emit (OpCodes.Ldc_I4_0);
                                ig.MarkLabel (end);
                                return;
-                       } else if (oper == Operator.LogicalOr) {
+                       } else if (oper == Operator.LogicalOrElse) {
                                Label load_one = ig.DefineLabel ();
                                Label end = ig.DefineLabel ();
                                
index a4dbf328ae9e54c6c4f9060128bc341fa0ad7ce2..e5081d2610f060e07085a85cfd3911d7aac3cba7 100644 (file)
@@ -214,13 +214,13 @@ namespace Generator {
                                        prec = 2;
                                        op = "|"; break;
                                
-                               case Binary.Operator.LogicalAnd:
+                               case Binary.Operator.LogicalAndAlso:
                                        prec = 1;
-                                       op = "&&"; break;
+                                       op = "AndAlso"; break;
                                
-                               case Binary.Operator.LogicalOr:
+                               case Binary.Operator.LogicalOrElse:
                                        prec = 0;
-                                       op = "||"; break;
+                                       op = "OrElse"; break;
                                
                                case Binary.Operator.ExclusiveOr:
                                        prec = 3;
index 001efd928f11a05d58e148ed480c25fddb136109..be70c54f7a6f57aa49c7fa7cb395a97d3b55811f 100644 (file)
@@ -2624,7 +2624,7 @@ namespace Mono.CSharp {
                                }
 
                                if (((Oper == Binary.Operator.BitwiseAnd) || (Oper == Binary.Operator.BitwiseOr) ||
-                                    (Oper == Binary.Operator.LogicalAnd) || (Oper == Binary.Operator.LogicalOr)) &&
+                                    (Oper == Binary.Operator.LogicalAndAlso) || (Oper == Binary.Operator.LogicalOrElse)) &&
                                    ((left.Type == TypeManager.bool_type) && (right.Type == TypeManager.bool_type))) {
                                        Expression empty = new EmptyExpression (TypeManager.bool_type);
                                        bool_wrap = new Wrap (empty, loc).Resolve (ec);
@@ -2685,7 +2685,7 @@ namespace Mono.CSharp {
 
                                left.Emit (ec);
                                ig.Emit (OpCodes.Dup);
-                               if ((Oper == Binary.Operator.BitwiseOr) || (Oper == Binary.Operator.LogicalOr))
+                               if ((Oper == Binary.Operator.BitwiseOr) || (Oper == Binary.Operator.LogicalOrElse))
                                        ig.Emit (OpCodes.Brtrue, wrap_label);
                                else
                                        ig.Emit (OpCodes.Brfalse, wrap_label);
@@ -2695,7 +2695,7 @@ namespace Mono.CSharp {
                                        ig.Emit (OpCodes.Brfalse, right_is_null_label);
                                }
 
-                               if ((Oper == Binary.Operator.LogicalAnd) || (Oper == Binary.Operator.LogicalOr))
+                               if ((Oper == Binary.Operator.LogicalAndAlso) || (Oper == Binary.Operator.LogicalOrElse))
                                        ig.Emit (OpCodes.Pop);
 
                                right.Emit (ec);
@@ -2713,7 +2713,7 @@ namespace Mono.CSharp {
 
                                right.Emit (ec);
                                ig.Emit (OpCodes.Dup);
-                               if ((Oper == Binary.Operator.BitwiseOr) || (Oper == Binary.Operator.LogicalOr))
+                               if ((Oper == Binary.Operator.BitwiseOr) || (Oper == Binary.Operator.LogicalOrElse))
                                        ig.Emit (OpCodes.Brtrue, wrap_label);
                                else
                                        ig.Emit (OpCodes.Brfalse, wrap_label);
index 5b1135168b7ea4bb39945684b89a92a0f9137c3c..4f85e7c11c2419930c5cc5e267ac3b5af87e1998 100644 (file)
@@ -4600,12 +4600,12 @@ conditional_and_expression
        : negation_expression
        | conditional_and_expression AND negation_expression
          {
-               $$ = new Binary (Binary.Operator.LogicalAnd,
-                                (Expression) $1, (Expression) $3, lexer.Location);
+//             $$ = new Binary (Binary.Operator.LogicalAnd,
+//                              (Expression) $1, (Expression) $3, lexer.Location);
          }
        | conditional_and_expression ANDALSO negation_expression
          {     // FIXME: this is likely to be broken
-               $$ = new Binary (Binary.Operator.LogicalAnd,
+               $$ = new Binary (Binary.Operator.LogicalAndAlso,
                                 (Expression) $1, (Expression) $3, lexer.Location);
          }
        ;
@@ -4614,12 +4614,12 @@ conditional_or_expression
        : conditional_and_expression
        | conditional_or_expression OR conditional_and_expression
          {
-               $$ = new Binary (Binary.Operator.LogicalOr,
-                                (Expression) $1, (Expression) $3, lexer.Location);
+//             $$ = new Binary (Binary.Operator.LogicalOr,
+//                              (Expression) $1, (Expression) $3, lexer.Location);
          }
        | conditional_or_expression ORELSE conditional_and_expression
          {     // FIXME: this is likely to be broken
-               $$ = new Binary (Binary.Operator.LogicalOr,
+               $$ = new Binary (Binary.Operator.LogicalOrElse,
                                 (Expression) $1, (Expression) $3, lexer.Location);
          }
        ;