void TParseContext::warning(TSourceLoc loc, const char* reason, const char* token, const char* extraInfo) { pp::SourceLocation srcLoc; DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line); diagnostics.writeInfo(pp::Diagnostics::WARNING, srcLoc, reason, token, extraInfo); }
void TInfoSinkBase::location(TSourceLoc loc) { int string = 0, line = 0, index = 0; DecodeSourceLoc(loc, &string, &line, &index); TPersistStringStream stream; stream << index; stream << ": "; sink.append(stream.str()); }
// // Used by flex/bison to output all syntax and parsing errors. // void TParseContext::error(TSourceLoc loc, const char* reason, const char* token, const char* extraInfo) { pp::SourceLocation srcLoc; DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line); diagnostics.writeInfo(pp::Diagnostics::ERROR, srcLoc, reason, token, extraInfo); ++numErrors; }
void TParseContext::handlePragmaDirective(int line, const char* name, const char* value) { pp::SourceLocation loc; DecodeSourceLoc(line, &loc.file, &loc.line); directiveHandler.handlePragma(loc, name, value); }
void TParseContext::handleExtensionDirective(int line, const char* extName, const char* behavior) { pp::SourceLocation loc; DecodeSourceLoc(line, &loc.file, &loc.line); directiveHandler.handleExtension(loc, extName, behavior); }