nitc :: CLanguage :: defaultinit
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