Create a custom scheme

Discussion Forums discussion Create a custom scheme

This topic contains 1 reply, has 2 voices, and was last updated by  lolouk44 11 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
Author Posts
Author Posts
November 3, 2010 at 3:19 pm #5123


I’m trying to create a new scheme for Karel. Karel is the language for the Fanuc Robot. I use programmer’s Notepad for many year and I really want to keep using it with this language.

It mostly work but there’s two things that I struggle with.

First, the pre-processor directive begin with %. I would like to change the color of any line which begin with %.

Second, I’d like to add folding. I want to fold section that begin with BEGIN and end with END.

Thank you for looking at my trouble!

This is my karel.schemedef, sorry for the number of keyword:

<?xml version="1.0" ?>
<keyword-class name="kk1">
abort const get_var nopause stop about continue go not string abs coordinated goto nowait structure after cr group of then along delay group_assoc
open time also disable hand or timer and disconnect hold path to array div if pathheader tpenable array_len do in pause type at downto independent
position unhold attach dram integer powerup uninit away else jointpos program unpause axis enable jointpos1 pulse until before end jointpos2 purge
using begin endcondition jointpos3 read var boolean endfor jointpos4 real vector by endif jointpos5 relative via byname endmove jointpos6 relax
vis_process byte endselect jointpos7 release wait cam_setup endstructure jointpos8 repeat when cancel endusing jointpos9 restore while case endwhile
mod resume with close error model return write cmos eval move routine xyzwpr command event near select xyzwprext common_assoc end noabort semaphore
condition file node set_var config for nodedata short connect from nomessage signal
<keyword-class name="kk2">
call_prog call_proglin curr_prog file_list prog_list var_info var_list daq_checkp daq_regpipe daq_start daq_stop daq_unreg daq_write err_data post_err
check_name copy_file delete_file dismount_dev format_dev mount_dev move_file print_file purge_dev rename_file xml_addtag xml_getdata xml_remtag xml_scan
xml_setvar bytes_ahead bytes_left clr_io_stat get_file_pos get_port_atr io_status msg_connect msg_disco msg_ping pipe_config set_file_atr set_file_pos
set_port_atr vol_space clr_port_sim get_port_asg get_port_cmt get_port_mod get_port_sim get_port_val io_mod_type set_port_asg set_port_cmt set_port_mod
set_port_sim set_port_val kcl kcl_no_wait kcl_status clear create_var load load_status prog_backup prog_clear prog_restore rename_var rename_vars
save save_dram mirror cncl_stp_mtn motion_ctl reset abort_task clear_sema cont_task get_tsk_info lock_group pause_task pend_sema post_sema run_task
sema_count set_tsk_attr set_tsk_name unlock_group append_node copy_path delete_node insert_node node_size path_len add_bynamepc add_intpc add_realpc
add_stringpc send_datapc send_eventpc check_epos cnv_jpos_rel cnv_rel_jpos curpos curjpos frame in_range j_in_range joint2pos pos pos2joint set_perch
unpos set_preg_cmt set_reg_cmt append_queue copy_queue delete_queue get_queue init_queue insert_queue modify_queue clr_pos_reg get_jpos_reg get_pos_reg
get_preg_cmt get_reg get_reg_cmt pos_reg_type set_epos_reg set_int_reg set_jpos_reg set_pos_reg set_real_reg cnv_conf_str cnv_int_str cnv_real_str
cnv_str_conf cnv_str_int cnv_str_real abs acos array_len asin atan2 byname chr cos exp get_var index inv ln ord round set_var sin sqrt str_len sub_str
tan trunc uninit cnv_str_time cnv_time_str get_time get_usec_sub get_usec_tim set_time avl_pos_num close_tpe copy_tpe create_tpe del_inst_tpe
get_attr_prg get_jpos_tpe get_pos_frm get_pos_tpe get_pos_typ get_tpe_cmt get_tpe_prm open_tpe select_tpe set_attr_prg set_epos_tpe set_jpos_tpe
set_pos_tpe set_tpe_cmt set_trns_tpe translate act_screen add_dict att_window_d att_window_s check_dict cnc_dyn_disb cnc_dyn_dise cnc_dyn_disi
cnc_dyn_disp cnc_dyn_disr cnc_dyn_diss def_screen def_window det_window disctrl_alph disctrl_form disctrl_list disctrl_plmn disctrl_sbmn disctrl_tbl
force_spmenu ini_dyn_disb ini_dyn_dise ini_dyn_disi ini_dyn_disp ini_dyn_disr ini_dyn_diss pop_key_rd push_key_rd read_dict read_dict_v read_kb
remove_dict set_cursor set_lang write_dict write_dict_v approach orient

<schemedef name="karel" title="Karel" author="Mathieu Levesque" url="; version="1"
casesensitive="false" braces="{[()]}">

<!-- Max 2 -->
<!-- Double quotes string, with as an escape character. -->
<stringtype id="0" start="'" end="'" multiline="false" />

<!-- continuation="" -->
<line start="--" />

<numbers start="[0-9]" content="[0-9a-f.x]" />

<!-- From here on is the traditional scheme definition block... -->
<lexer name="karel" />
<style name="Default" key="32" />
<style name="Line Comment" key="1" class="comment" />
<style name="Number" key="4" class="number" />
<style name="Keywords" key="5" class="keyword" />
<style name="Keywords 2" key="6" class="keyword" fore="f80000" />
<style name="String" key="10" class="string" />

<keyword key="0" name="Keywords" class="kk1"/>
<keyword key="1" name="Keywords 2" class="kk2"/>


October 11, 2013 at 4:21 pm #20021


Hi Math,

Sorry no answer but a question. I’m trying to create a new scheme for AutoHotKey scripts and I’m struggling to understand how that works.
Seeing as you managed to get at least something working, would you mind giving me a brief guide on how to create custom schemes?


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.