class

Dragonstone::Compiler

Inherits Dragonstone::OPC < Reference < Object

Constants

BINARY_OPCODE = {:+ => OPC::ADD, :&+ => OPC::ADD, :- => OPC::SUB, :&- => OPC::SUB, :* => OPC::MUL, :&* => OPC::MUL, :/ => OPC::DIV, :// => OPC::FLOOR_DIV, :% => OPC::MOD, :** => OPC::POW, :&** => OPC::POW, :& => OPC::BIT_AND, :| => OPC::BIT_OR, :^ => OPC::BIT_XOR, :<< => OPC::SHL, :>> => OPC::SHR, :== => OPC::EQ, :!= => OPC::NE, :< => OPC::LT, :<= => OPC::LE, :> => OPC::GT, :>= => OPC::GE, :<=> => OPC::CMP}
UNARY_OPCODE = {:+ => OPC::POS, :&+ => OPC::POS, :- => OPC::NEG, :&- => OPC::NEG, :! => OPC::NOT, :~ => OPC::BIT_NOT}

Constructors

new(name_pool : NamePool | Nil = nil)
Source

Class methods

compile(ast : AST::Program) : CompiledCode
Source

Instance methods

compile(ast : AST::Program) : CompiledCode
Source
compile_function_body(statements : Array(AST::Node), preserve_last : Bool = false, parameter_names : Array(String) = [] of String) : CompiledCode
Source
compile_statements(statements : Array(AST::Node), preserve_last : Bool = false)
Source

Nested types