Author: jambunathan
Date: 2005-03-26 03:43:08 -0500 (Sat, 26 Mar 2005)
New Revision: 42264
Modified:
trunk/mcs/bmcs/ChangeLog
trunk/mcs/bmcs/expression.cs
trunk/mcs/bmcs/mb-parser.jay
Log:
* expression.cs (Binary.Operator): Added Exponentiation,
Concatenation, Like, Is and IntegerDivision opeartors
* mb-parser.jay: Changes relating to the above changes.
Modified: trunk/mcs/bmcs/ChangeLog
===================================================================
--- trunk/mcs/bmcs/ChangeLog 2005-03-26 07:55:44 UTC (rev 42263)
+++ trunk/mcs/bmcs/ChangeLog 2005-03-26 08:43:08 UTC (rev 42264)
@@ -1,5 +1,12 @@
2005-03-26 Jambunathan K <[EMAIL PROTECTED]>
+ * expression.cs (Binary.Operator): Added Exponentiation,
+ Concatenation, Like, Is and IntegerDivision opeartors
+
+ * mb-parser.jay: Changes relating to the above changes.
+
+2005-03-26 Jambunathan K <[EMAIL PROTECTED]>
+
* expression.cs (Binary.Operator): Renamed LogicalAnd/LogicalOr to
LogicalAndAlso and LogicalOrElse.
Modified: trunk/mcs/bmcs/expression.cs
===================================================================
--- trunk/mcs/bmcs/expression.cs 2005-03-26 07:55:44 UTC (rev 42263)
+++ trunk/mcs/bmcs/expression.cs 2005-03-26 08:43:08 UTC (rev 42264)
@@ -1854,16 +1854,17 @@
/// </summary>
public class Binary : Expression {
public enum Operator : byte {
- Multiply, Division, Modulus,
+ Exponentiation,
+ Multiply, Division,
+ IntegerDivision,
+ Modulus,
Addition, Subtraction,
+ Concatenation,
LeftShift, RightShift,
- LessThan, GreaterThan, LessThanOrEqual,
GreaterThanOrEqual,
- Equality, Inequality,
- BitwiseAnd,
+ Equality, Inequality, LessThan, GreaterThan,
LessThanOrEqual, GreaterThanOrEqual, Like, Is,
+ BitwiseAnd, LogicalAndAlso,
+ BitwiseOr, LogicalOrElse,
ExclusiveOr,
- BitwiseOr,
- LogicalAndAlso,
- LogicalOrElse,
TOP
}
Modified: trunk/mcs/bmcs/mb-parser.jay
===================================================================
--- trunk/mcs/bmcs/mb-parser.jay 2005-03-26 07:55:44 UTC (rev 42263)
+++ trunk/mcs/bmcs/mb-parser.jay 2005-03-26 08:43:08 UTC (rev 42264)
@@ -4490,8 +4490,7 @@
: multiplicative_expression
| integer_division_expression OP_IDIV multiplicative_expression
{
- //FIXME: Is this right ?
- $$ = new Binary (Binary.Operator.Division,
+ $$ = new Binary (Binary.Operator.IntegerDivision,
(Expression) $1, (Expression) $3, lexer.Location);
}
;
@@ -4509,13 +4508,13 @@
: mod_expression
| additive_expression PLUS mod_expression
{
- $$ = new Binary (Binary.Operator.Addition,
- (Expression) $1, (Expression) $3,
lexer.Location);
+ $$ = new Binary (Binary.Operator.Addition,
+ (Expression) $1, (Expression) $3,
lexer.Location);
}
| additive_expression MINUS mod_expression
{
- $$ = new Binary (Binary.Operator.Subtraction,
- (Expression) $1, (Expression) $3,
lexer.Location);
+ $$ = new Binary (Binary.Operator.Subtraction,
+ (Expression) $1, (Expression) $3,
lexer.Location);
}
;
@@ -4523,9 +4522,7 @@
: additive_expression
| concat_expression OP_CONCAT additive_expression
{
- // FIXME: This should only work for String expressions
- // We probably need to use something from the runtime
- $$ = new Binary (Binary.Operator.Addition,
+ $$ = new Binary (Binary.Operator.Concatenation,
(Expression) $1, (Expression) $3,
lexer.Location);
}
;
@@ -4534,11 +4531,13 @@
: concat_expression
| shift_expression OP_SHIFT_LEFT concat_expression
{
- // TODO
+ $$ = new Binary (Binary.Operator.LeftShift,
+ (Expression) $1, (Expression) $3,
lexer.Location);
}
| shift_expression OP_SHIFT_RIGHT concat_expression
{
- //TODO
+ $$ = new Binary (Binary.Operator.RightShift,
+ (Expression) $1, (Expression) $3,
lexer.Location);
}
;
@@ -4576,14 +4575,12 @@
}
| relational_expression IS shift_expression
{
- //FIXME: Should be a different op for reference equality but
allows tests to use Is
- $$ = new Binary (Binary.Operator.Equality,
+ $$ = new Binary (Binary.Operator.Is,
(Expression) $1, (Expression) $3,
lexer.Location);
}
| TYPEOF shift_expression IS type
{
- //FIXME: Is this rule correctly defined ?
- $$ = new Is ((Expression) $2, (Expression) $4, lexer.Location);
+ $$ = new Is ((Expression) $2, (Expression) $4, lexer.Location);
}
;
@@ -4591,8 +4588,7 @@
: relational_expression
| NOT negation_expression
{
- //FIXME: Is this rule correctly defined ?
- $$ = new Unary (Unary.Operator.LogicalNot, (Expression) $2,
lexer.Location);
+ $$ = new Unary (Unary.Operator.OnesComplement, (Expression) $2,
lexer.Location);
}
;
@@ -4600,11 +4596,11 @@
: negation_expression
| conditional_and_expression AND negation_expression
{
-// $$ = new Binary (Binary.Operator.LogicalAnd,
-// (Expression) $1, (Expression) $3,
lexer.Location);
+ $$ = new Binary (Binary.Operator.BitwiseAnd,
+ (Expression) $1, (Expression) $3,
lexer.Location);
}
| conditional_and_expression ANDALSO negation_expression
- { // FIXME: this is likely to be broken
+ {
$$ = new Binary (Binary.Operator.LogicalAndAlso,
(Expression) $1, (Expression) $3,
lexer.Location);
}
@@ -4614,11 +4610,11 @@
: 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.BitwiseOr,
+ (Expression) $1, (Expression) $3,
lexer.Location);
}
| conditional_or_expression ORELSE conditional_and_expression
- { // FIXME: this is likely to be broken
+ {
$$ = new Binary (Binary.Operator.LogicalOrElse,
(Expression) $1, (Expression) $3,
lexer.Location);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches