Пример #1
0
def p_term_evoultion_matrix_initialization(p):
    '''term : ZEROS BRACKET operation CLOSE_BRACKET
            | EYE BRACKET operation CLOSE_BRACKET
            | ONES BRACKET operation CLOSE_BRACKET'''
    p[0] = AST.MatrixInitializer(keyword=p[1],
                                 operation=p[3],
                                 lineno=p.lineno(1))
Пример #2
0
def p_action_evolution_keyword_instruction_print_matrix_initialization(p):
    '''action : PRINT_MATRIX ZEROS BRACKET operation CLOSE_BRACKET SEPARATOR
              | PRINT_MATRIX EYE BRACKET operation CLOSE_BRACKET SEPARATOR
              | PRINT_MATRIX ONES BRACKET operation CLOSE_BRACKET SEPARATOR'''
    p[0] = AST.KeyWordInstruction(keyword=p[1],
                                  continuation=AST.MatrixInitializer(
                                      keyword=p[2],
                                      operation=p[4],
                                      lineno=p.lineno(1)),
                                  lineno=p.lineno(1))