15 #ifndef LLVM_CLANG_LIB_FORMAT_UNWRAPPEDLINEPARSER_H 16 #define LLVM_CLANG_LIB_FORMAT_UNWRAPPEDLINEPARSER_H 21 #include "llvm/Support/Regex.h" 28 struct UnwrappedLineNode;
70 virtual void finishRun() = 0;
87 void parseLevel(
bool HasOpeningBrace);
89 bool MunchSemi =
true);
90 void parseChildBlock();
91 void parsePPDirective();
93 void parsePPIf(
bool IfDef);
97 void parsePPUnknown();
98 void readTokenWithJavaScriptASI();
99 void parseStructuralElement();
100 bool tryToParseBracedList();
101 bool parseBracedList(
bool ContinueOnSemicolons =
false,
105 void parseIfThenElse();
106 void parseTryCatch();
107 void parseForOrWhileLoop();
110 void parseCaseLabel();
112 void parseNamespace();
114 void parseAccessSpecifier();
116 void parseJavaEnumBody();
120 void parseRecord(
bool ParseAsExpr =
false);
121 void parseObjCMethod();
122 void parseObjCProtocolList();
123 void parseObjCUntilAtEnd();
124 void parseObjCInterfaceOrImplementation();
125 bool parseObjCProtocol();
126 void parseJavaScriptEs6ImportExport();
127 void parseStatementMacro();
128 bool tryToParseLambda();
129 bool tryToParseLambdaIntroducer();
130 void tryToParseJSFunction();
131 void addUnwrappedLine();
137 void nextToken(
int LevelDifference = 0);
138 void readToken(
int LevelDifference = 0);
154 void flushComments(
bool NewlineBeforeNext);
156 void calculateBraceTypes(
bool ExpectClassBody =
false);
162 void conditionalCompilationCondition(
bool Unreachable);
163 void conditionalCompilationStart(
bool Unreachable);
164 void conditionalCompilationAlternative();
165 void conditionalCompilationEnd();
172 size_t computePPHash()
const;
177 std::unique_ptr<UnwrappedLine>
Line;
185 bool MustBreakBeforeNextToken;
203 std::vector<bool> DeclarationScopeStack;
208 llvm::Regex CommentPragmasRegex;
226 PPBranch(PPBranchKind
Kind,
size_t Line) :
Kind(Kind),
Line(Line) {}
253 std::stack<int> PPChainBranchIndex;
257 enum IncludeGuardState {
266 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.