예제 #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
예제 #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
예제 #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
예제 #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
예제 #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
예제 #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