summaryrefslogtreecommitdiff
path: root/src/mem/slicc/parser/lexer.ll
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-07-06 15:49:47 -0700
committerNathan Binkert <nate@binkert.org>2009-07-06 15:49:47 -0700
commit92de70b69aaf3f399a855057b556ed198139e5d8 (patch)
treef8e7d0d494df8810cc960be4c52d8b555471f157 /src/mem/slicc/parser/lexer.ll
parent05f6a4a6b92370162da17ef5cccb5a7e3ba508e5 (diff)
downloadgem5-92de70b69aaf3f399a855057b556ed198139e5d8.tar.xz
ruby: Import the latest ruby changes from gems.
This was done with an automated process, so there could be things that were done in this tree in the past that didn't make it. One known regression is that atomic memory operations do not seem to work properly anymore.
Diffstat (limited to 'src/mem/slicc/parser/lexer.ll')
-rw-r--r--src/mem/slicc/parser/lexer.ll9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mem/slicc/parser/lexer.ll b/src/mem/slicc/parser/lexer.ll
index a4af2ac51..b2d36855b 100644
--- a/src/mem/slicc/parser/lexer.ll
+++ b/src/mem/slicc/parser/lexer.ll
@@ -1,3 +1,4 @@
+
/*
* Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
* All rights reserved.
@@ -26,11 +27,15 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ * $Id$
+ */
+
%{
#include <assert.h>
#include "mem/slicc/ast/ASTs.hh"
-#include "mem/slicc/parser/parser.hh"
+#include "parser.hh"
#include <string>
extern "C" int yylex();
@@ -76,6 +81,7 @@ return { return RETURN; }
THIS { return THIS; }
CHIP { return CHIP; }
void { yylval.str_ptr = new string(yytext); return VOID; }
+new { return NEW; }
== { yylval.str_ptr = new string(yytext); return EQ; }
!= { yylval.str_ptr = new string(yytext); return NE; }
@@ -108,6 +114,7 @@ void { yylval.str_ptr = new string(yytext); return VOID; }
[0-9]*[.][0-9]* { yylval.str_ptr = new string(yytext); return FLOATNUMBER; }
[0-9]* { yylval.str_ptr = new string(yytext); return NUMBER; }
+
[a-zA-Z_][a-zA-Z_0-9]{0,50} { yylval.str_ptr = new string(yytext); return IDENT; }
\"[^"\n]*\" { yytext[strlen(yytext)-1] = '\0'; yylval.str_ptr = new string(yytext+1); return STRING; }
\'[^'\n]*\' { yytext[strlen(yytext)-1] = '\0'; yylval.str_ptr = new string(yytext+1); return STRING; }