class Myst::VM

Defined in:

myst/vm.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(source : IO = IO::Memory.new, *, source_name : String = "eval_input", with_stdlib? : Bool = true, use_stdios? : Bool = false, product? : Bool = true) #

This constructor is not really meant to be called unless you're initializing an "empty" vm Instead .for_file and .for_content should be used Many of these parameters would be rarely used All having default values, i don't really think the amount of parameters is a problem


[View source]

Class Method Detail

def self.eval(string_source : String, *, with_stdlib? : Bool = true, use_stdios? : Bool = false, product? : Bool = true) #

[View source]
def self.for_content(string_source : String, *, with_stdlib? : Bool = true, use_stdios? : Bool = false, product? : Bool = true) #

[View source]
def self.for_file(source_file : String, *, with_stdlib? : Bool = true, use_stdios? : Bool = false, product? : Bool = true) #

[View source]
def self.run(source_file : String, *, with_stdlib? : Bool = true, use_stdios? : Bool = false, product? : Bool = true) #

[View source]

Instance Method Detail

def errput #

[View source]
def errput=(io : IO) #

[View source]
def eval(program : String) #

Tries to run the provided string as a myst program


[View source]
def input #

[View source]
def input=(io : IO) #

[View source]
def interpreter : Myst::Interpreter #

[View source]
def output #

[View source]
def output=(io : IO) #

[View source]
def print_ast(io : IO = STDOUT) #

[View source]
def program=(program) #

[View source]
def require(*programs) #

[View source]
def reset!(with_stdlib? : Bool = @with_stdlib) #

[View source]
def run(program : Node) #

Standard interface for running a parsed program. Using this interface ensures that every program goes through the proper phases of interpretation (semantic analysis, interpretation, etc.).


[View source]
def run #

Runs the @program property


[View source]
def run(*programs) #

Runs file(s) and IO(s)


[View source]
def semantic_visitor : Myst::Semantic::Visitor #

[View source]
def use_stdios! #

[View source]
def use_stdios=(use_stdios : Bool) #

Helper method to quickly set all io to std or new


[View source]
def use_stdios? #

[View source]