From ed814899541d65783e93a37ab320650c5075c72d Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Fri, 29 Jan 2010 20:29:19 -0800 Subject: ruby: Ruby changes required to use the python config system This patch includes the necessary changes to connect ruby objects using the python configuration system. Mainly it consists of removing unnecessary ruby object pointers and connecting the necessary object pointers using the generated param objects. This patch includes the slicc changes necessary to connect generated ruby objects together using the python configuraiton system. --- src/mem/slicc/parser.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mem/slicc/parser.py') diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py index 891f22973..4db034bab 100644 --- a/src/mem/slicc/parser.py +++ b/src/mem/slicc/parser.py @@ -154,6 +154,7 @@ class SLICC(Grammar): 'copy_head' : 'COPY_HEAD', 'check_allocate' : 'CHECK_ALLOCATE', 'check_stop_slots' : 'CHECK_STOP_SLOTS', + 'static_cast' : 'STATIC_CAST', 'if' : 'IF', 'else' : 'ELSE', 'return' : 'RETURN', @@ -416,6 +417,10 @@ class SLICC(Grammar): "param : type ident" p[0] = ast.FormalParamAST(self, p[1], p[2]) + def p_param__pointer(self, p): + "param : type STAR ident" + p[0] = ast.FormalParamAST(self, p[1], p[3], None, True) + def p_param__default(self, p): "param : type ident '=' NUMBER" p[0] = ast.FormalParamAST(self, p[1], p[2], p[4]) @@ -531,6 +536,10 @@ class SLICC(Grammar): "statement : CHECK_STOP_SLOTS '(' var ',' STRING ',' STRING ')' SEMI" p[0] = ast.CheckStopStatementAST(self, p[3], p[5], p[7]) + def p_statement__static_cast(self, p): + "aexpr : STATIC_CAST '(' type ',' expr ')'" + p[0] = ast.StaticCastAST(self, p[3], p[5]) + def p_statement__return(self, p): "statement : RETURN expr SEMI" p[0] = ast.ReturnStatementAST(self, p[2]) -- cgit v1.2.3