diff options
author | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-01-29 20:29:24 -0800 |
---|---|---|
committer | Brad Beckmann <Brad.Beckmann@amd.com> | 2010-01-29 20:29:24 -0800 |
commit | d42152742ba245fd1c1611d4e7377cd31b84ed4a (patch) | |
tree | 8e1216b68b7271f436f3e8a62288c022634be3fd /src/mem/slicc | |
parent | b3d195153e243fcb3ecb7f42958cec75ed3cdd6f (diff) | |
download | gem5-d42152742ba245fd1c1611d4e7377cd31b84ed4a.tar.xz |
ruby: Allows boolean and string defaults for StateMachine parameters
Diffstat (limited to 'src/mem/slicc')
-rw-r--r-- | src/mem/slicc/parser.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py index 4db034bab..99b8fa5f4 100644 --- a/src/mem/slicc/parser.py +++ b/src/mem/slicc/parser.py @@ -421,10 +421,22 @@ class SLICC(Grammar): "param : type STAR ident" p[0] = ast.FormalParamAST(self, p[1], p[3], None, True) - def p_param__default(self, p): + def p_param__pointer_default(self, p): + "param : type STAR ident '=' STRING" + p[0] = ast.FormalParamAST(self, p[1], p[3], p[5], True) + + def p_param__default_number(self, p): "param : type ident '=' NUMBER" p[0] = ast.FormalParamAST(self, p[1], p[2], p[4]) + def p_param__default_bool(self, p): + "param : type ident '=' LIT_BOOL" + p[0] = ast.FormalParamAST(self, p[1], p[2], p[4]) + + def p_param__default_string(self, p): + "param : type ident '=' STRING" + p[0] = ast.FormalParamAST(self, p[1], p[2], p[4]) + # Idents and lists def p_idents__braced(self, p): "idents : '{' identx '}'" |