def p_ifstatement(p): """ if_statement : IF expression LBRACK statement_list RBRACK """ p[0] = ast.If(p[2], p[4])
def p_ifstatement_else_if(p): """ if_statement : IF expression LBRACK statement_list RBRACK ELSE if_statement """ p[0] = ast.If(p[2], p[4], p[7])
def p_ifstatement_else(p): ''' if_statement : IF expression LBRACK statement_list RBRACK ELSE LBRACK statement_list RBRACK ''' p[0] = ast.If(p[2], p[4], p[8])