Introduced properties

init defaultinit(ffi_language_assignation_phase: FFILanguageAssignationPhase)

nitc :: CLanguage :: defaultinit

Redefined properties

redef type SELF: CLanguage

nitc $ CLanguage :: SELF

Type of this instance, automatically specialized in every class
redef fun compile_callback(callback: NitniCallback, mmodule: MModule, mainmodule: MModule, ecc: CCompilationUnit)

nitc :: c $ CLanguage :: compile_callback

Generate the code to offer this callback if foreign code
redef fun compile_extern_class(block: AExternCodeBlock, m: AClassdef, ecc: CCompilationUnit, mmodule: MModule)

nitc $ CLanguage :: compile_extern_class

Generate wrapper code for this extern class
redef fun compile_extern_method(block: AExternCodeBlock, m: AMethPropdef, ecc: CCompilationUnit, mmodule: MModule)

nitc $ CLanguage :: compile_extern_method

Generate wrapper code for this extern method
redef fun compile_module_block(block: AExternCodeBlock, ecc: CCompilationUnit, mmodule: MModule)

nitc $ CLanguage :: compile_module_block

Generate wrapper code for this module/header code block
redef fun get_ftype(block: AExternCodeBlock, m: AClassdef): ForeignType

nitc $ CLanguage :: get_ftype

Get the foreign type of this extern class definition
redef fun identify_language(n: AExternCodeBlock): Bool

nitc $ CLanguage :: identify_language

Is this block written in this language?

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
private var _ffi_language_assignation_phase: FFILanguageAssignationPhase

nitc :: FFILanguage :: _ffi_language_assignation_phase

FFILanguageAssignationPhase assigning self to AExternCodeBlocks
protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
abstract fun compile_callback(callback: NitniCallback, mmodule: MModule, mainmmodule: MModule, ecc: CCompilationUnit)

nitc :: FFILanguage :: compile_callback

Generate the code to offer this callback if foreign code
abstract fun compile_extern_class(block: AExternCodeBlock, m: AClassdef, ecc: CCompilationUnit, mmodule: MModule)

nitc :: FFILanguage :: compile_extern_class

Generate wrapper code for this extern class
abstract fun compile_extern_method(block: AExternCodeBlock, m: AMethPropdef, ecc: CCompilationUnit, nmodule: MModule)

nitc :: FFILanguage :: compile_extern_method

Generate wrapper code for this extern method
abstract fun compile_module_block(block: AExternCodeBlock, ecc: CCompilationUnit, mmodule: MModule)

nitc :: FFILanguage :: compile_module_block

Generate wrapper code for this module/header code block
fun compile_to_files(mmodule: MModule, directory: String)

nitc :: FFILanguage :: compile_to_files

Complete compilation of generated code
init defaultinit(ffi_language_assignation_phase: FFILanguageAssignationPhase)

nitc :: FFILanguage :: defaultinit

init defaultinit(ffi_language_assignation_phase: FFILanguageAssignationPhase)

nitc :: CLanguage :: defaultinit

fun ffi_language_assignation_phase: FFILanguageAssignationPhase

nitc :: FFILanguage :: ffi_language_assignation_phase

FFILanguageAssignationPhase assigning self to AExternCodeBlocks
protected fun ffi_language_assignation_phase=(ffi_language_assignation_phase: FFILanguageAssignationPhase)

nitc :: FFILanguage :: ffi_language_assignation_phase=

FFILanguageAssignationPhase assigning self to AExternCodeBlocks
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
abstract fun get_ftype(block: AExternCodeBlock, m: AClassdef): ForeignType

nitc :: FFILanguage :: get_ftype

Get the foreign type of this extern class definition
fun hash: Int

core :: Object :: hash

The hash code of the object.
abstract fun identify_language(block: AExternCodeBlock): Bool

nitc :: FFILanguage :: identify_language

Is this block written in this language?
init init

core :: Object :: init

fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
private intern fun native_class_name: CString

core :: Object :: native_class_name

The class name of the object in CString format.
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
package_diagram nitc::CLanguage CLanguage nitc::FFILanguage FFILanguage nitc::CLanguage->nitc::FFILanguage core::Object Object nitc::FFILanguage->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

class FFILanguage

nitc :: FFILanguage

Visitor for a specific languages. Works kinda like a Phase and is executed

Class definitions

nitc $ CLanguage
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

nitc :: c $ CLanguage
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