Пример #1
0
 def p_if_statement_2(self, p):
     """if_statement : IF LPAREN expr RPAREN statement ELSE statement"""
     p[0] = ast.If(predicate=p[3], consequent=p[5], alternative=p[7],
         lineno=p.lineno(3))
Пример #2
0
 def p_if_statement_1(self, p):
     """if_statement : IF LPAREN expr RPAREN statement"""
     p[0] = ast.If(predicate=p[3], consequent=p[5], lineno=p.lineno(3))