[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-patches
Subject:    [Mono-patches] mcs/mbas ChangeLog,1.209,1.210 mb-parser.jay,1.139,1.140
From:       anirban () mono-cvs ! ximian ! com (B Anirban <banirban () novell ! com>)
Date:       2004-09-30 12:12:20
Message-ID: 20040930121220.2EDDF94762 () mono-cvs ! ximian ! com
[Download RAW message or body]

Update of /cvs/public/mcs/mbas
In directory mono-cvs.ximian.com:/tmp/cvs-serv31457

Modified Files:
	ChangeLog mb-parser.jay 
Log Message:
2004-09-30 Anirban Bhattacharjee <banirban@novell.com>
        * mb-parser.jay: Unnecessary to and fro conversion of types
                        is removed from AddHandler function


Index: ChangeLog
===================================================================
RCS file: /cvs/public/mcs/mbas/ChangeLog,v
retrieving revision 1.209
retrieving revision 1.210
diff -u -d -r1.209 -r1.210
--- ChangeLog	23 Sep 2004 12:31:15 -0000	1.209
+++ ChangeLog	30 Sep 2004 12:12:18 -0000	1.210
@@ -1,3 +1,7 @@
+2004-09-30 Anirban Bhattacharjee <banirban@novell.com>
+	* mb-parser.jay: Unnecessary to and fro conversion of types
+			is removed from AddHandler function
+
 2004-09-23 Anirban Bhattacharjee <banirban@novell.com>
 	* expression.cs: Enhanced mbas to resolve Default property or indexer
 

Index: mb-parser.jay
===================================================================
RCS file: /cvs/public/mcs/mbas/mb-parser.jay,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -d -r1.139 -r1.140
--- mb-parser.jay	21 Sep 2004 12:57:09 -0000	1.139
+++ mb-parser.jay	30 Sep 2004 12:12:18 -0000	1.140
@@ -2341,8 +2341,8 @@
 	| statement_list end_of_stmt statement
 	;
 	
-statement : 
-	    declaration_statement
+statement 
+	  : declaration_statement
 	    {
 		  if ($1 != null && (Block) $1 != current_block){
 			current_block.AddStatement ((Statement) $1);
@@ -3656,7 +3656,6 @@
 		string name = (string) $1;
 		$$ = DecomposeQI (name, lexer.Location);
 	  }
-	//FIXME: address_of_expression is apparently missing here
 	| get_type_expression
 	| member_access
 	| invocation_expression
@@ -3749,7 +3748,7 @@
 		}
 	  }
 	;
-
+	
 predefined_type
 	: builtin_types
 	;
@@ -4768,36 +4767,19 @@
 
 private void AddHandler (Block b, Expression evt_id, Expression handles_exp)
 {
-   	Location loc = lexer.Location;
-   	if (handles_exp is MemberAccess) {
-		string evt_def = ((MemberAccess)handles_exp).ToString();
-		string evt_target = evt_id.ToString();
-   		evt_target = evt_target.Substring (0, evt_target.LastIndexOf('.'));
-		
-		Statement addhnd = (Statement) new AddHandler (evt_id, 
-							DecomposeQI(evt_def, loc), 
-							DecomposeQI(evt_target, loc), loc);
-
-		b.AddStatement (addhnd);
-	} else if (handles_exp is SimpleName) {
-		string evt_def = ((SimpleName)handles_exp).ToString();
-		string evt_target = evt_id.ToString();
-   		evt_target = evt_target.Substring (0, evt_target.LastIndexOf('.'));
+	Expression evt_target;
+	Location loc = lexer.Location;
+	
+	if (evt_id is MemberAccess)
+		evt_target = ((MemberAccess)evt_id).Expr;
+	else
+		evt_target = (new This (current_block, lexer.Location));
 		
-		Statement addhnd = (Statement) new AddHandler (evt_id, 
-							DecomposeQI(evt_def, loc), 
-							DecomposeQI(evt_target, loc), loc);
-
-		b.AddStatement (addhnd);
-
-	} else if (handles_exp is BaseAccess) {
-		string evt_def = ((BaseAccess) handles_exp).member;
-		Statement addhnd = (Statement) new AddHandler (evt_id, 
-									DecomposeQI(evt_def, loc), 
-									handles_exp, loc);	
-									
-		b.AddStatement (addhnd);
-	}
+	Statement addhnd = (Statement) new AddHandler (evt_id, 
+													handles_exp, 
+													evt_target, 
+													loc);
+	b.AddStatement (addhnd);
 }
 
 private void RaiseEvent (string evt_name, ArrayList args)

_______________________________________________
Mono-patches maillist  -  Mono-patches@ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic