示例#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);
}