pyolian: wipe out declaration api
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 8 Mar 2018 22:01:01 +0000 (23:01 +0100)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 11:10:51 +0000 (20:10 +0900)
src/scripts/pyolian/eolian.py
src/scripts/pyolian/eolian_lib.py

index 0693eba..db4b35f 100644 (file)
@@ -53,7 +53,6 @@ class Eolian_Object_Type(IntEnum):
     IMPLEMENT = 12
     CONSTRUCTOR = 13
     DOCUMENTATION = 14
-    DECLARATION = 15
 
 class Eolian_Function_Type(IntEnum):
     UNRESOLVED = 0
@@ -225,14 +224,6 @@ class Eolian_Unary_Operator(IntEnum):
     NOT = 3   # ! int, float, bool
     BNOT = 4  # ~ int
 
-class Eolian_Declaration_Type(IntEnum):
-    UNKNOWN = 0
-    CLASS = 1
-    ALIAS = 2
-    STRUCT = 3
-    ENUM = 4
-    VAR = 5
-
 class Eolian_Doc_Token_Type(IntEnum):
     UNKNOWN = 0
     TEXT = 1
@@ -425,19 +416,6 @@ class Eolian_Unit(EolianBaseObject):
     def namespace_get_by_name(self, name):
         return Namespace(self, name)
 
-    @property
-    def all_declarations(self):
-        return Iterator(Declaration, lib.eolian_all_declarations_get(self._obj))
-
-    def declaration_get_by_name(self, name):
-        c_decl = lib.eolian_declaration_get_by_name(self._obj, _str_to_bytes(name))
-        return Declaration(c_decl) if c_decl else None
-
-    def declarations_get_by_file(self, fname):
-        return Iterator(Declaration,
-            lib.eolian_declarations_get_by_file(self._obj, _str_to_bytes(fname)))
-
-
 class Eolian_State(Eolian_Unit):
     def __init__(self):
         self._obj = lib.eolian_state_new()  # Eolian_State *
@@ -1458,34 +1436,6 @@ class Variable(Object):
         return Documentation(c_doc) if c_doc else None
 
 
-class Declaration(Object):
-    def __repr__(self):
-        return "<eolian.Declaration '{0.name}'>".format(self)
-
-    @cached_property
-    def name(self):
-        return _str_to_py(lib.eolian_declaration_name_get(self._obj))
-
-    @cached_property
-    def type(self):
-        return Eolian_Declaration_Type(lib.eolian_declaration_type_get(self._obj))
-
-    @cached_property
-    def class_(self):
-        c_cls = lib.eolian_declaration_class_get(self._obj)
-        return Class(c_cls) if c_cls else None
-
-    @cached_property
-    def data_type(self):
-        c_typedec = lib.eolian_declaration_data_type_get(self._obj)
-        return Typedecl(c_typedec) if c_typedec else None
-
-    @cached_property
-    def variable(self):
-        c_var = lib.eolian_declaration_variable_get(self._obj)
-        return Variable(c_var) if c_var else None
-
-
 class _Eolian_Doc_Token_Struct(ctypes.Structure):
     _fields_ = [("type", c_int),
                 ("text", c_char_p),
index 1ea3898..26d6312 100644 (file)
@@ -165,10 +165,6 @@ lib.eolian_state_structs_get.restype = c_void_p
 lib.eolian_state_enums_get.argtypes = [c_void_p,]
 lib.eolian_state_enums_get.restype = c_void_p
 
-# EAPI Eina_Iterator *eolian_declarations_get_by_file(const Eolian_State *state, const char *fname);
-lib.eolian_declarations_get_by_file.argtypes = [c_void_p, c_char_p]
-lib.eolian_declarations_get_by_file.restype = c_void_p
-
 ###  Eolian_Unit  #############################################################
 
 # EAPI Eina_Iterator *eolian_unit_children_get(const Eolian_Unit *unit);
@@ -227,14 +223,6 @@ lib.eolian_unit_constants_get.restype = c_void_p
 lib.eolian_unit_globals_get.argtypes = [c_void_p,]
 lib.eolian_unit_globals_get.restype = c_void_p
 
-# EAPI Eina_Iterator *eolian_all_declarations_get(const Eolian_Unit *unit);
-lib.eolian_all_declarations_get.argtypes = [c_void_p,]
-lib.eolian_all_declarations_get.restype = c_void_p
-
-# EAPI const Eolian_Declaration *eolian_declaration_get_by_name(const Eolian_Unit *unit, const char *name);
-lib.eolian_declaration_get_by_name.argtypes = [c_void_p, c_char_p]
-lib.eolian_declaration_get_by_name.restype = c_void_p
-
 ###  Eolian_Object  ###########################################################
 
 # EAPI Eolian_Object_Type eolian_object_type_get(const Eolian_Object *obj);
@@ -788,28 +776,6 @@ lib.eolian_variable_namespaces_get.restype = c_void_p
 lib.eolian_variable_is_extern.argtypes = [c_void_p,]
 lib.eolian_variable_is_extern.restype = c_bool
 
-###  Eolian_Declaration  ######################################################
-
-# EAPI Eolian_Declaration_Type eolian_declaration_type_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_type_get.argtypes = [c_void_p,]
-lib.eolian_declaration_type_get.restype = c_int
-
-# EAPI Eina_Stringshare *eolian_declaration_name_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_name_get.argtypes = [c_void_p,]
-lib.eolian_declaration_name_get.restype = c_char_p
-
-# EAPI const Eolian_Class *eolian_declaration_class_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_class_get.argtypes = [c_void_p,]
-lib.eolian_declaration_class_get.restype = c_void_p
-
-# EAPI const Eolian_Typedecl *eolian_declaration_data_type_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_data_type_get.argtypes = [c_void_p,]
-lib.eolian_declaration_data_type_get.restype = c_void_p
-
-# EAPI const Eolian_Variable *eolian_declaration_variable_get(const Eolian_Declaration *decl);
-lib.eolian_declaration_variable_get.argtypes = [c_void_p,]
-lib.eolian_declaration_variable_get.restype = c_void_p
-
 ###  Eolian_Documentation  ####################################################
 
 # EAPI Eina_Stringshare *eolian_documentation_summary_get(const Eolian_Documentation *doc);