def arglist(self): """parse: ( arg_1, arg_2, ... ) """ self.dbg_msg(" ARGLIST ") args = list() lparen_tok = self.match(Token.LPAREN) while (self.peek().kind != Token.RPAREN): arg_name = self.dequeue() args.append(arg_name.val) ptok = self.peek() if (ptok.kind == Token.RPAREN): break elif (ptok.kind == Token.COMMA): self.match(Token.COMMA) else: raise ParseException(" function definition argument list " + str(ptok)) self.match(Token.RPAREN) [l, c] = lparen_tok.get_line_col() return ArgList(args, l, c, self.debug)
def p_mono_defargs(tokens): return ArgList(tokens[0].getstr())
def p_mono_callargs(tokens): return ArgList(tokens[0])