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;
71 virtual void finishRun() = 0;
89 void parseLevel(
bool HasOpeningBrace);
91 bool MunchSemi =
true);
92 void parseChildBlock();
93 void parsePPDirective();
95 void parsePPIf(
bool IfDef);
99 void parsePPUnknown();
100 void readTokenWithJavaScriptASI();
101 void parseStructuralElement();
102 bool tryToParseBracedList();
103 bool parseBracedList(
bool ContinueOnSemicolons =
false,
107 void parseIfThenElse();
108 void parseTryCatch();
109 void parseForOrWhileLoop();
112 void parseCaseLabel();
114 void parseNamespace();
116 void parseAccessSpecifier();
118 void parseJavaEnumBody();
122 void parseRecord(
bool ParseAsExpr =
false);
123 void parseObjCMethod();
124 void parseObjCProtocolList();
125 void parseObjCUntilAtEnd();
126 void parseObjCInterfaceOrImplementation();
127 bool parseObjCProtocol();
128 void parseJavaScriptEs6ImportExport();
129 bool tryToParseLambda();
130 bool tryToParseLambdaIntroducer();
131 void tryToParseJSFunction();
132 void addUnwrappedLine();
138 void nextToken(
int LevelDifference = 0);
139 void readToken(
int LevelDifference = 0);
155 void flushComments(
bool NewlineBeforeNext);
157 void calculateBraceTypes(
bool ExpectClassBody =
false);
163 void conditionalCompilationCondition(
bool Unreachable);
164 void conditionalCompilationStart(
bool Unreachable);
165 void conditionalCompilationAlternative();
166 void conditionalCompilationEnd();
173 size_t computePPHash()
const;
178 std::unique_ptr<UnwrappedLine>
Line;
186 bool MustBreakBeforeNextToken;
204 std::vector<bool> DeclarationScopeStack;
209 llvm::Regex CommentPragmasRegex;
227 PPBranch(PPBranchKind
Kind,
size_t Line) :
Kind(Kind),
Line(Line) {}
254 std::stack<int> PPChainBranchIndex;
258 enum IncludeGuardState {
267 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.