TranslationUnit *parse(const QByteArray &source, TranslationUnit::ParseMode mode, LanguageFeatures features) { const StringLiteral *fileId = control->stringLiteral("<stdin>"); TranslationUnit *unit = new TranslationUnit(control.data(), fileId); unit->setSource(source.constData(), source.length()); unit->setLanguageFeatures(features); unit->parse(mode); return unit; }
TranslationUnit *parse(const QByteArray &source, TranslationUnit::ParseMode mode, bool blockErrors = false) { StringLiteral *fileId = control.findOrInsertStringLiteral("<stdin>"); TranslationUnit *unit = new TranslationUnit(&control, fileId); unit->setObjCEnabled(true); unit->setSource(source.constData(), source.length()); unit->blockErrors(blockErrors); unit->parse(mode); return unit; }
TranslationUnit *parse(const QByteArray &source, TranslationUnit::ParseMode mode, bool enableObjc, bool qtMocRun) { const StringLiteral *fileId = control->stringLiteral("<stdin>"); TranslationUnit *unit = new TranslationUnit(control.data(), fileId); unit->setSource(source.constData(), source.length()); unit->setObjCEnabled(enableObjc); unit->setQtMocRunEnabled(qtMocRun); unit->parse(mode); return unit; }