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 | fb9ea58eb1ad43b9a82f658230b91b9e5767cba1 (patch) | |
tree | c55840b7a06a49088e256cc9e3e294cadef9b65c | |
parent | a4a53a5b93e3d989f52d8eaa5f19947995f9424f (diff) |
Recognize $foo as a variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7712 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | support/tools/TableGen/FileLexer.l | 2 | ||||
-rw-r--r-- | support/tools/TableGen/FileParser.y | 2 | ||||
-rw-r--r-- | utils/TableGen/FileLexer.l | 2 | ||||
-rw-r--r-- | utils/TableGen/FileParser.y | 2 |
4 files changed, 6 insertions, 2 deletions
diff --git a/support/tools/TableGen/FileLexer.l b/support/tools/TableGen/FileLexer.l index 4f54a520a0..98370a7fef 100644 --- a/support/tools/TableGen/FileLexer.l +++ b/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/support/tools/TableGen/FileParser.y b/support/tools/TableGen/FileParser.y index 0ab3e5bde0..5b983eb06c 100644 --- a/support/tools/TableGen/FileParser.y +++ b/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 diff --git a/utils/TableGen/FileLexer.l b/utils/TableGen/FileLexer.l index 4f54a520a0..98370a7fef 100644 --- a/utils/TableGen/FileLexer.l +++ b/utils/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/utils/TableGen/FileParser.y b/utils/TableGen/FileParser.y index 0ab3e5bde0..5b983eb06c 100644 --- a/utils/TableGen/FileParser.y +++ b/utils/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 |