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