2004/07/26 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
authorRafael Teixeira <monoman@gmail.com>
Mon, 26 Jul 2004 15:18:51 +0000 (15:18 -0000)
committerRafael Teixeira <monoman@gmail.com>
Mon, 26 Jul 2004 15:18:51 +0000 (15:18 -0000)
* mb-parser.jay : First try at SyncLock Statement #53230

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

mcs/mbas/ChangeLog
mcs/mbas/mb-parser.jay
mcs/mbas/testmbas/WriteOK.vb

index 322bcde4ea16197531eb9a3656ca91154c10fb13..fe4429c7d42def910de603fb385041650aff5d04 100644 (file)
@@ -1,3 +1,6 @@
+2004/07/26  Rafael Teixeira <rafaelteixeirabr@hotmail.com>\r
+       * mb-parser.jay : First try at SyncLock Statement #53230
+
 2004-07-22 Anirban Bhattacharjee <banirban@novell.com>
        * argument.cs:
        * expression.cs:
index cd902201e0648a4696719c3243b31c35abf3f325..f324e68028f2f3a1253c3ba913c81e08a5c9d1c5 100644 (file)
@@ -2107,6 +2107,7 @@ embedded_statement
        | selection_statement
        | iteration_statement
        | try_statement
+       | synclock_statement
        | jump_statement
        | array_handling_statement 
        ;
@@ -2347,7 +2348,17 @@ yield_statement
          }
        ;
 
-
+synclock_statement
+       : SYNCLOCK expression end_of_stmt
+         {   
+               start_block();  
+         }
+         opt_statement_list 
+         END SYNCLOCK
+         {
+               $$ = new Lock ((Expression) $2, (Statement) (Block) end_block(), lexer.Location);
+         }
+       ;
 
 try_statement
        : try_catch
index d7e9cffd0283f82093ab70762c846c296ccaf3cf..7a987e3c1108b912a141ae57b2400ba15fc49b52 100644 (file)
@@ -71,8 +71,10 @@ Public Class WriteOK2
                Dim someOtherText as string = "Blah! Some Other Text"
 '              Const sometext = "Yeah! Some Text" ' FIXME: raises InvalidCastException in yyParse
 '              Const someOtherText as string = "Blah! Some Other Text" ' FIXME: raises InvalidCastException in yyParse
-               Text = "This is a test!"
-        Console.WriteLine("Sub:OK! - """ & Text & """ " & someText & " " & someOtherText)
+               SyncLock Text
+                       Text = "This is a test!"
+               Console.WriteLine("Sub:OK! - """ & Text & """ " & someText & " " & someOtherText)
+               End SyncLock
 #If CAUSEERRORS
        Yield 1
        Yield Stop