16 #ifndef LLVM_CLANG_LIB_FORMAT_UNWRAPPEDLINEPARSER_H 17 #define LLVM_CLANG_LIB_FORMAT_UNWRAPPEDLINEPARSER_H 22 #include "llvm/Support/Regex.h" 29 struct UnwrappedLineNode;
67 virtual void finishRun() = 0;
85 void parseLevel(
bool HasOpeningBrace);
87 bool MunchSemi =
true);
88 void parseChildBlock();
89 void parsePPDirective();
91 void parsePPIf(
bool IfDef);
95 void parsePPUnknown();
96 void readTokenWithJavaScriptASI();
97 void parseStructuralElement();
98 bool tryToParseBracedList();
99 bool parseBracedList(
bool ContinueOnSemicolons =
false,
103 void parseIfThenElse();
104 void parseTryCatch();
105 void parseForOrWhileLoop();
108 void parseCaseLabel();
110 void parseNamespace();
112 void parseAccessSpecifier();
114 void parseJavaEnumBody();
118 void parseRecord(
bool ParseAsExpr =
false);
119 void parseObjCProtocolList();
120 void parseObjCUntilAtEnd();
121 void parseObjCInterfaceOrImplementation();
122 void parseObjCProtocol();
123 void parseJavaScriptEs6ImportExport();
124 bool tryToParseLambda();
125 bool tryToParseLambdaIntroducer();
126 void tryToParseJSFunction();
127 void addUnwrappedLine();
133 void nextToken(
int LevelDifference = 0);
134 void readToken(
int LevelDifference = 0);
150 void flushComments(
bool NewlineBeforeNext);
152 void calculateBraceTypes(
bool ExpectClassBody =
false);
158 void conditionalCompilationCondition(
bool Unreachable);
159 void conditionalCompilationStart(
bool Unreachable);
160 void conditionalCompilationAlternative();
161 void conditionalCompilationEnd();
168 size_t computePPHash()
const;
173 std::unique_ptr<UnwrappedLine>
Line;
181 bool MustBreakBeforeNextToken;
199 std::vector<bool> DeclarationScopeStack;
204 llvm::Regex CommentPragmasRegex;
222 PPBranch(PPBranchKind
Kind,
size_t Line) :
Kind(Kind),
Line(Line) {}
249 std::stack<int> PPChainBranchIndex;
253 enum IncludeGuardState {
262 IncludeGuardState IncludeGuard;
const AnnotatedLine * Line
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
Dataflow Directional Tag Classes.
Represents a complete lambda introducer.