def p_return_type_4(self, p): """return_type : STRING_TYPE""" print("""return_type -> STRING_TYPE""") p[0] = Nonterminal() p[0].rtype = "char*" p[0].sym_rtype = "string"
def p_return_type_3(self, p): """return_type : BOOL_TYPE""" print("""return_type -> BOOL_TYPE""") p[0] = Nonterminal() p[0].rtype = "bool" p[0].sym_rtype = "bool"
def p_return_type_1(self, p): """return_type : INT_TYPE""" print("""return_type -> INT_TYPE""") p[0] = Nonterminal() p[0].rtype = "double" p[0].sym_rtype = "int"
def p_return_type_2(self, p): """return_type : REAL_TYPE""" print("""return_type -> REAL_TYPE""") p[0] = Nonterminal() p[0].rtype = "double" p[0].sym_rtype = "real"
def p_var_type_1(self, p): """var_type : return_type""" print("""var_type -> return_type""") p[0] = Nonterminal() p[0].rtype = p[1].rtype