Class: Lignite::OpCompiler

Inherits:
Object
  • Object
show all
Includes:
Bytes, Ev3Ops, Logger
Defined in:
lib/lignite/op_compiler.rb

Overview

Compiles methods for all the instructions in ev3.yml The methods return the ByteStrings corresponding to the ops.

Constant Summary

Constants included from Ev3Ops

Ev3Ops::MULTIPLEX_ARRAY, Ev3Ops::MULTIPLEX_COM_GET, Ev3Ops::MULTIPLEX_COM_READ, Ev3Ops::MULTIPLEX_COM_SET, Ev3Ops::MULTIPLEX_COM_WRITE, Ev3Ops::MULTIPLEX_FILE, Ev3Ops::MULTIPLEX_FILENAME, Ev3Ops::MULTIPLEX_INFO, Ev3Ops::MULTIPLEX_INPUT_DEVICE, Ev3Ops::MULTIPLEX_MATH, Ev3Ops::MULTIPLEX_PROGRAM_INFO, Ev3Ops::MULTIPLEX_SOUND, Ev3Ops::MULTIPLEX_STRINGS, Ev3Ops::MULTIPLEX_TST, Ev3Ops::MULTIPLEX_UI_BUTTON, Ev3Ops::MULTIPLEX_UI_DRAW, Ev3Ops::MULTIPLEX_UI_READ, Ev3Ops::MULTIPLEX_UI_WRITE

Instance Method Summary collapse

Methods included from Ev3Ops

#add16, #add32, #add8, #addf, #and16, #and32, #and8, #array, #array_append, #array_copy, #array_create16, #array_create32, #array_create8, #array_createf, #array_delete, #array_destroy, #array_fill, #array_init16, #array_init32, #array_init8, #array_initf, #array_read, #array_read_content, #array_read_size, #array_resize, #array_set_size, #array_size, #array_write, #array_write_content, #bp0, #bp1, #bp2, #bp3, #bp_set, #call, #com_get, #com_get_connec_item, #com_get_connec_items, #com_get_favour_item, #com_get_favour_items, #com_get_get_brickname, #com_get_get_encrypt, #com_get_get_id, #com_get_get_incoming, #com_get_get_mode2, #com_get_get_network, #com_get_get_on_off, #com_get_get_pin, #com_get_get_present, #com_get_get_result, #com_get_get_visible, #com_get_list_state, #com_get_search_item, #com_get_search_items, #com_read, #com_read_command, #com_readdata, #com_ready, #com_remove, #com_set, #com_set_set_brickname, #com_set_set_connection, #com_set_set_encrypt, #com_set_set_mode2, #com_set_set_movedown, #com_set_set_moveup, #com_set_set_on_off, #com_set_set_passkey, #com_set_set_pin, #com_set_set_search, #com_set_set_ssid, #com_set_set_visible, #com_test, #com_write, #com_write_reply, #com_writedata, #com_writefile, #cp_eq16, #cp_eq32, #cp_eq8, #cp_eqf, #cp_gt16, #cp_gt32, #cp_gt8, #cp_gteq16, #cp_gteq32, #cp_gteq8, #cp_gteqf, #cp_gtf, #cp_lt16, #cp_lt32, #cp_lt8, #cp_lteq16, #cp_lteq32, #cp_lteq8, #cp_lteqf, #cp_ltf, #cp_neq16, #cp_neq32, #cp_neq8, #cp_neqf, #div16, #div32, #div8, #divf, #do, #dynload_entry_0, #dynload_entry_1, #dynload_entry_2, #dynload_entry_3, #dynload_entry_4, #dynload_entry_5, #dynload_entry_6, #dynload_entry_7, #dynload_entry_8, #dynload_entry_9, #dynload_get_vm, #dynload_vmexit, #dynload_vmload, #error, #file, #file_close, #file_close_log, #file_del_cache_file, #file_del_subfolder, #file_get_cache_file, #file_get_cache_files, #file_get_folders, #file_get_handle, #file_get_image, #file_get_item, #file_get_log_name, #file_get_log_sync_time, #file_get_pool, #file_get_subfolder_name, #file_load_image, #file_make_folder, #file_md5sum, #file_move, #file_open_append, #file_open_log, #file_open_read, #file_open_write, #file_put_cache_file, #file_read_bytes, #file_read_text, #file_read_value, #file_remove, #file_set_log_sync_time, #file_write_bytes, #file_write_log, #file_write_text, #file_write_value, #filename, #filename_check, #filename_exist, #filename_get_foldername, #filename_merge, #filename_pack, #filename_split, #filename_totalsize, #filename_unpack, #info, #info_errortext, #info_get_error, #info_get_minutes, #info_get_volume, #info_set_error, #info_set_minutes, #info_set_volume, #init_bytes, #input_device, #input_device_cal_default, #input_device_cal_max, #input_device_cal_min, #input_device_cal_minmax, #input_device_clr_all, #input_device_clr_changes, #input_device_get_bumps, #input_device_get_changes, #input_device_get_connection, #input_device_get_figures, #input_device_get_format, #input_device_get_minmax, #input_device_get_modename, #input_device_get_name, #input_device_get_raw, #input_device_get_symbol, #input_device_get_typemode, #input_device_insert_type, #input_device_list, #input_device_ready_iic, #input_device_ready_pct, #input_device_ready_raw, #input_device_ready_si, #input_device_set_raw, #input_device_set_typemode, #input_device_setup, #input_device_stop_all, #input_iic_read, #input_iic_status, #input_iic_write, #input_read, #input_readext, #input_readsi, #input_ready, #input_sample, #input_set_autoid, #input_set_conn, #input_test, #input_write, #jr, #jr_eq16, #jr_eq32, #jr_eq8, #jr_eqf, #jr_false, #jr_gt16, #jr_gt32, #jr_gt8, #jr_gteq16, #jr_gteq32, #jr_gteq8, #jr_gteqf, #jr_gtf, #jr_lt16, #jr_lt32, #jr_lt8, #jr_lteq16, #jr_lteq32, #jr_lteq8, #jr_lteqf, #jr_ltf, #jr_nan, #jr_neq16, #jr_neq32, #jr_neq8, #jr_neqf, #jr_true, #keep_alive, #mailbox_close, #mailbox_open, #mailbox_read, #mailbox_ready, #mailbox_size, #mailbox_test, #mailbox_write, #math, #math_abs, #math_acos, #math_asin, #math_atan, #math_ceil, #math_cos, #math_exp, #math_floor, #math_ln, #math_log, #math_mod, #math_mod16, #math_mod32, #math_mod8, #math_negate, #math_pow, #math_round, #math_sin, #math_sqrt, #math_tan, #math_trunc, #memory_read, #memory_usage, #memory_write, #move16_16, #move16_32, #move16_8, #move16_f, #move32_16, #move32_32, #move32_8, #move32_f, #move8_16, #move8_32, #move8_8, #move8_f, #movef_16, #movef_32, #movef_8, #movef_f, #mul16, #mul32, #mul8, #mulf, #nop, #note_to_freq, #object_end, #object_start, #object_stop, #object_trig, #object_wait, #or16, #or32, #or8, #output_clr_count, #output_get_count, #output_get_type, #output_polarity, #output_position, #output_power, #output_prg_stop, #output_read, #output_ready, #output_reset, #output_set_type, #output_speed, #output_start, #output_step_power, #output_step_speed, #output_step_sync, #output_stop, #output_test, #output_time_power, #output_time_speed, #output_time_sync, #port_cnv_input, #port_cnv_output, #probe, #program_info, #program_info_get_prgname, #program_info_get_prgresult, #program_info_get_speed, #program_info_get_status, #program_info_obj_start, #program_info_obj_stop, #program_info_set_instr, #program_start, #program_stop, #random, #read16, #read32, #read8, #readf, #return, #rl16, #rl32, #rl8, #select16, #select32, #select8, #selectf, #sleep, #sound, #sound_break, #sound_ready, #sound_service, #sound_test, #sound_tone, #strings, #strings_add, #strings_compare, #strings_duplicate, #strings_get_size, #strings_number_formatted, #strings_number_to_string, #strings_string_to_value, #strings_strip, #strings_sub, #strings_value_formatted, #strings_value_to_string, #sub16, #sub32, #sub8, #subf, #system, #timer_read, #timer_read_us, #timer_ready, #timer_wait, #tst, #tst_tst_accu_switch, #tst_tst_boot_mode2, #tst_tst_close, #tst_tst_close_mode2, #tst_tst_disable_uart, #tst_tst_enable_uart, #tst_tst_open, #tst_tst_poll_mode2, #tst_tst_ram_check, #tst_tst_read_adc, #tst_tst_read_pins, #tst_tst_read_uart, #tst_tst_write_pins, #tst_tst_write_uart, #ui_button, #ui_button_flush, #ui_button_get_back_block, #ui_button_get_bumbed, #ui_button_get_bumped, #ui_button_get_click, #ui_button_get_horz, #ui_button_get_vert, #ui_button_longpress, #ui_button_press, #ui_button_pressed, #ui_button_release, #ui_button_set_back_block, #ui_button_shortpress, #ui_button_testlongpress, #ui_button_testshortpress, #ui_button_wait_for_press, #ui_draw, #ui_draw_bmpfile, #ui_draw_browse, #ui_draw_circle, #ui_draw_clean, #ui_draw_dotline, #ui_draw_fillcircle, #ui_draw_fillrect, #ui_draw_fillwindow, #ui_draw_graph_draw, #ui_draw_graph_setup, #ui_draw_icon, #ui_draw_icon_question, #ui_draw_inverserect, #ui_draw_keyboard, #ui_draw_line, #ui_draw_notification, #ui_draw_picture, #ui_draw_pixel, #ui_draw_popup, #ui_draw_question, #ui_draw_rect, #ui_draw_rectangle, #ui_draw_restore, #ui_draw_scroll, #ui_draw_select_font, #ui_draw_store, #ui_draw_text, #ui_draw_textbox, #ui_draw_topline, #ui_draw_update, #ui_draw_value, #ui_draw_vertbar, #ui_draw_view_unit, #ui_draw_view_value, #ui_flush, #ui_read, #ui_read_get_address, #ui_read_get_code, #ui_read_get_event, #ui_read_get_fw_build, #ui_read_get_fw_vers, #ui_read_get_hw_vers, #ui_read_get_ibatt, #ui_read_get_iint, #ui_read_get_imotor, #ui_read_get_ip, #ui_read_get_lbatt, #ui_read_get_os_build, #ui_read_get_os_vers, #ui_read_get_power, #ui_read_get_sdcard, #ui_read_get_shutdown, #ui_read_get_string, #ui_read_get_tbatt, #ui_read_get_usbstick, #ui_read_get_vbatt, #ui_read_get_version, #ui_read_get_warning, #ui_read_key, #ui_read_textbox_read, #ui_write, #ui_write_address, #ui_write_allow_pulse, #ui_write_code, #ui_write_download_end, #ui_write_floatvalue, #ui_write_graph_sample, #ui_write_init_run, #ui_write_led, #ui_write_power, #ui_write_put_string, #ui_write_screen_block, #ui_write_set_busy, #ui_write_set_pulse, #ui_write_set_testpin, #ui_write_stamp, #ui_write_terminal, #ui_write_textbox_append, #ui_write_update_run, #ui_write_value16, #ui_write_value32, #ui_write_value8, #ui_write_valuef, #ui_write_write_flush, #write16, #write32, #write8, #writef, #xor16, #xor32, #xor8

Methods included from Bytes

#bin_to_hex, #f32, #hex_to_bin, #u16, #u32, #u8, #unpack_f32, #unpack_u16, #unpack_u32, #unpack_u8

Methods included from Logger

default_logger, #logger

Constructor Details

#initialize(globals = nil, locals = nil) ⇒ OpCompiler

Returns a new instance of OpCompiler.

Parameters:



15
16
17
18
# File 'lib/lignite/op_compiler.rb', line 15

def initialize(globals = nil, locals = nil)
  @globals = globals
  @locals = locals
end