|
| 1 | +//** THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY. **/ |
| 2 | +import cpp |
| 3 | +import RuleMetadata |
| 4 | +import codingstandards.cpp.exclusions.RuleMetadata |
| 5 | + |
| 6 | +newtype PreprocessorQuery = |
| 7 | + TUndefOfMacroNotDefinedInFileQuery() or |
| 8 | + TInvalidTokenInDefinedOperatorQuery() or |
| 9 | + TDefinedOperatorExpandedInIfDirectiveQuery() or |
| 10 | + TNoValidIfdefGuardInHeaderQuery() or |
| 11 | + TIncludeOutsideGuardQuery() |
| 12 | + |
| 13 | +predicate isPreprocessorQueryMetadata(Query query, string queryId, string ruleId, string category) { |
| 14 | + query = |
| 15 | + // `Query` instance for the `undefOfMacroNotDefinedInFile` query |
| 16 | + PreprocessorPackage::undefOfMacroNotDefinedInFileQuery() and |
| 17 | + queryId = |
| 18 | + // `@id` for the `undefOfMacroNotDefinedInFile` query |
| 19 | + "cpp/misra/undef-of-macro-not-defined-in-file" and |
| 20 | + ruleId = "RULE-19-0-4" and |
| 21 | + category = "advisory" |
| 22 | + or |
| 23 | + query = |
| 24 | + // `Query` instance for the `invalidTokenInDefinedOperator` query |
| 25 | + PreprocessorPackage::invalidTokenInDefinedOperatorQuery() and |
| 26 | + queryId = |
| 27 | + // `@id` for the `invalidTokenInDefinedOperator` query |
| 28 | + "cpp/misra/invalid-token-in-defined-operator" and |
| 29 | + ruleId = "RULE-19-1-1" and |
| 30 | + category = "required" |
| 31 | + or |
| 32 | + query = |
| 33 | + // `Query` instance for the `definedOperatorExpandedInIfDirective` query |
| 34 | + PreprocessorPackage::definedOperatorExpandedInIfDirectiveQuery() and |
| 35 | + queryId = |
| 36 | + // `@id` for the `definedOperatorExpandedInIfDirective` query |
| 37 | + "cpp/misra/defined-operator-expanded-in-if-directive" and |
| 38 | + ruleId = "RULE-19-1-1" and |
| 39 | + category = "required" |
| 40 | + or |
| 41 | + query = |
| 42 | + // `Query` instance for the `noValidIfdefGuardInHeader` query |
| 43 | + PreprocessorPackage::noValidIfdefGuardInHeaderQuery() and |
| 44 | + queryId = |
| 45 | + // `@id` for the `noValidIfdefGuardInHeader` query |
| 46 | + "cpp/misra/no-valid-ifdef-guard-in-header" and |
| 47 | + ruleId = "RULE-19-2-1" and |
| 48 | + category = "required" |
| 49 | + or |
| 50 | + query = |
| 51 | + // `Query` instance for the `includeOutsideGuard` query |
| 52 | + PreprocessorPackage::includeOutsideGuardQuery() and |
| 53 | + queryId = |
| 54 | + // `@id` for the `includeOutsideGuard` query |
| 55 | + "cpp/misra/include-outside-guard" and |
| 56 | + ruleId = "RULE-19-2-1" and |
| 57 | + category = "required" |
| 58 | +} |
| 59 | + |
| 60 | +module PreprocessorPackage { |
| 61 | + Query undefOfMacroNotDefinedInFileQuery() { |
| 62 | + //autogenerate `Query` type |
| 63 | + result = |
| 64 | + // `Query` type for `undefOfMacroNotDefinedInFile` query |
| 65 | + TQueryCPP(TPreprocessorPackageQuery(TUndefOfMacroNotDefinedInFileQuery())) |
| 66 | + } |
| 67 | + |
| 68 | + Query invalidTokenInDefinedOperatorQuery() { |
| 69 | + //autogenerate `Query` type |
| 70 | + result = |
| 71 | + // `Query` type for `invalidTokenInDefinedOperator` query |
| 72 | + TQueryCPP(TPreprocessorPackageQuery(TInvalidTokenInDefinedOperatorQuery())) |
| 73 | + } |
| 74 | + |
| 75 | + Query definedOperatorExpandedInIfDirectiveQuery() { |
| 76 | + //autogenerate `Query` type |
| 77 | + result = |
| 78 | + // `Query` type for `definedOperatorExpandedInIfDirective` query |
| 79 | + TQueryCPP(TPreprocessorPackageQuery(TDefinedOperatorExpandedInIfDirectiveQuery())) |
| 80 | + } |
| 81 | + |
| 82 | + Query noValidIfdefGuardInHeaderQuery() { |
| 83 | + //autogenerate `Query` type |
| 84 | + result = |
| 85 | + // `Query` type for `noValidIfdefGuardInHeader` query |
| 86 | + TQueryCPP(TPreprocessorPackageQuery(TNoValidIfdefGuardInHeaderQuery())) |
| 87 | + } |
| 88 | + |
| 89 | + Query includeOutsideGuardQuery() { |
| 90 | + //autogenerate `Query` type |
| 91 | + result = |
| 92 | + // `Query` type for `includeOutsideGuard` query |
| 93 | + TQueryCPP(TPreprocessorPackageQuery(TIncludeOutsideGuardQuery())) |
| 94 | + } |
| 95 | +} |
0 commit comments