Пример #1
0
def p_matrix_element_evolution(p):
    '''matrix_element : ID SQ_BRACKET sequence CLOSE_SQ_BRACKET'''
    p[0] = AST.MatrixElement(identifier=AST.Variable(name=p[1],
                                                     lineno=p.lineno(1)),
                             indexing_sequence=p[3],
                             lineno=p.lineno(1))
Пример #2
0
def p_action_evolution_keyword_instruction_print_matrix_identifier(p):
    '''action : PRINT_MATRIX ID SEPARATOR'''
    p[0] = AST.KeyWordInstruction(keyword=p[1],
                                  continuation=AST.Variable(
                                      name=p[2], lineno=p.lineno(1)),
                                  lineno=p.lineno(1))
Пример #3
0
def p_lvalue_evolution_variable(p):
    '''lvalue : ID'''
    p[0] = AST.Variable(name=p[1], lineno=p.lineno(1))
Пример #4
0
def p_for_looping_evolution(p):
    '''for_looping : FOR ID ASSIGN operation RANGE operation block'''
    p[0] = AST.ForLooping(iterator=AST.Variable(name=p[2], lineno=p.lineno(2)),
                          start=p[4],
                          end=p[6],
                          body=p[7])