Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
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
Esempio n. 4
0
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
Esempio n. 5
0
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
Esempio n. 6
0
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