def p_component_ref(t): '''component_ref : ID | component_block''' if isinstance(t[1], Component): t[0] = t[1] else: t[0] = Reference(t[1], Component) t[0].filename = t.lexer.filename t[0].lineno = t.lexer.lineno
def p_connector_ref(t): '''connector_ref : ID | connector_block''' assert len(t) == 2 if isinstance(t[1], Connector): t[0] = t[1] else: t[0] = Reference(t[1], Connector) t[0].filename = t.lexer.filename t[0].lineno = t.lexer.lineno
def p_configuration_sing(t): '''configuration_sing : configuration ID SEMI | configuration_decl''' if len(t) == 4: t[0] = Reference(t[2], Configuration) else: assert len(t) == 2 t[0] = t[1] assert isinstance(t[0], Configuration) t[0].filename = t.lexer.filename t[0].lineno = t.lexer.lineno