From c16b1ce7a09e7091f2482c9d898bc4f7ac73fe29 Mon Sep 17 00:00:00 2001 From: François Pottier Date: Wed, 7 Oct 2015 10:53:26 +0200 Subject: Factorized the two forms of FOR statement by introducing [for_statement_header]. This leads to a smaller automaton. --- cparser/pre_parser.mly | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cparser/pre_parser.mly') diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly index 62a57618..d6097ec1 100644 --- a/cparser/pre_parser.mly +++ b/cparser/pre_parser.mly @@ -772,8 +772,12 @@ iteration_statement(openc,last_statement): | WHILE openc LPAREN expression RPAREN last_statement | DO open_context statement_finish_close WHILE openc LPAREN expression RPAREN close_context SEMICOLON -| FOR openc LPAREN optional(expression, SEMICOLON) optional(expression, SEMICOLON) optional(expression, RPAREN) last_statement -| FOR openc LPAREN declaration optional(expression, SEMICOLON) optional(expression, RPAREN) last_statement +| FOR openc LPAREN for_statement_header optional(expression, SEMICOLON) optional(expression, RPAREN) last_statement + {} + +for_statement_header: +| optional(expression, SEMICOLON) +| declaration {} asm_attributes: -- cgit