_index = 0
end
- redef readable attr _index: Int
+ redef readable attr _index: Int = 0
attr _array: AbstractArray[E]
end
end
# The last positive result given by a index(1) call
- attr _last_index: Int
+ attr _last_index: Int = 0
# Where is the `key' in `_item'?
# return -1 if not found
class FDIStream
special FDStream
special IStream
- redef readable attr _eof: Bool
+ redef readable attr _eof: Bool = false
redef meth read_char
do
private import utils
redef class ToolContext
- readable writable attr _global: Bool
- readable writable attr _attr_sim: Bool
+ 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
end
# Is the global class an interface?
- readable writable attr _is_interface: Bool
+ readable writable attr _is_interface: Bool = false
# Is the global class an abstract class?
- readable writable attr _is_abstract: Bool
+ readable writable attr _is_abstract: Bool = false
# Is the global class a universal class?
- readable writable attr _is_universal: Bool
+ readable writable attr _is_universal: Bool = false
# Visibility of the global class
# 1 -> public
# 3 -> private
- readable writable attr _visibility_level: Int
+ readable writable attr _visibility_level: Int = 1 # FIXME: why this should be defined ?
# Is the global class a mixin class?
# A mixin class inherits all constructors from a superclass
# 1 -> public
# 2 -> protected
# 3 -> private
- readable writable attr _visibility_level: Int
+ readable writable attr _visibility_level: Int = 1 # FIXME: why this should be defined ?
end
# Local properties are properties defined (explicitely or not) in a local class
redef meth to_s do return name.to_s
# Is the concrete property contain a `super' in the body?
- readable writable attr _need_super: Bool
+ readable writable attr _need_super: Bool = false
protected init(n: Symbol, bc: MMLocalClass)
do
# Is the class computing super.
# Used to detect specialization loops.
- attr _computing_super: Bool
+ attr _computing_super: Bool = false
# Compute super classes of a class
meth compute_super_classes
end
# Cached value of _order.length to validade smallers_cache
- attr _smallers_last_length: Int
+ attr _smallers_last_length: Int = 0
# Cached result of smallers
attr _smallers_cache: Set[E]
class ToolContext
special MMContext
# Number of errors
- readable attr _error_count: Int
+ readable attr _error_count: Int = 0
# Number of warnings
- readable attr _warning_count: Int
+ readable attr _warning_count: Int = 0
# Display an error
meth error(s: String)
attr _token: Token
# Lexer current state
- attr _state: Int
+ attr _state: Int = 0
# Name of the stream (as given to tokens)
readable attr _filename: String
attr _stream_pos: Int
# Current line number in the input stream
- attr _line: Int
+ attr _line: Int = 0
# Current column in the input stream
- attr _pos: Int
+ attr _pos: Int = 0
# Was the last character a cariage-return?
- attr _cr: Bool
+ attr _cr: Bool = false
# If the end of stream?
- attr _eof: Bool
+ attr _eof: Bool = false
# Current working text read from the input stream
attr _text: String
attr _token: Token
# Lexer current state
- attr _state: Int
+ attr _state: Int = 0
# Name of the stream (as given to tokens)
readable attr _filename: String
attr _stream_pos: Int
# Current line number in the input stream
- attr _line: Int
+ attr _line: Int = 0
# Current column in the input stream
- attr _pos: Int
+ attr _pos: Int = 0
# Was the last character a cariage-return?
- attr _cr: Bool
+ attr _cr: Bool = false
# If the end of stream?
- attr _eof: Bool
+ attr _eof: Bool = false
# Current working text read from the input stream
attr _text: String
end
# Number of nested once
- readable writable attr _once_count: Int
+ readable writable attr _once_count: Int = 0
# Current knowledge about variables types
readable writable attr _control_flow_ctx: ControlFlowContext
readable attr _prev: ControlFlowContext
# Is a control flow break met? (return, break, continue)
- readable writable attr _unreash: Bool
+ readable writable attr _unreash: Bool = false
# Is a control flow already broken?
# Used to avoid repeating the same error message
- readable writable attr _already_unreash: Bool
+ readable writable attr _already_unreash: Bool = false
# Current controlable block (for or while)
readable writable attr _base_block: AControlableBlock
redef class AType
attr _stype_cache: MMType
- attr _stype_cached: Bool
+ attr _stype_cached: Bool = false
redef meth get_local_class(v)
do
readable writable attr _f: F
readable writable attr _f2: F2
- init do end
+ init(e: E, f: F, f2: F2)
+ do
+ _e = e
+ _f = f
+ _f2 = f2
+ end
end
-var gi = new G[Int]
+var gi = new G[Int](0, 0, 0)
gi.e = 1 + gi.e
gi.e = 1 + gi.f
_is_val1 = not _is_val1
end
- attr _is_val1: Bool
+ attr _is_val1: Bool = false
init do end
end
class Scheduler
attr _time_list: Array[Couple[Int, WakeUpNode]]
- attr _time: Int # What time is it ?
+ attr _time: Int = 0 # What time is it ?
meth add_event(n: WakeUpNode, d: Int)
# The node `n' whant to be weaked up in `d' time units
do
init
do
+ moveto(0, 0)
end
init at(x: Int, y: Int)
# The Time class represents a quantity of time
class Time
# Internally, the quantity of time is stored in minutes
- readable writable attr _min: Int
+ readable writable attr _min: Int = 0
# The quantity ot time (in hours)
meth hour: Int
# * try to change the optimization flags
# * try to update your gcc version
class Foo
- attr _count: Int
+ attr _count: Int = 0
meth run: Int
do
# Under some case gcc produce bad code here and make the if
# limitations under the License.
class A
-
- attr _a_: Int
+ attr _a_: Int = 0
meth a: Int
do
# limitations under the License.
class A
- readable writable attr _a: Int #!alt1#
- #alt1#readable writable attr _a: Object
+ readable writable attr _a: Int = 0#!alt1#
+ #alt1#readable writable attr _a: Object = 0
init do end
meth foo
do
end
init
- do end
+ do
+ _a = 0
+ end
init foo
do