summaryrefslogtreecommitdiff
path: root/src/mem/slicc/parser.py
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-08-30 10:52:58 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-08-30 10:52:58 -0500
commit426e38af8b112c5b78dd36f88e66e28f55f27ecd (patch)
tree816058a6290c911cac7bbca9e478b2bf3d4ec9a5 /src/mem/slicc/parser.py
parent4727fc26f885d09f07f18a10fabe6c75dffe165f (diff)
downloadgem5-426e38af8b112c5b78dd36f88e66e28f55f27ecd.tar.xz
ruby: slicc: avoid duplicate code for function argument check
Both FuncCallExprAST and MethodCallExprAST had code for checking the arguments with which a function is being called. The patch does away with this duplication. Now the code for checking function call arguments resides in the Func class.
Diffstat (limited to 'src/mem/slicc/parser.py')
-rw-r--r--src/mem/slicc/parser.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py
index 0cbe9ea63..49177345d 100644
--- a/src/mem/slicc/parser.py
+++ b/src/mem/slicc/parser.py
@@ -669,15 +669,18 @@ class SLICC(Grammar):
def p_expr__member_method_call(self, p):
"aexpr : aexpr DOT ident '(' exprs ')'"
- p[0] = ast.MemberMethodCallExprAST(self, p[1], p[3], p[5])
+ p[0] = ast.MemberMethodCallExprAST(self, p[1],
+ ast.FuncCallExprAST(self, p[3], p[5]))
def p_expr__member_method_call_lookup(self, p):
"aexpr : aexpr '[' exprs ']'"
- p[0] = ast.MemberMethodCallExprAST(self, p[1], "lookup", p[3])
+ p[0] = ast.MemberMethodCallExprAST(self, p[1],
+ ast.FuncCallExprAST(self, "lookup", p[3]))
def p_expr__class_method_call(self, p):
"aexpr : type DOUBLE_COLON ident '(' exprs ')'"
- p[0] = ast.ClassMethodCallExprAST(self, p[1], p[3], p[5])
+ p[0] = ast.ClassMethodCallExprAST(self, p[1],
+ ast.FuncCallExprAST(self, p[3], p[5]))
def p_expr__aexpr(self, p):
"expr : aexpr"