diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-08-10 22:04:25 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-08-10 22:04:25 +0000 |
| commit | 4eaf72fc3b8bc8fa44dbfbee48e2c049f3a0f52e (patch) | |
| tree | 3c9a45d16078df7e763f03ead7c7afbace193c00 /llvm/support/tools | |
| parent | ba2cf32f009d1051f7372a73db61f9d1b0c51a28 (diff) | |
| download | bcm5719-llvm-4eaf72fc3b8bc8fa44dbfbee48e2c049f3a0f52e.tar.gz bcm5719-llvm-4eaf72fc3b8bc8fa44dbfbee48e2c049f3a0f52e.zip | |
Recognize $foo as a variable
llvm-svn: 7712
Diffstat (limited to 'llvm/support/tools')
| -rw-r--r-- | llvm/support/tools/TableGen/FileLexer.l | 2 | ||||
| -rw-r--r-- | llvm/support/tools/TableGen/FileParser.y | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/support/tools/TableGen/FileLexer.l b/llvm/support/tools/TableGen/FileLexer.l index 4f54a520a0c..98370a7fef5 100644 --- a/llvm/support/tools/TableGen/FileLexer.l +++ b/llvm/support/tools/TableGen/FileLexer.l @@ -166,6 +166,8 @@ in { return IN; } {Identifier} { Filelval.StrVal = new std::string(yytext, yytext+yyleng); return ID; } +${Identifier} { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng); + return VARNAME; } {StringVal} { Filelval.StrVal = new std::string(yytext+1, yytext+yyleng-1); return STRVAL; } diff --git a/llvm/support/tools/TableGen/FileParser.y b/llvm/support/tools/TableGen/FileParser.y index 0ab3e5bde0c..5b983eb06c7 100644 --- a/llvm/support/tools/TableGen/FileParser.y +++ b/llvm/support/tools/TableGen/FileParser.y @@ -171,7 +171,7 @@ static void addSubClass(Record *SC, const std::vector<Init*> &TemplateArgs) { %token INT BIT STRING BITS LIST CODE DAG CLASS DEF FIELD LET IN %token <IntVal> INTVAL -%token <StrVal> ID STRVAL CODEFRAGMENT +%token <StrVal> ID VARNAME STRVAL CODEFRAGMENT %type <Ty> Type %type <Rec> ClassInst DefInst Object ObjectBody ClassID |

