-interface FFIVisited
- fun accept_ffi_visitor( v : FFIVisitor ) do end
-end
-
-redef class ExternCode
- super FFIVisited
-
- # last resort for extern method
- # assumes this is a code block in the root of a module
- # should never be called if the extern method is implemented inline by a known language
- redef fun accept_ffi_visitor( v )
- do
- var language = self.language
- if language != null then
- v.tc.warning( null, "language \"{language}\" used to implement a code block in {v.mmmodule} is unknown." )
- else
- v.tc.warning( null, "please specify a language to implement code blocks in {v.mmmodule}." ) # is ok with spec as of now, won't be raised
- end
- end
-
- var language_lowered : nullable String = null
-
- redef init ( language, code, loc )
- do
- super
- if language != null then language_lowered = language.to_lower
- end
-end
-
-redef class MMMethod
- super FFIVisited
-
- # last resort for extern method
- # should never be called if the extern method is implemented inline by a known language
- redef fun accept_ffi_visitor( v )
- do
- if extern_implementation != null then
- var language = extern_implementation.language
- if language != null then
- v.tc.warning( null, "language \"{language}\" used to implement {full_name} is unknown." )
- else
- v.tc.warning( null, "please specify a language to implement {full_name}." ) # is ok with spec as of now, won't be raised
- end
- end
- end
-end
-
-# set of extern imports in a language to be used by a module
-# FIXME move to native_interface or MM?
-class ExternImportSet
- # set of imported functions, cached to avoid repetitions
- var callbacks : Set[ MMExplicitImport ] = new HashSet[ MMExplicitImport ]
-
- # set of imported functions, cached to avoid repetitions
- var supers : Set[ MMExplicitImport ] = new HashSet[ MMExplicitImport ]
-
- # set of relevant types, cached to avoid repetitions
- var types : Set[ MMType ] = new HashSet[ MMType ]