Skip to content

Commit

Permalink
wrapper-generator outputs correct wrappers for functions; still not o…
Browse files Browse the repository at this point in the history
…perational thought.
  • Loading branch information
tybor committed Sep 26, 2009
1 parent 75b4c35 commit 6036791
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/tools/wrappers-generator/stand_alone_wrappable_node.e

This file was deleted.

49 changes: 49 additions & 0 deletions src/tools/wrappers-generator/wrapped_by_a_class.e
@@ -0,0 +1,49 @@
deferred class WRAPPED_BY_A_CLASS
-- A node of an XML file made by gccxml which is wrappable with a class.
-- This class will contain the wrapping of this class and wrapped features
-- of many child and/or related nodes.

inherit
GCCXML_NODE
NAMED_NODE

insert NAME_CONVERTER

feature
emit_wrapper is
deferred
end

class_name: STRING is
-- the name of the Eiffel class that wraps Current.
do
if stored_class_name=Void then compute_class_name end
Result := stored_class_name
end

feature {}
stored_class_name: STRING

compute_class_name is
local path: POSIX_PATH_NAME
do
-- The Eiffel class name for 'c_name'; extension is removed,
-- CamelCase is converted into CAMEL_CASE, dashes are converted to
-- underscores, "EXTERNALS" is added at the end; i.e.:
-- class_name_from_header("/usr/include/foo/bar/maman.h").is_equal("MAMAN_EXTERNALS")
create path.make_from_string(c_name.as_utf8)
stored_class_name := path.last
stored_class_name.remove_tail(path.extension.count)
check
no_final_dot_if_this_fails_add_one_above: stored_class_name.last/='.'
end
eiffellizer.substitute_all_in(stored_class_name)
stored_class_name.replace_all('-','_')
stored_class_name.to_upper
stored_class_name.append(once "_EXTERNALS")
ensure
stored_class_name/=Void
is_valid_class_name(stored_class_name)
end

end -- class WRAPPED_BY_A_CLASS

0 comments on commit 6036791

Please sign in to comment.