Esempio n. 1
0
 def p_if_statement__if_else(self, p):
     "if_statement : IF '(' expr ')' statements ELSE statements"
     p[0] = ast.IfStatementAST(self, p[3], p[5], p[7])
Esempio n. 2
0
 def p_statement__if_else_if(self, p):
     "if_statement : IF '(' expr ')' statements ELSE if_statement"
     p[0] = ast.IfStatementAST(self, p[3], p[5],
                               ast.StatementListAST(self, p[7]))
Esempio n. 3
0
 def p_if_statement__if(self, p):
     "if_statement : IF '(' expr ')' statements"
     p[0] = ast.IfStatementAST(self, p[3], p[5], None)