[llvm-commits] CVS: llvm/utils/TableGen/FileParser.y

Chris Lattner lattner at cs.uiuc.edu
Sun Jul 27 22:50:01 PDT 2003


Changes in directory llvm/utils/TableGen:

FileParser.y updated: 1.5 -> 1.6

---
Log message:

Add support for Set statements without {}'s.  Now we can just say
set Foo = bar in
  def blah: blahclass {}


---
Diffs of the changes:

Index: llvm/utils/TableGen/FileParser.y
diff -u llvm/utils/TableGen/FileParser.y:1.5 llvm/utils/TableGen/FileParser.y:1.6
--- llvm/utils/TableGen/FileParser.y:1.5	Tue May 20 18:45:36 2003
+++ llvm/utils/TableGen/FileParser.y	Sun Jul 27 22:49:40 2003
@@ -438,13 +438,20 @@
 
 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 {};





More information about the llvm-commits mailing list