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
+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)
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
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 &&
}
break;
- case Binary.Operator.LogicalOr:
+ case Binary.Operator.LogicalOrElse:
if (left is BoolConstant && right is BoolConstant){
return new BoolConstant (
((BoolConstant) left).Value ||
BitwiseAnd,
ExclusiveOr,
BitwiseOr,
- LogicalAnd,
- LogicalOr,
+ LogicalAndAlso,
+ LogicalOrElse,
TOP
}
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)
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 ();
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;
}
Expression e = new ConditionalLogicalOperator (
- oper == Operator.LogicalAnd, left, right, l, loc);
+ oper == Operator.LogicalAndAlso, left, right, l, loc);
return e.Resolve (ec);
}
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");
return;
}
- } else if (oper == Operator.LogicalAnd) {
+ } else if (oper == Operator.LogicalAndAlso) {
if (onTrue) {
Label tests_end = ig.DefineLabel ();
return;
- } else if (oper == Operator.LogicalOr){
+ } else if (oper == Operator.LogicalOrElse){
if (onTrue) {
left.EmitBranchable (ec, target, true);
right.EmitBranchable (ec, target, true);
// 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 ();
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 ();
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;
}
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);
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);
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);
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);
: 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);
}
;
: 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);
}
;