Lines Matching refs:scanner
104 bool isReturn, Scanner* scanner) { in parseParameterDefinition() argument
144 scanner->error(lineNumber) << "Should have a name.\n"; in parseParameterDefinition()
149 scanner->error(lineNumber) << "Should have a name.\n"; in parseParameterDefinition()
165 scanner->error(lineNumber) << "Incorrect range " << testOption << "\n"; in parseParameterDefinition()
173 scanner->error(lineNumber) << "Incorrect testOption " << testOption << "\n"; in parseParameterDefinition()
180 scanner->error(lineNumber) << "Incorrect testOption " << testOption << "\n"; in parseParameterDefinition()
187 scanner->error(lineNumber) << "Unrecognized testOption " << testOption << "\n"; in parseParameterDefinition()
199 scanner->error(lineNumber) << "range(,) is only supported for floating point\n"; in parseParameterDefinition()
204 bool VersionInfo::scan(Scanner* scanner, int maxApiLevel) { in scan() argument
205 if (scanner->findOptionalTag("version:")) { in scan()
206 const string s = scanner->getValue(); in scan()
209 scanner->error() << "Minimum version must >= 9\n"; in scan()
215 scanner->error() << "Maximum version must >= 9\n"; in scan()
218 if (scanner->findOptionalTag("size:")) { in scan()
219 sscanf(scanner->getValue().c_str(), "%i", &intSize); in scan()
243 void Definition::scanDocumentationTags(Scanner* scanner, bool firstOccurence, in scanDocumentationTags() argument
245 if (scanner->findOptionalTag("hidden:")) { in scanDocumentationTags()
246 scanner->checkNoValue(); in scanDocumentationTags()
249 if (scanner->findOptionalTag("deprecated:")) { in scanDocumentationTags()
250 string value = scanner->getValue(); in scanDocumentationTags()
258 scanner->error() << "deprecated entries should have a level > 0\n"; in scanDocumentationTags()
262 if (scanner->findTag("summary:")) { in scanDocumentationTags()
263 mSummary = scanner->getValue(); in scanDocumentationTags()
265 if (scanner->findTag("description:")) { in scanDocumentationTags()
266 scanner->checkNoValue(); in scanDocumentationTags()
267 while (scanner->findOptionalTag("")) { in scanDocumentationTags()
268 mDescription.push_back(scanner->getValue()); in scanDocumentationTags()
272 } else if (scanner->findOptionalTag("summary:")) { in scanDocumentationTags()
273 scanner->error() << "Only the first specification should have a summary.\n"; in scanDocumentationTags()
308 void Function::addParameter(ParameterEntry* entry, Scanner* scanner) { in addParameter() argument
313 scanner->error(entry->lineNumber) in addParameter()
323 void Function::addReturn(ParameterEntry* entry, Scanner* scanner) { in addReturn() argument
328 scanner->error() << "ret: should be documented only for the first variant\n"; in addReturn()
333 void ConstantSpecification::scanConstantSpecification(Scanner* scanner, SpecFile* specFile, in scanConstantSpecification() argument
335 string name = scanner->getValue(); in scanConstantSpecification()
337 if (!info.scan(scanner, maxApiLevel)) { in scanConstantSpecification()
339 scanner->skipUntilTag("end:"); in scanConstantSpecification()
351 if (scanner->findTag("value:")) { in scanConstantSpecification()
352 spec->mValue = scanner->getValue(); in scanConstantSpecification()
354 constant->scanDocumentationTags(scanner, created, specFile); in scanConstantSpecification()
356 scanner->findTag("end:"); in scanConstantSpecification()
359 void TypeSpecification::scanTypeSpecification(Scanner* scanner, SpecFile* specFile, in scanTypeSpecification() argument
361 string name = scanner->getValue(); in scanTypeSpecification()
363 if (!info.scan(scanner, maxApiLevel)) { in scanTypeSpecification()
365 scanner->skipUntilTag("end:"); in scanTypeSpecification()
377 if (scanner->findOptionalTag("simple:")) { in scanTypeSpecification()
379 spec->mSimpleType = scanner->getValue(); in scanTypeSpecification()
381 if (scanner->findOptionalTag("struct:")) { in scanTypeSpecification()
383 spec->mStructName = scanner->getValue(); in scanTypeSpecification()
384 while (scanner->findOptionalTag("field:")) { in scanTypeSpecification()
385 string s = scanner->getValue(); in scanTypeSpecification()
387 scanner->parseDocumentation(&s, &comment); in scanTypeSpecification()
392 if (scanner->findOptionalTag("enum:")) { in scanTypeSpecification()
394 spec->mEnumName = scanner->getValue(); in scanTypeSpecification()
395 while (scanner->findOptionalTag("value:")) { in scanTypeSpecification()
396 string s = scanner->getValue(); in scanTypeSpecification()
398 scanner->parseDocumentation(&s, &comment); in scanTypeSpecification()
403 if (scanner->findOptionalTag("attrib:")) { in scanTypeSpecification()
404 spec->mAttribute = scanner->getValue(); in scanTypeSpecification()
406 type->scanDocumentationTags(scanner, created, specFile); in scanTypeSpecification()
408 scanner->findTag("end:"); in scanTypeSpecification()
447 void FunctionSpecification::createPermutations(Function* function, Scanner* scanner) { in createPermutations() argument
469 auto p = new FunctionPermutation(function, this, replacementIndexes, scanner); in createPermutations()
502 void FunctionSpecification::parseTest(Scanner* scanner) { in parseTest() argument
503 const string value = scanner->getValue(); in parseTest()
512 scanner->error() << "Incorrect test: \"" << value << "\"\n"; in parseTest()
518 scanner->error() << "Unrecognized test option: \"" << value << "\"\n"; in parseTest()
532 void FunctionSpecification::scanFunctionSpecification(Scanner* scanner, SpecFile* specFile, in scanFunctionSpecification() argument
535 const string& unexpandedName = scanner->getValue(); in scanFunctionSpecification()
545 if (!info.scan(scanner, maxApiLevel)) { in scanFunctionSpecification()
547 scanner->skipUntilTag("end:"); in scanFunctionSpecification()
562 if (scanner->findOptionalTag("attrib:")) { in scanFunctionSpecification()
563 spec->mAttribute = scanner->getValue(); in scanFunctionSpecification()
565 if (scanner->findOptionalTag("w:")) { in scanFunctionSpecification()
567 if (scanner->getValue().find("1") != string::npos) { in scanFunctionSpecification()
570 if (scanner->getValue().find("2") != string::npos) { in scanFunctionSpecification()
573 if (scanner->getValue().find("3") != string::npos) { in scanFunctionSpecification()
576 if (scanner->getValue().find("4") != string::npos) { in scanFunctionSpecification()
582 while (scanner->findOptionalTag("t:")) { in scanFunctionSpecification()
583 spec->mReplaceables.push_back(convertToTypeVector(scanner->getValue())); in scanFunctionSpecification()
586 if (scanner->findTag("ret:")) { in scanFunctionSpecification()
587 ParameterEntry* p = scanner->parseArgString(true); in scanFunctionSpecification()
588 function->addReturn(p, scanner); in scanFunctionSpecification()
591 while (scanner->findOptionalTag("arg:")) { in scanFunctionSpecification()
592 ParameterEntry* p = scanner->parseArgString(false); in scanFunctionSpecification()
593 function->addParameter(p, scanner); in scanFunctionSpecification()
597 function->scanDocumentationTags(scanner, created, specFile); in scanFunctionSpecification()
599 if (scanner->findOptionalTag("inline:")) { in scanFunctionSpecification()
600 scanner->checkNoValue(); in scanFunctionSpecification()
601 while (scanner->findOptionalTag("")) { in scanFunctionSpecification()
602 spec->mInline.push_back(scanner->getValue()); in scanFunctionSpecification()
605 if (scanner->findOptionalTag("test:")) { in scanFunctionSpecification()
606 spec->parseTest(scanner); in scanFunctionSpecification()
609 scanner->findTag("end:"); in scanFunctionSpecification()
611 spec->createPermutations(function, scanner); in scanFunctionSpecification()
615 int replacementIndexes[MAX_REPLACEABLES], Scanner* scanner) in FunctionPermutation() argument
632 def->parseParameterDefinition(type, name, testOption, lineNumber, false, scanner); in FunctionPermutation()
640 scanner->error(lineNumber) in FunctionPermutation()
655 mReturn->parseParameterDefinition(retType, "", "", lineNumber, true, scanner); in FunctionPermutation()
718 Scanner scanner(mSpecFileName, specFile); in readSpecFile() local
721 scanner.skipBlankEntries(); in readSpecFile()
722 if (scanner.findTag("header:")) { in readSpecFile()
723 if (scanner.findTag("summary:")) { in readSpecFile()
724 mBriefDescription = scanner.getValue(); in readSpecFile()
726 if (scanner.findTag("description:")) { in readSpecFile()
727 scanner.checkNoValue(); in readSpecFile()
728 while (scanner.findOptionalTag("")) { in readSpecFile()
729 mFullDescription.push_back(scanner.getValue()); in readSpecFile()
732 if (scanner.findOptionalTag("include:")) { in readSpecFile()
733 scanner.checkNoValue(); in readSpecFile()
734 while (scanner.findOptionalTag("")) { in readSpecFile()
735 mVerbatimInclude.push_back(scanner.getValue()); in readSpecFile()
738 scanner.findTag("end:"); in readSpecFile()
742 scanner.skipBlankEntries(); in readSpecFile()
743 if (scanner.atEnd()) { in readSpecFile()
746 const string tag = scanner.getNextTag(); in readSpecFile()
748 FunctionSpecification::scanFunctionSpecification(&scanner, this, maxApiLevel); in readSpecFile()
750 TypeSpecification::scanTypeSpecification(&scanner, this, maxApiLevel); in readSpecFile()
752 ConstantSpecification::scanConstantSpecification(&scanner, this, maxApiLevel); in readSpecFile()
754 scanner.error() << "Expected function:, type:, or constant:. Found: " << tag << "\n"; in readSpecFile()
760 return scanner.getErrorCount() == 0; in readSpecFile()