def test_parser_code_production(self):
		s = "S -> A B C\n"
		s +="A -> a A | &\n"
		s +="B -> b B | A C d\n"
		s +="C -> c C | &"
		g = Grammar.text_to_grammar(s)
		r = RecursiveDescentParser(g)

		c = '''\
	A()
	B()
	C()'''
		self.assertEqual(c.strip(),r._parser_code_production(Production('S','A B C'),'S').strip())

		c = '''\
	if current_symbol == 'a':
		next_lexic_symbol()
	else:
		raise Exception('A','a',current_symbol)
	A()'''
		self.assertEqual(c.strip(),r._parser_code_production(Production('A','a A'),'A').strip())

		c = '''\
	A()
	C()
	if current_symbol == 'd':
		next_lexic_symbol()
	else:
		raise Exception('B','d',current_symbol)'''
		self.assertEqual(c.strip(),r._parser_code_production(Production('B','A C d'),'B').strip())