Пример #1
0
 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"
Пример #2
0
 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"
Пример #3
0
 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"
Пример #4
0
 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"
Пример #5
0
 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