nitc :: CLanguage :: defaultinit
nitc :: c $ CLanguage :: compile_callback
Generate the code to offer this callback if foreign codenitc $ CLanguage :: compile_extern_class
Generate wrapper code for this extern classnitc $ CLanguage :: compile_extern_method
Generate wrapper code for this extern methodnitc $ CLanguage :: compile_module_block
Generate wrapper code for this module/header code blocknitc $ CLanguage :: identify_language
Is thisblock
written in this language?
nitc :: FFILanguage :: _ffi_language_assignation_phase
FFILanguageAssignationPhase
assigning self
to AExternCodeBlock
s
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: FFILanguage :: compile_callback
Generate the code to offer this callback if foreign codenitc :: FFILanguage :: compile_extern_class
Generate wrapper code for this extern classnitc :: FFILanguage :: compile_extern_method
Generate wrapper code for this extern methodnitc :: FFILanguage :: compile_module_block
Generate wrapper code for this module/header code blocknitc :: FFILanguage :: compile_to_files
Complete compilation of generated codenitc :: FFILanguage :: defaultinit
nitc :: CLanguage :: defaultinit
core :: Object :: defaultinit
nitc :: FFILanguage :: ffi_language_assignation_phase
FFILanguageAssignationPhase
assigning self
to AExternCodeBlock
s
nitc :: FFILanguage :: ffi_language_assignation_phase=
FFILanguageAssignationPhase
assigning self
to AExternCodeBlock
s
nitc :: FFILanguage :: get_ftype
Get the foreign type of this extern class definitionnitc :: FFILanguage :: identify_language
Is thisblock
written in this language?
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: FFILanguage
Visitor for a specific languages. Works kinda like aPhase
and is executed
class CLanguage
super FFILanguage
redef fun identify_language(n) do return n.is_c
redef fun compile_module_block(block, ecc, mmodule)
do
if block.is_c_header then
ecc.header_custom.add block.location.as_line_pragma
ecc.header_custom.add "\n"
ecc.header_custom.add block.code
else if block.is_c_body then
ecc.body_impl.add block.location.as_line_pragma
ecc.body_impl.add "\n"
ecc.body_impl.add block.code
end
end
redef fun compile_extern_method(block, m, ecc, mmodule)
do
var fc = new ExternCFunction(m, mmodule)
fc.decls.add( block.location.as_line_pragma )
fc.exprs.add( block.code )
ecc.body_impl.add fc.to_writer
end
redef fun compile_extern_class(block, m, ecc, mmodule) do end
redef fun get_ftype(block, m) do return new ForeignCType(block.code)
end
src/ffi/light_c.nit:28,1--57,3
redef class CLanguage
redef fun compile_callback(callback, mmodule, mainmodule, ecc)
do
callback.compile_callback_to_c(mainmodule, ecc)
end
end
src/ffi/c.nit:23,1--28,3