Пример #1
0
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);
}
Пример #2
0
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());
}
Пример #3
0
//
// 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;
}
Пример #4
0
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);
}
Пример #5
0
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);
}