Coverage for src/renaissance/integrations/clang/kinds.py: 100%
2 statements
« prev ^ index » next coverage.py v7.16.1, created at 2026-10-02 13:12 +0000
« prev ^ index » next coverage.py v7.16.1, created at 2026-10-02 13:12 +0000
1"""AI: Mapping of Clang node kinds to the library's semantic kinds."""
3from renaissance.syntax_tree.semantic_kind import SemanticKind
5CLANG_KIND_MAP = {
6 "TRANSLATION_UNIT": SemanticKind.TRANSLATION_UNIT,
7 "translation_unit": SemanticKind.TRANSLATION_UNIT,
8 "TranslationUnitDecl": SemanticKind.TRANSLATION_UNIT,
9 "FunctionDecl": SemanticKind.FUNCTION,
10 "FUNCTION_DECL": SemanticKind.FUNCTION,
11 "CXXMethodDecl": SemanticKind.FUNCTION,
12 "CXX_METHOD": SemanticKind.FUNCTION,
13 "CXXConstructorDecl": SemanticKind.FUNCTION,
14 "CXX_CONSTRUCTOR": SemanticKind.FUNCTION,
15 "CONSTRUCTOR": SemanticKind.FUNCTION,
16 "CallExpr": SemanticKind.CALL,
17 "CALL_EXPR": SemanticKind.CALL,
18 "CXXConstructExpr": SemanticKind.CALL,
19 "CXX_CONSTRUCT_EXPR": SemanticKind.CALL,
20 "DeclRefExpr": SemanticKind.NAME,
21 "IntegerLiteral": SemanticKind.LITERAL,
22 "INTEGER_LITERAL": SemanticKind.LITERAL,
23 "FloatingLiteral": SemanticKind.LITERAL,
24 "StringLiteral": SemanticKind.LITERAL,
25 "VarDecl": SemanticKind.DECLARATION,
26 "VAR_DECL": SemanticKind.DECLARATION,
27 "DeclStmt": SemanticKind.STATEMENT,
28 "DECL_STMT": SemanticKind.STATEMENT,
29 "TypedefDecl": SemanticKind.DECLARATION,
30 "TYPEDEF_DECL": SemanticKind.DECLARATION,
31 "ParmVarDecl": SemanticKind.PARAMETER,
32 "PARM_DECL": SemanticKind.PARAMETER,
33 "BinaryOperator": SemanticKind.BINARY_OPERATION,
34 "BINARY_OPERATOR": SemanticKind.BINARY_OPERATION,
35 "UnaryOperator": SemanticKind.UNARY_OPERATION,
36 "UNARY_OPERATOR": SemanticKind.UNARY_OPERATION,
37 "IfStmt": SemanticKind.CONDITIONAL,
38 "IF_STMT": SemanticKind.CONDITIONAL,
39 "ForStmt": SemanticKind.LOOP,
40 "FOR_STMT": SemanticKind.LOOP,
41 "WhileStmt": SemanticKind.LOOP,
42 "WHILE_STMT": SemanticKind.LOOP,
43 "ReturnStmt": SemanticKind.RETURN,
44 "RETURN_STMT": SemanticKind.RETURN,
45 "RecordDecl": SemanticKind.CLASS,
46 "CXXRecordDecl": SemanticKind.CLASS,
47 "STRUCT_DECL": SemanticKind.CLASS,
48 "CLASS_DECL": SemanticKind.CLASS,
49 "NamespaceDecl": SemanticKind.DEFINITION,
50 "NAMESPACE_DECL": SemanticKind.DEFINITION,
51 "CompoundStmt": SemanticKind.STATEMENT,
52 "COMPOUND_STMT": SemanticKind.STATEMENT,
53 "Import": SemanticKind.IMPORT,
54 "INCLUSION_DIRECTIVE": SemanticKind.IMPORT,
55 "InclusionDirective": SemanticKind.IMPORT,
56}