summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-07-28 03:49:40 +0000
committerChris Lattner <sabre@nondot.org>2003-07-28 03:49:40 +0000
commit2e724541ff50d6b0accca34adb0fac81fd01233e (patch)
tree43e2bb5b4e66f9a7ffcd2f139401ca6632e7ce1f /utils
parentce3d64025b32d10dbaf9c77f5b1b56a09bc88f82 (diff)
downloadllvm-2e724541ff50d6b0accca34adb0fac81fd01233e.tar.gz
llvm-2e724541ff50d6b0accca34adb0fac81fd01233e.tar.bz2
llvm-2e724541ff50d6b0accca34adb0fac81fd01233e.tar.xz
Add support for Set statements without {}'s. Now we can just say
set Foo = bar in def blah: blahclass {} git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7355 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/FileParser.y21
1 files changed, 14 insertions, 7 deletions
diff --git a/utils/TableGen/FileParser.y b/utils/TableGen/FileParser.y
index ab1819c554..b0161f2317 100644
--- a/utils/TableGen/FileParser.y
+++ b/utils/TableGen/FileParser.y
@@ -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 {};