HPCW 3.0
Loading...
Searching...
No Matches
CMakeParser Class Reference

Public Member Functions

 CMakeParser (std::istream &is, std::ostream &os)
 
int curToken ()
 
int nextToken ()
 
void handleMacro ()
 
void handleFunction ()
 
void handleSet ()
 
void handleDoxygenComment ()
 
void handleTopLevelExpression ()
 

Detailed Description

Definition at line 239 of file CMakeDoxygenFilter.cpp.

Constructor & Destructor Documentation

◆ CMakeParser()

CMakeParser::CMakeParser ( std::istream & is,
std::ostream & os )
inline

Definition at line 244 of file CMakeDoxygenFilter.cpp.

245 : _is(is), _os(os), _lexer(is), _curToken(CMakeLexer::TOK_EOF), _lastToken(CMakeLexer::TOK_EOF)
246 { }

Member Function Documentation

◆ curToken()

int CMakeParser::curToken ( )
inline

Definition at line 248 of file CMakeDoxygenFilter.cpp.

249 {
250 return _curToken;
251 }

◆ handleDoxygenComment()

void CMakeParser::handleDoxygenComment ( )
inline

Definition at line 298 of file CMakeDoxygenFilter.cpp.

299 {
300 _os << "///" << _lexer.getIdentifier();
301 nextToken();
302 }
std::string getIdentifier() const

◆ handleFunction()

void CMakeParser::handleFunction ( )
inline

Definition at line 275 of file CMakeDoxygenFilter.cpp.

276 {
277 if(!parseFunction())
278 {
279 // skip token for error recovery
280 nextToken();
281 }
282 }

◆ handleMacro()

void CMakeParser::handleMacro ( )
inline

Definition at line 266 of file CMakeDoxygenFilter.cpp.

267 {
268 if(!parseMacro())
269 {
270 // skip token for error recovery
271 nextToken();
272 }
273 }

◆ handleSet()

void CMakeParser::handleSet ( )
inline

Definition at line 284 of file CMakeDoxygenFilter.cpp.

285 {
286 // SET(var ...) following a documentation block is assumed to be a variable declaration.
287 if (_lastToken != CMakeLexer::TOK_DOXYGEN_COMMENT)
288 {
289 // No comment block before
290 nextToken();
291 } else if(!parseSet())
292 {
293 // skip token for error recovery
294 nextToken();
295 }
296 }

◆ handleTopLevelExpression()

void CMakeParser::handleTopLevelExpression ( )
inline

Definition at line 304 of file CMakeDoxygenFilter.cpp.

305 {
306 // skip token
307 nextToken();
308 }

◆ nextToken()

int CMakeParser::nextToken ( )
inline

Definition at line 253 of file CMakeDoxygenFilter.cpp.

254 {
255 _lastToken = _curToken;
256 _curToken = _lexer.getToken();
257 while (_curToken == CMakeLexer::TOK_EOL)
258 {
259 // Try to preserve lines in output to allow correct line number referencing by doxygen.
260 _os << std::endl;
261 _curToken = _lexer.getToken();
262 }
263 return _curToken;
264 }

The documentation for this class was generated from the following file: