Home | History | Annotate | Download | only in Parse

Lines Matching full:statement

1 //===--- ParseStmt.cpp - Statement and Block Parser -----------------------===//
10 // This file implements the Statement and Block portions of the Parser
44 /// ParseStatementOrDeclaration - Read 'statement' or 'declaration'.
46 /// statement
49 /// statement:
50 /// labeled-statement
51 /// compound-statement
52 /// expression-statement
53 /// selection-statement
54 /// iteration-statement
55 /// jump-statement
56 /// [C++] declaration-statement
59 /// [OBC] objc-throw-statement
60 /// [OBC] objc-try-catch-statement
61 /// [OBC] objc-synchronized-statement
62 /// [GNU] asm-statement
65 /// labeled-statement:
66 /// identifier ':' statement
67 /// 'case' constant-expression ':' statement
68 /// 'default' ':' statement
70 /// selection-statement:
71 /// if-statement
72 /// switch-statement
74 /// iteration-statement:
75 /// while-statement
76 /// do-statement
77 /// for-statement
79 /// expression-statement:
82 /// jump-statement:
89 /// [OBC] objc-throw-statement:
106 "attributes on empty statement");
121 // Cases in this switch statement should fall through if the parser expects
128 case tok::at: // May be a @try or @throw statement
142 if (Next.is(tok::colon)) { // C99 6.8.1: labeled-statement
143 // identifier ':' statement
200 case tok::kw_case: // C99 6.8.1: labeled-statement
202 case tok::kw_default: // C99 6.8.1: labeled-statement
205 case tok::l_brace: // C99 6.8.2: compound-statement
212 case tok::kw_if: // C99 6.8.4.1: if-statement
214 case tok::kw_switch: // C99 6.8.4.2: switch-statement
217 case tok::kw_while: // C99 6.8.5.1: while-statement
219 case tok::kw_do: // C99 6.8.5.2: do-statement
223 case tok::kw_for: // C99 6.8.5.3: for-statement
226 case tok::kw_goto: // C99 6.8.6.1: goto-statement
230 case tok::kw_continue: // C99 6.8.6.2: continue-statement
234 case tok::kw_break: // C99 6.8.6.3: break-statement
238 case tok::kw_return: // C99 6.8.6.4: return-statement
313 // If we reached this code, the statement must end in a semicolon.
328 /// \brief Parse an expression statement.
352 // Recover parsing as a case statement.
370 /// '__try' compound-statement seh-handler
408 /// '__except' '(' seh-filter-expression ')' compound-statement
450 /// '__finally' compound-statement
466 /// labeled-statement:
467 /// identifier ':' statement
468 /// [GNU] identifier ':' attributes[opt] statement
479 // identifier ':' statement
504 /// labeled-statement:
505 statement
506 /// [GNU] 'case' constant-expression '...' constant-expression ':' statement
529 // DeepestParsedCaseStmt - This is the deepest statement we have parsed, which
600 // If this is the first case statement we parsed, it becomes TopLevelCase.
615 // If we found a non-case statement, start by parsing it.
629 // Broken sub-stmt shouldn't prevent forming the case statement properly.
636 // Return the top level parsed statement tree.
641 /// labeled-statement:
642 /// 'default' ':' statement
643 /// Note that this does not parse the 'statement' at the end.
678 // Broken sub-stmt shouldn't prevent forming the case statement properly.
692 /// compound-statement: [C99 6.8.2]
703 /// statement
731 /// statement in the compound, but may be intermingled with other pragmas.
778 "in compound statement ('{}')");
781 // compound statement.
791 // Parse any pragmas at the beginning of the compound statement.
877 // statement.
891 // Recover by creating a compound statement with what we parsed so far,
935 // continue parsing the if statement.
944 // that all callers are looking for a statement after the condition, so ")"
957 /// if-statement: [C99 6.8.4.1]
958 /// 'if' '(' expression ')' statement
959 /// 'if' '(' expression ')' statement 'else' statement
960 /// [C++] 'if' '(' condition ')' statement
961 /// [C++] 'if' '(' condition ')' statement 'else' statement
975 statement is a block. This is not
983 // Names declared in the for-init-statement, and in the condition of if,
985 // switch statement (including the controlled statement).
997 // C99 6.8.4p3 - In C99, the body of the if statement is a scope, even if
999 // if the body isn't a compound statement to avoid push/pop in common cases.
1002 // The substatement in a selection-statement (each substatement, in the else
1003 // form of the if statement) implicitly defines a local scope.
1039 // C99 6.8.4p3 - In C99, the body of the if statement is a scope, even if
1041 // this if the body isn't a compound statement to avoid push/pop in common
1045 // The substatement in a selection-statement (each substatement, in the else
1046 // form of the if statement) implicitly defines a local scope.
1086 /// switch-statement:
1087 /// 'switch' '(' expression ')' statement
1088 /// [C++] 'switch' '(' condition ')' statement
1101 // C99 6.8.4p3 - In C99, the switch statement is a block. This is
1109 // Names declared in the for-init-statement, and in the condition of if,
1111 // switch statement (including the controlled statement).
1140 // C99 6.8.4p3 - In C99, the body of the switch statement is a scope, even if
1142 // if the body isn't a compound statement to avoid push/pop in common cases.
1145 // The substatement in a selection-statement (each substatement, in the else
1146 // form of the if statement) implicitly defines a local scope.
1154 // Read the body statement.
1162 // FIXME: Remove the case statement list from the Switch statement.
1164 // Put the synthesized null statement on the same line as the end of switch
1174 /// while-statement: [C99 6.8.5.1]
1175 /// 'while' '(' expression ')' statement
1176 /// [C++] 'while' '(' condition ')' statement
1190 // C99 6.8.5p5 - In C99, the while statement is a block. This is not
1198 // Names declared in the for-init-statement, and in the condition of if,
1200 // switch statement (including the controlled statement).
1218 // C99 6.8.5p5 - In C99, the body of the if statement is a scope, even if
1220 // if the body isn't a compound statement to avoid push/pop in common cases.
1223 // The substatement in an iteration-statement implicitly defines a local scope
1232 // Read the body statement.
1246 /// do-statement: [C99 6.8.5.2]
1247 /// 'do' statement 'while' '(' expression ')' ';'
1253 // C99 6.8.5p5 - In C99, the do statement is a block. This is not
1263 // C99 6.8.5p5 - In C99, the body of the if statement is a scope, even if
1265 // if the body isn't a compound statement to avoid push/pop in common cases.
1268 // The substatement in an iteration-statement implicitly defines a local scope
1275 // Read the body statement.
1318 /// for-statement: [C99 6.8.5.3]
1319 /// 'for' '(' expr[opt] ';' expr[opt] ';' expr[opt] ')' statement
1320 /// 'for' '(' declaration expr[opt] ';' expr[opt] ')' statement
1321 /// [C++] 'for' '(' for-init-statement condition[opt] ';' expression[opt] ')'
1322 /// [C++] statement
1323 /// [C++0x] 'for' '(' for-range-declaration : for-range-initializer ) statement
1324 /// [OBJC2] 'for' '(' declaration 'in' expr ')' statement
1325 /// [OBJC2] 'for' '(' expr 'in' expr ')' statement
1327 /// [C++] for-init-statement:
1328 /// [C++] expression-statement
1349 // C99 6.8.5p5 - In C99, the for statement is a block. This is not
1357 // Names declared in the for-init-statement, and in the condition of if,
1359 // switch statement (including the controlled statement).
1361 // Names declared in the for-init-statement are in the same declarative-region
1467 // User tried to write the reasonable, but ill-formed, for-range-statement
1543 // statement immediately in order to close over temporaries correctly.
1551 // C99 6.8.5p5 - In C99, the body of the if statement is a scope, even if
1553 // if the body isn't a compound statement to avoid push/pop in common cases.
1556 // The substatement in an iteration-statement implicitly defines a local scope
1560 // for-init-statement/condition and a new scope for substatement in C++.
1565 // Read the body statement.
1590 /// jump-statement:
1625 /// jump-statement:
1636 /// jump-statement:
1647 /// jump-statement:
1903 // Is this the start of a new assembly statement?
1909 // Start each new statement with a newline and a tab.
1917 // start of a statement.
1941 // We are no longer at the start of a statement.
1954 /// this routine is called to collect the tokens for an MS asm statement.
1956 /// [MS] ms-asm-statement:
1958 /// ms-asm-block ms-asm-statement
2171 /// ParseAsmStatement - Parse a GNU extended asm statement.
2172 /// asm-statement:
2173 /// gnu-asm-statement
2174 /// ms-asm-statement
2176 /// [GNU] gnu-asm-statement:
2308 /// asm-statement, assuming the leading ':' token was eaten.
2390 // (the function body) as the body itself. Instead, just read the statement
2408 /// 'try' ctor-initializer[opt] compound-statement handler-seq
2432 // compound statement as the body.
2471 /// 'try' compound-statement handler-seq
2484 /// 'try' compound-statement handler-seq
2487 /// 'try' ctor-initializer[opt] compound-statement handler-seq
2493 /// 'try' compound-statement seh-except-block
2543 // Don't bother creating the full statement if we don't have any usable
2555 /// 'catch' '(' exception-declaration ')' compound-statement
2616 // Handle dependent statements by parsing the braces as a compound statement.
2618 // compound statement, but for Clang's type checking we can't have anything