Add support for Set statements without {}'s. Now we can just say
authorChris Lattner <sabre@nondot.org>
Mon, 28 Jul 2003 03:49:40 +0000 (03:49 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 28 Jul 2003 03:49:40 +0000 (03:49 +0000)
set Foo = bar in
  def blah: blahclass {}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7355 91177308-0d34-0410-b5e6-96231b3b80d8

support/tools/TableGen/FileParser.y
utils/TableGen/FileParser.y

index ab1819c554a94a0a46b04e551d5b4c755538233c..b0161f2317526f463cffbf17aec6fec861a881a8 100644 (file)
@@ -438,13 +438,20 @@ DefInst : DEF ObjectBody {
 
 Object : ClassInst | DefInst;
 
-// Support Set commands wrapping objects...
-Object : SET ID OptBitList '=' Value IN {
-            SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
-           delete $2;
-          } '{' ObjectList '}' {
-           delete SetStack.back().first.second; // Delete OptBitList
-           SetStack.pop_back();
+// SETCommand - A 'SET' statement start...
+SETCommand : SET ID OptBitList '=' Value IN {
+  SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
+  delete $2;
+};
+
+// Support Set commands wrapping objects... both with and without braces.
+Object : SETCommand '{' ObjectList '}' {
+    delete SetStack.back().first.second; // Delete OptBitList
+    SetStack.pop_back();
+  }
+  | SETCommand Object {
+    delete SetStack.back().first.second; // Delete OptBitList
+    SetStack.pop_back();
   };
 
 ObjectList : Object {} | ObjectList Object {};
index ab1819c554a94a0a46b04e551d5b4c755538233c..b0161f2317526f463cffbf17aec6fec861a881a8 100644 (file)
@@ -438,13 +438,20 @@ DefInst : DEF ObjectBody {
 
 Object : ClassInst | DefInst;
 
-// Support Set commands wrapping objects...
-Object : SET ID OptBitList '=' Value IN {
-            SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
-           delete $2;
-          } '{' ObjectList '}' {
-           delete SetStack.back().first.second; // Delete OptBitList
-           SetStack.pop_back();
+// SETCommand - A 'SET' statement start...
+SETCommand : SET ID OptBitList '=' Value IN {
+  SetStack.push_back(std::make_pair(std::make_pair(*$2, $3), $5));
+  delete $2;
+};
+
+// Support Set commands wrapping objects... both with and without braces.
+Object : SETCommand '{' ObjectList '}' {
+    delete SetStack.back().first.second; // Delete OptBitList
+    SetStack.pop_back();
+  }
+  | SETCommand Object {
+    delete SetStack.back().first.second; // Delete OptBitList
+    SetStack.pop_back();
   };
 
 ObjectList : Object {} | ObjectList Object {};