summaryrefslogtreecommitdiff
path: root/src/mem/slicc/parser.py
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2015-08-14 19:28:43 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2015-08-14 19:28:43 -0500
commit7fc725fdb55e192520c148c87ec44f75f5d07ad0 (patch)
tree077503f95730d91127d88bcd0101c38096f8aadb /src/mem/slicc/parser.py
parentf391cee5e1f9192bc35978df236e15f921a690cf (diff)
downloadgem5-7fc725fdb55e192520c148c87ec44f75f5d07ad0.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.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py
index a50907a28..07c067f68 100644
--- a/src/mem/slicc/parser.py
+++ b/src/mem/slicc/parser.py
@@ -669,11 +669,13 @@ 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__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"