Skip to content

Instantly share code, notes, and snippets.

@RataDP
Last active August 29, 2015 14:18
Show Gist options
  • Save RataDP/ac509db35487e57d3192 to your computer and use it in GitHub Desktop.
Save RataDP/ac509db35487e57d3192 to your computer and use it in GitHub Desktop.
Configuration file of the highlight of syntax for ClassATM simulator in VIM
" Vim ftdetect file
" This file should be in $VIM/ftdetect/classvim.vim
au BufRead,BufNewFile *.rc set filetype=classatm
" Vim syntax file
" Language: Class ATM network configuration
" Maintainer: Borja Blasco Garci­a ( ratadp@gmail.com )
" Lastest Revision: 31 March 2015
" This file should be in $VIM/syntax/classatm.vim
if exists("b:current_syntax")
finish
endif
" ------------------------------------------------
" KEYWORD
" ------------------------------------------------
" Reserved words of the configuration
syntax keyword Reserved default demand parameter type
syntax keyword Reserved node user link path
" Parameters for the stadistics
syntax keyword Statics accuracy confid_level min_transient_length
syntax keyword Statics num_observation stat_batch_size trans_accuracy
syntax keyword Statics trans_batch_size trans_seq_length
" Global parameters
syntax keyword Global acf_file capacity cls_type
syntax keyword Global erica_maxmin_delta erica_target_util
syntax keyword Global number_of_classes read_all_traces speed_in_fiber
syntax keyword Global tcp_max_segment_size user_type vc_stat
syntax keyword Global wfq_tcp_band wfq_tcp_buffer_len
" Parameters for the user
syntax keyword User abr_adtf abr_cdf abr_icr abr_mcr
syntax keyword User abr_nrm abr_pcr abr_rdf abr_rif
syntax keyword User abr_tbe abr_trm mux_type number_of_connections
syntax keyword User priority_class service_category
"" User type 1
syntax keyword User u1_mess_length
"" User type 2
syntax keyword User u2_long_mess_length u2_short_mess_frac u2_short_mess_length
"" User type 3
syntax keyword User u3_mean_mess_len
"" User type 4
syntax keyword User u4_rate u4_talk_id
"" User type 5
syntax keyword User u5_mean_on_time u5_mean_off_time u5_rate u5_talk_id
"" User type 6
syntax keyword User u6_const_frac_1 u6_const_frac_2 u6_const_frac_3
syntax keyword User u6_const_len_1 u6_const_len_2 u6_const_len_3
syntax keyword User u6_generator_type u6_geom_len u6_mean_on_time
syntax keyword User u6_miniuser_num u6_onoff_int_time u6_outgoing_prob u6_station_distance
"" User
syntax keyword User uabr_destionation_id user_band_alloc_fact user_buffer user_cell_delay_var
"" User utcp
syntax keyword User utcp_client_mean_len_1 utcp_client_mean_req_time utcp_client_perc_1
syntax keyword User utcp_client_req_time utcp_destination_id utcp_generator_type
syntax keyword User utcp_granularity utcp_max_window utcp_rate
"" User uvideo
syntax keyword User uvideo_bitxframe uvideo_destionation_id uvideo_frame_rate
syntax keyword User uvideo_peak_rate uvideo_sep_collect uvideo_start_time
syntax keyword User uvideo_trace_file uvide_tx_policy
syntax keyword User wfq_band_alloc_fact
" Parameters for Links
syntax keyword Link buffer_class[] link_buffer link_length
syntax keyword Link link_max_threshold[] link_min_threshold[] link_timescale
syntax keyword Link policer_band_alloc_fact policer_cell_delay_var
syntax keyword Link rrm_max_threshold[] rrm_min_threshold[]
" Parameters for Nodes
syntax keyword Node control_policy erica_filter_type erica_measure_interval_cells
syntax keyword Node erica_measure_interval_time erica_p_target_delay node_elaboration_delay
syntax keyword Node pd_plus_threshold pid_iir_coeff rrm_sampling_time
" Parameters for CLServer
syntax keyword CLServer cls_elaboration_time cls_link_timescale
" User types
syntax keyword userType POISSON_CONST POISSON_BIMOD POISSON_GEOM
syntax keyword userType CBR_SOURCE ONOFF_CBR_SOURCE DQDB_SOURCE SHAPE_VP_POISSON_CONST
syntax keyword userType SHAPED_VP_POISSON_BIMOD SHAPED_VP_POISSON_GEOM SHAPED_VP_DQBD_SOURCE
syntax keyword userType SHAPED_VC_POISSON_CONST SHAPED_VC_POISSON_BIMOD SHAPED_VC_POISSON_GEOM
syntax keyword userType SHAPED_VC_DQBD_SOURCE
syntax keyword userType TCP_TRANSMITTER TCP_RECEIVER SINK_RECEIVER VIDEO_TRACE VIDEO_RECEIVER
syntax keyword userType AGGREGATE_CBR AGGREGATE_VBR TCP_CLIENT TCP_SERVER ABR_PLAIN
syntax keyword userType TYPETCP TYPETCP_REC TYPESINK TYPEVIDEO1
syntax keyword userType TYPEVIDEO_REC TYPEAGGR_CBRTYPEAGGR_VBR TYPETCP_CLIENT
syntax keyword userType TYPETCP_SERVER TYPEABR
"" User types regex for type<num>
syntax match userTypeNum 'TYPE\d*' contains=userType
" Costants
syntax keyword Costant geometric on_off immediate
syntax keyword Costant delayed true false
syntax keyword Costant burst_on_frame const_on_frame const_on_gop
syntax keyword Costant rrm_p rrm_pd rrm_pid
syntax keyword Costant erica erica_plus plain
syntax keyword Costant shaped abr cbr vbr ubr
syntax keyword Costant jain linear flat none
syntax keyword Costant overload background
syntax keyword Costant ATM_LINK SPECIAL_LINK
"
syntax keyword BlockWith with endwith to
syntax keyword BlockWord connected_to thru used_by parameter
syntax keyword BlockWord demand policing_on tag_on
syntax keyword BlockWord refers_to wfq_forced link_stat_on
" ------------------------------------------------
" REGIONS
" ------------------------------------------------
syntax region block start='with' end='endwith;' fold transparent contains=BlockWord,Block
syntax region comment start='\/\*' end='\*\/' fold keepend
" ------------------------------------------------
" Highlighting rules
" ------------------------------------------------
let b:current_syntax = "classatm"
hi def link Reserved Preproc
hi def link Statatic Identifier
hi def link Global Identifier
hi def link User Identifier
hi def link Link Identifier
hi def link Node Identifier
hi def link CLServer Identifier
hi def link userType Constant
hi def link Costant Constant
hi def link BlockWith Statement
hi def link BlockWord Type
hi def link comment Comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment