private import utils
redef class ToolContext
- readable writable attr _global: Bool
- readable writable attr _attr_sim: Bool
- readable writable attr _base_dir: String
+ readable writable attr _global: Bool = false
+ readable writable attr _attr_sim: Bool = false
+ readable writable attr _compdir: String
readable writable attr _clibdir: String
readable writable attr _bindir: String
readable writable attr _output_file: String
- readable writable attr _boost: Bool
- readable writable attr _no_cc: Bool
+ readable writable attr _boost: Bool = false
+ readable writable attr _no_cc: Bool = false
readable writable attr _ext_prefix: String
end
return res
end
# next number for new_number
- attr _number_cpt: Int
+ attr _number_cpt: Int = 0
# Add an indent level.
# New decl and instr will be indented.
readable writable attr _ctx: CContext = new CContext
# The current indent lever
- readable writable attr _indent_level: Int
+ readable writable attr _indent_level: Int = 0
# The current ToolContext
readable writable attr _tc: ToolContext
attr _primitive_info_cache: PrimitiveInfo
# If primitive_info result cached?
- attr _primitive_info_b: Bool
+ attr _primitive_info_b: Bool = false
# Return the primitive information of the class.
# Return null if the class is not primitive
private meth primitive_ctypes: HashMap[Symbol, PrimitiveInfo]
do
var res = new HashMap[Symbol, PrimitiveInfo]
- var pnames = ["Int", "Char", "Bool", "Float", "NativeString", "NativeArray", "Pointer"]
- var tagged = [true, true, true, false, false, false, false]
- var cnames = ["int", "char", "int", "float", "char *", "val_t *", "void *"]
+ var pnames = ["Int", "Char", "Bool", "Float", "NativeString", "NativeArray", "Pointer"]
+ var tagged = [true, true, true, false, false, false, false]
+ var cnames = ["bigint", "char", "int", "float", "char *", "val_t *", "void *"]
for i in [0..pnames.length[ do
var n = pnames[i].to_symbol
var pi = new PrimitiveInfo
meth cname: String
do
if _cname_cache == null then
- _cname_cache = cmangle(concrete_property.module.name, concrete_property.local_class.name, name)
+ _cname_cache = cmangle(module.name, local_class.name, name)
end
return _cname_cache
end