import breakpoint
intrude import naive_interpreter
+import nitx
redef class ToolContext
# -d
end
redef class ModelBuilder
- # Execute the program from the entry point (Sys::main) of the `mainmodule'
- # `arguments' are the command-line arguments in order
+ # Execute the program from the entry point (Sys::main) of the `mainmodule`
+ # `arguments` are the command-line arguments in order
# REQUIRE that:
# 1. the AST is fully loaded.
# 2. the model is fully built.
end
end
-# The class extending NaiveInterpreter by adding debugging methods
+# The class extending `NaiveInterpreter` by adding debugging methods
class Debugger
super NaiveInterpreter
# Step-over command
else if command == "n" then
return step_over
+ # Opens a new NitIndex prompt on current model
+ else if command == "nitx" then
+ new NitIndex.with_infos(modelbuilder, self.mainmodule).prompt
+ return true
# Continues execution until the end
else if command == "c" then
return continue_exec
# Effectively untraces the variable called *variable_name*
#
+ # Returns true if the variable exists, false otherwise
private fun untrace_variable(variable_name: String): Bool
do
var to_remove: nullable TraceObject = null
# If it is a primitive type, its value is directly printed
fun print_instance(instance: Instance)
do
+ print "Printing innards of a variable"
+
if instance isa MutableInstance then
var attributes = instance.attributes
print "Object : {instance}"
else
print "Found variable {instance}"
end
+
+ print "Stopping printing innards of a variable"
end
# Prints the attributes demanded in a SequenceRead