diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-07-28 03:49:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-07-28 03:49:40 +0000 |
| commit | 8cdf385f8d1b5eab3077964886cb2207185fd20c (patch) | |
| tree | d950055259f6bc01aca4a810462750d2cfe52afa | |
| parent | 2c76692496a96f2f6fb56496b442a3614fccaaaf (diff) | |
| download | bcm5719-llvm-8cdf385f8d1b5eab3077964886cb2207185fd20c.tar.gz bcm5719-llvm-8cdf385f8d1b5eab3077964886cb2207185fd20c.zip | |
Add support for Set statements without {}'s. Now we can just say
set Foo = bar in
def blah: blahclass {}
llvm-svn: 7355
| -rw-r--r-- | llvm/support/tools/TableGen/FileParser.y | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/llvm/support/tools/TableGen/FileParser.y b/llvm/support/tools/TableGen/FileParser.y index ab1819c554a..b0161f23175 100644 --- a/llvm/support/tools/TableGen/FileParser.y +++ b/llvm/support/tools/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 {}; |

