Example #1
0
 def to_token_id(kind):
     if (kind == "namespace"):
         return TokenIdentifier.getNamespaceId()
     if (kind == "class"):
         return TokenIdentifier.getClassId()
     if (kind == "struct"):
         return TokenIdentifier.getStructId()
     if (kind == "enum"):
         return TokenIdentifier.getEnumId()
     if (kind == "enumerator"):
         return TokenIdentifier.getEnumValueId()
     if (kind == "union"):
         return TokenIdentifier.getUnionId()
     if (kind == "member"):
         return TokenIdentifier.getClassStructUnionMemberId()
     if (kind == "local"):
         return TokenIdentifier.getLocalVariableId()
     if (kind == "variable"):
         return TokenIdentifier.getVariableDefinitionId()
     if (kind == "prototype"):
         return TokenIdentifier.getFunctionPrototypeId()
     if (kind == "function"):
         return TokenIdentifier.getFunctionDefinitionId()
     if (kind == "macro"):
         return TokenIdentifier.getMacroId()
     if (kind == "typedef"):
         return TokenIdentifier.getTypedefId()
     if (kind == "externvar"):
         return TokenIdentifier.getExternFwdDeclarationId()
Example #2
0
 def to_token_id(kind):
     if (kind == "namespace"):
         return TokenIdentifier.getNamespaceId()
     if (kind == "class"):
         return TokenIdentifier.getClassId()
     if (kind == "struct"):
         return TokenIdentifier.getStructId()
     if (kind == "enum"):
         return TokenIdentifier.getEnumId()
     if (kind == "enumerator"):
         return TokenIdentifier.getEnumValueId()
     if (kind == "union"):
         return TokenIdentifier.getUnionId()
     if (kind == "member"):
         return TokenIdentifier.getClassStructUnionMemberId()
     if (kind == "local"):
         return TokenIdentifier.getLocalVariableId()
     if (kind == "variable"):
         return TokenIdentifier.getVariableDefinitionId()
     if (kind == "prototype"):
         return TokenIdentifier.getFunctionPrototypeId()
     if (kind == "function"):
         return TokenIdentifier.getFunctionDefinitionId()
     if (kind == "macro"):
         return TokenIdentifier.getMacroId()
     if (kind == "typedef"):
         return TokenIdentifier.getTypedefId()
     if (kind == "externvar"):
         return TokenIdentifier.getExternFwdDeclarationId()
Example #3
0
 def to_token_id(kind):
     if (kind == clang.cindex.CursorKind.NAMESPACE):
         return TokenIdentifier.getNamespaceId()
     if (kind in [clang.cindex.CursorKind.CLASS_DECL, clang.cindex.CursorKind.CLASS_TEMPLATE, clang.cindex.CursorKind.CLASS_TEMPLATE_PARTIAL_SPECIALIZATION]):
         return TokenIdentifier.getClassId()
     if (kind == clang.cindex.CursorKind.STRUCT_DECL):
         return TokenIdentifier.getStructId()
     if (kind == clang.cindex.CursorKind.ENUM_DECL):
         return TokenIdentifier.getEnumId()
     if (kind == clang.cindex.CursorKind.ENUM_CONSTANT_DECL):
         return TokenIdentifier.getEnumValueId()
     if (kind == clang.cindex.CursorKind.UNION_DECL):
         return TokenIdentifier.getUnionId()
     if (kind == clang.cindex.CursorKind.FIELD_DECL):
         return TokenIdentifier.getFieldId()
     if (kind == clang.cindex.CursorKind.VAR_DECL):
         return TokenIdentifier.getLocalVariableId()
     if (kind in [clang.cindex.CursorKind.FUNCTION_DECL, clang.cindex.CursorKind.FUNCTION_TEMPLATE]):
         return TokenIdentifier.getFunctionId()
     if (kind in [clang.cindex.CursorKind.CXX_METHOD, clang.cindex.CursorKind.CONSTRUCTOR, clang.cindex.CursorKind.DESTRUCTOR]):
         return TokenIdentifier.getMethodId()
     if (kind == clang.cindex.CursorKind.PARM_DECL):
         return TokenIdentifier.getFunctionParameterId()
     if (kind == clang.cindex.CursorKind.TEMPLATE_TYPE_PARAMETER):
         return TokenIdentifier.getTemplateTypeParameterId()
     if (kind == clang.cindex.CursorKind.TEMPLATE_NON_TYPE_PARAMETER):
         return TokenIdentifier.getTemplateNonTypeParameterId()
     if (kind == clang.cindex.CursorKind.TEMPLATE_TEMPLATE_PARAMETER):
         return TokenIdentifier.getTemplateTemplateParameterId()
     if (kind == clang.cindex.CursorKind.MACRO_DEFINITION):
         return TokenIdentifier.getMacroDefinitionId()
     if (kind == clang.cindex.CursorKind.MACRO_INSTANTIATION):
         return TokenIdentifier.getMacroInstantiationId()
     if (kind in [clang.cindex.CursorKind.TYPEDEF_DECL, clang.cindex.CursorKind.TYPE_ALIAS_DECL]):
         return TokenIdentifier.getTypedefId()
     if (kind == clang.cindex.CursorKind.NAMESPACE_ALIAS):
         return TokenIdentifier.getNamespaceAliasId()
     if (kind == clang.cindex.CursorKind.USING_DIRECTIVE):
         return TokenIdentifier.getUsingDirectiveId()
     if (kind == clang.cindex.CursorKind.USING_DECLARATION):
         return TokenIdentifier.getUsingDeclarationId()
     return TokenIdentifier.getUnsupportedId()
Example #4
0
 def to_token_id(kind):
     if (kind == clang.cindex.CursorKind.NAMESPACE):
         return TokenIdentifier.getNamespaceId()
     if (kind in [clang.cindex.CursorKind.CLASS_DECL, clang.cindex.CursorKind.CLASS_TEMPLATE, clang.cindex.CursorKind.CLASS_TEMPLATE_PARTIAL_SPECIALIZATION]):
         return TokenIdentifier.getClassId()
     if (kind == clang.cindex.CursorKind.STRUCT_DECL):
         return TokenIdentifier.getStructId()
     if (kind == clang.cindex.CursorKind.ENUM_DECL):
         return TokenIdentifier.getEnumId()
     if (kind == clang.cindex.CursorKind.ENUM_CONSTANT_DECL):
         return TokenIdentifier.getEnumValueId()
     if (kind == clang.cindex.CursorKind.UNION_DECL):
         return TokenIdentifier.getUnionId()
     if (kind == clang.cindex.CursorKind.FIELD_DECL):
         return TokenIdentifier.getFieldId()
     if (kind == clang.cindex.CursorKind.VAR_DECL):
         return TokenIdentifier.getLocalVariableId()
     if (kind in [clang.cindex.CursorKind.FUNCTION_DECL, clang.cindex.CursorKind.FUNCTION_TEMPLATE]):
         return TokenIdentifier.getFunctionId()
     if (kind in [clang.cindex.CursorKind.CXX_METHOD, clang.cindex.CursorKind.CONSTRUCTOR, clang.cindex.CursorKind.DESTRUCTOR]):
         return TokenIdentifier.getMethodId()
     if (kind == clang.cindex.CursorKind.PARM_DECL):
         return TokenIdentifier.getFunctionParameterId()
     if (kind == clang.cindex.CursorKind.TEMPLATE_TYPE_PARAMETER):
         return TokenIdentifier.getTemplateTypeParameterId()
     if (kind == clang.cindex.CursorKind.TEMPLATE_NON_TYPE_PARAMETER):
         return TokenIdentifier.getTemplateNonTypeParameterId()
     if (kind == clang.cindex.CursorKind.TEMPLATE_TEMPLATE_PARAMETER):
         return TokenIdentifier.getTemplateTemplateParameterId()
     if (kind == clang.cindex.CursorKind.MACRO_DEFINITION):
         return TokenIdentifier.getMacroDefinitionId()
     if (kind == clang.cindex.CursorKind.MACRO_INSTANTIATION):
         return TokenIdentifier.getMacroInstantiationId()
     if (kind in [clang.cindex.CursorKind.TYPEDEF_DECL, clang.cindex.CursorKind.TYPE_ALIAS_DECL]):
         return TokenIdentifier.getTypedefId()
     if (kind == clang.cindex.CursorKind.NAMESPACE_ALIAS):
         return TokenIdentifier.getNamespaceAliasId()
     if (kind == clang.cindex.CursorKind.USING_DIRECTIVE):
         return TokenIdentifier.getUsingDirectiveId()
     if (kind == clang.cindex.CursorKind.USING_DECLARATION):
         return TokenIdentifier.getUsingDeclarationId()
     return TokenIdentifier.getUnsupportedId()
Example #5
0
 def __tag_id_to_vim_syntax_group(self, tag_identifier):
     if tag_identifier == TokenIdentifier.getNamespaceId():
         return "yavideCppNamespace"
     if tag_identifier == TokenIdentifier.getNamespaceAliasId():
         return "yavideCppNamespaceAlias"
     if tag_identifier == TokenIdentifier.getClassId():
         return "yavideCppClass"
     if tag_identifier == TokenIdentifier.getStructId():
         return "yavideCppStructure"
     if tag_identifier == TokenIdentifier.getEnumId():
         return "yavideCppEnum"
     if tag_identifier == TokenIdentifier.getEnumValueId():
         return "yavideCppEnumValue"
     if tag_identifier == TokenIdentifier.getUnionId():
         return "yavideCppUnion"
     if tag_identifier == TokenIdentifier.getFieldId():
         return "yavideCppField"
     if tag_identifier == TokenIdentifier.getLocalVariableId():
         return "yavideCppLocalVariable"
     if tag_identifier == TokenIdentifier.getFunctionId():
         return "yavideCppFunction"
     if tag_identifier == TokenIdentifier.getMethodId():
         return "yavideCppMethod"
     if tag_identifier == TokenIdentifier.getFunctionParameterId():
         return "yavideCppFunctionParameter"
     if tag_identifier == TokenIdentifier.getTemplateTypeParameterId():
         return "yavideCppTemplateTypeParameter"
     if tag_identifier == TokenIdentifier.getTemplateNonTypeParameterId():
         return "yavideCppTemplateNonTypeParameter"
     if tag_identifier == TokenIdentifier.getTemplateTemplateParameterId():
         return "yavideCppTemplateTemplateParameter"
     if tag_identifier == TokenIdentifier.getMacroDefinitionId():
         return "yavideCppMacroDefinition"
     if tag_identifier == TokenIdentifier.getMacroInstantiationId():
         return "yavideCppMacroInstantiation"
     if tag_identifier == TokenIdentifier.getTypedefId():
         return "yavideCppTypedef"
     if tag_identifier == TokenIdentifier.getUsingDirectiveId():
         return "yavideCppUsingDirective"
     if tag_identifier == TokenIdentifier.getUsingDeclarationId():
         return "yavideCppUsingDeclaration"
Example #6
0
 def __tag_id_to_vim_syntax_group(self, tag_identifier):
     if tag_identifier == TokenIdentifier.getNamespaceId():
         return "yavideCppNamespace"
     if tag_identifier == TokenIdentifier.getNamespaceAliasId():
         return "yavideCppNamespaceAlias"
     if tag_identifier == TokenIdentifier.getClassId():
         return "yavideCppClass"
     if tag_identifier == TokenIdentifier.getStructId():
         return "yavideCppStructure"
     if tag_identifier == TokenIdentifier.getEnumId():
         return "yavideCppEnum"
     if tag_identifier == TokenIdentifier.getEnumValueId():
         return "yavideCppEnumValue"
     if tag_identifier == TokenIdentifier.getUnionId():
         return "yavideCppUnion"
     if tag_identifier == TokenIdentifier.getFieldId():
         return "yavideCppField"
     if tag_identifier == TokenIdentifier.getLocalVariableId():
         return "yavideCppLocalVariable"
     if tag_identifier == TokenIdentifier.getFunctionId():
         return "yavideCppFunction"
     if tag_identifier == TokenIdentifier.getMethodId():
         return "yavideCppMethod"
     if tag_identifier == TokenIdentifier.getFunctionParameterId():
         return "yavideCppFunctionParameter"
     if tag_identifier == TokenIdentifier.getTemplateTypeParameterId():
         return "yavideCppTemplateTypeParameter"
     if tag_identifier == TokenIdentifier.getTemplateNonTypeParameterId():
         return "yavideCppTemplateNonTypeParameter"
     if tag_identifier == TokenIdentifier.getTemplateTemplateParameterId():
         return "yavideCppTemplateTemplateParameter"
     if tag_identifier == TokenIdentifier.getMacroDefinitionId():
         return "yavideCppMacroDefinition"
     if tag_identifier == TokenIdentifier.getMacroInstantiationId():
         return "yavideCppMacroInstantiation"
     if tag_identifier == TokenIdentifier.getTypedefId():
         return "yavideCppTypedef"
     if tag_identifier == TokenIdentifier.getUsingDirectiveId():
         return "yavideCppUsingDirective"
     if tag_identifier == TokenIdentifier.getUsingDeclarationId():
         return "yavideCppUsingDeclaration"