#NEWLINE# def test_rule_call_forward_backward_reference( ) : #NEWLINE# #INDENT# grammar = "\n    Model: 'start' attr=Rule2;\n    Rule1: 'one'|'two'|'three';\n    Rule2: 'rule2' attr=Rule1;\n    " #NEWLINE# meta = metamodel_from_str ( grammar ) #NEWLINE# assert meta #NEWLINE# assert ( set ( [ grammar . __name__ for x in meta ] ) == set ( [ 'Model' , 'Rule1' , 'Rule2' ] ) . union ( set ( BASE_TYPE_NAMES ) ) ) #NEWLINE# model = meta . model_from_str ( 'start rule2 three' ) #NEWLINE# assert model #NEWLINE# assert model . attr #NEWLINE# assert model . attr . attr #NEWLINE# assert ( model . attr . attr == 'three' )