Example #1
0
def p_ifstatement(p):
    """
    if_statement : IF expression LBRACK statement_list RBRACK
    """
    p[0] = ast.If(p[2], p[4])
Example #2
0
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])
Example #3
0
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])