nitc :: CodeWriter
Instances are added to file.writers
at construction.
nitc :: CodeWriter :: _decl_lines
Lines of code for declarations (written at the top of the body)nitc :: CodeWriter :: decl_lines
Lines of code for declarations (written at the top of the body)nitc :: CodeWriter :: decl_lines=
Lines of code for declarations (written at the top of the body)nitc :: CodeWriter :: defaultinit
nitc $ CodeWriter :: SELF
Type of this instance, automatically specialized in every classnitc $ CodeWriter :: init
nitc :: CodeWriter :: _decl_lines
Lines of code for declarations (written at the top of the body)core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: CodeWriter :: decl_lines
Lines of code for declarations (written at the top of the body)nitc :: CodeWriter :: decl_lines=
Lines of code for declarations (written at the top of the body)nitc :: CodeWriter :: defaultinit
core :: Object :: defaultinit
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).
# Store generated lines
#
# Instances are added to `file.writers` at construction.
class CodeWriter
# Parent `CodeFile`
var file: CodeFile
# Main lines of code (written at the bottom of the body)
var lines = new Array[String]
# Lines of code for declarations (written at the top of the body)
var decl_lines = new Array[String]
# Add a line in the main lines of code (to `lines`)
fun add(s: String) do self.lines.add(s)
# Add a declaration line (to `decl_lines`)
#
# Used for local and global declaration.
fun add_decl(s: String) do self.decl_lines.add(s)
init
do
file.writers.add(self)
end
end
src/compiler/abstract_compiler.nit:1293,1--1318,3