1" Vim syntax file
2" Language:	VOS CM macro
3" Maintainer:	Andrew McGill andrewm at lunch.za.net
4" Last Change:	Apr 06, 2007
5" Version:	1
6" URL:	http://lunch.za.net/
7"
8
9" For version 5.x: Clear all syntax items
10" For version 6.x: Quit when a syntax file was already loaded
11if exists("b:current_syntax")
12  finish
13endif
14
15syn case match
16" set iskeyword=48-57,_,a-z,A-Z
17
18syn match   voscmStatement     "^!"
19syn match voscmStatement	"&\(label\|begin_parameters\|end_parameters\|goto\|attach_input\|break\|continue\|control\|detach_input\|display_line\|display_line_partial\|echo\|eof\|eval\|if\|mode\|return\|while\|set\|set_string\|then\|else\|do\|done\|end\)\>"
20syn match  voscmJump		"\(&label\|&goto\)  *"  nextgroup=voscmLabelId
21syn match   voscmLabelId	contained "\<[A-Za-z][A-Z_a-z0-9]* *$"
22syn match  voscmSetvar		"\(&set_string\|&set\)  *"  nextgroup=voscmVariable
23syn match voscmError            "\(&set_string\|&set\)  *&" 
24syn match   voscmVariable	contained "\<[A-Za-z][A-Z_a-z0-9]\+\>"
25syn keyword voscmParamKeyword   contained number req string switch allow byte disable_input hidden length longword max min no_abbrev output_path req required req_for_form word 
26syn region  voscmParamList	matchgroup=voscmParam start="&begin_parameters" end="&end_parameters" contains=voscmParamKeyword,voscmString,voscmParamName,voscmParamId
27syn match   voscmParamName	contained "\(^\s*[A-Za-z_0-9]\+\s\+\)\@<=\k\+"
28syn match   voscmParamId	contained "\(^\s*\)\@<=\k\+"
29syn region par1 matchgroup=par1 start=/(/ end=/)/ contains=voscmFunction,voscmIdentifier,voscmString transparent
30" FIXME: functions should only be allowed after a bracket ... ie  (ask ...):
31syn keyword voscmFunction     contained abs access after ask before break byte calc ceil command_status concat
32syn keyword voscmFunction     contained contents path_name copy count current_dir current_module date date_time
33syn keyword voscmFunction     contained decimal directory_name end_of_file exists file_info floor given group_name
34syn keyword voscmFunction     contained has_access hexadecimal home_dir index iso_date iso_date_time language_name
35syn keyword voscmFunction     contained length lock_type locked ltrim master_disk max message min mod module_info
36syn keyword voscmFunction     contained module_name object_name online path_name person_name process_dir process_info
37syn keyword voscmFunction     contained process_type quote rank referencing_dir reverse rtrim search
38syn keyword voscmFunction     contained software_purchased string substitute substr system_name terminal_info
39syn keyword voscmFunction     contained terminal_name time translate trunc unique_string unquote user_name verify
40syn keyword voscmFunction     contained where_path
41syn keyword voscmTodo contained	TODO FIXME XXX DEBUG NOTE
42syn match voscmTab              "\t\+"
43
44syn keyword voscmCommand        add_entry_names add_library_path add_profile analyze_pc_samples attach_default_output attach_port batch bind break_process c c_preprocess call_thru cancel_batch_requests cancel_device_reservation cancel_print_requests cc change_current_dir check_posix cobol comment_on_manual compare_dirs compare_files convert_text_file copy_dir copy_file copy_tape cpp create_data_object create_deleted_record_index create_dir create_file create_index create_record_index create_tape_volumes cvt_fixed_to_stream cvt_stream_to_fixed debug delete_dir delete_file delete_index delete_library_path detach_default_output detach_port dismount_tape display display_access display_access_list display_batch_status display_current_dir display_current_module display_date_time display_default_access_list display_device_info display_dir_status display_disk_info display_disk_usage display_error display_file display_file_status display_line display_notices display_object_module_info display_print_defaults display_print_status display_program_module display_system_usage display_tape_params display_terminal_parameters dump_file dump_record dump_tape edit edit_form emacs enforce_region_locks fortran get_external_variable give_access give_default_access handle_sig_dfl harvest_pc_samples help kill line_edit link link_dirs list list_batch_requests list_devices list_gateways list_library_paths list_modules list_port_attachments list_print_requests list_process_cmd_limits list_save_tape list_systems list_tape list_terminal_types list_users locate_files locate_large_files login logout mount_tape move_device_reservation move_dir move_file mp_debug nls_edit_form pascal pl1 position_tape preprocess_file print profile propagate_access read_tape ready remove_access remove_default_access rename reserve_device restore_object save_object send_message set set_cpu_time_limit set_expiration_date set_external_variable set_file_allocation set_implicit_locking set_index_flags set_language set_library_paths set_line_wrap_width set_log_protected_file set_owner_access set_pipe_file set_priority set_ready set_safety_switch set_second_tape set_tape_drive_params set_tape_file_params set_tape_mount_params set_terminal_parameters set_text_file set_time_zone sleep sort start_logging start_process stop_logging stop_process tail_file text_data_merge translate_links truncate_file unlink update_batch_requests update_print_requests update_process_cmd_limits use_abbreviations use_message_file vcc verify_posix_access verify_save verify_system_access walk_dir where_command where_path who_locked write_tape 
45
46syn match voscmIdentifier	"&[A-Za-z][a-z0-9_A-Z]*&"
47
48syn match voscmString		"'[^']*'"
49
50" Number formats
51syn match voscmNumber		"\<\d\+\>"
52"Floating point number part only
53syn match voscmDecimalNumber	"\.\d\+\([eE][-+]\=\d\)\=\>"
54
55"syn region voscmComment	start="^[ 	]*&[ 	]+"	end="$"
56"syn match voscmComment		"^[ 	]*&[ 	].*$"
57"syn match voscmComment		"^&$"
58syn region voscmComment		start="^[ 	]*&[ 	]" end="$" contains=voscmTodo
59syn match voscmComment		"^&$"
60syn match voscmContinuation	"&+$"
61
62"syn match  voscmIdentifier	"[A-Za-z0-9&._-]\+"
63
64"Synchronization with Statement terminator $
65" syn sync maxlines=100
66
67hi def link voscmConditional	Conditional
68hi def link voscmStatement	Statement
69hi def link voscmSetvar         Statement
70hi def link voscmNumber         Number
71hi def link voscmDecimalNumber	Float
72hi def link voscmString         String
73hi def link voscmIdentifier	Identifier
74hi def link voscmVariable	Identifier
75hi def link voscmComment	Comment
76hi def link voscmJump	        Statement
77hi def link voscmContinuation	Macro
78hi def link voscmLabelId	String
79hi def link voscmParamList	NONE
80hi def link voscmParamId	Identifier
81hi def link voscmParamName	String
82hi def link voscmParam	        Statement
83hi def link voscmParamKeyword	Statement
84hi def link voscmFunction	Function
85hi def link voscmCommand	Structure
86"hi def link voscmIdentifier	NONE
87"hi def link voscmSpecial	Special   " not used 
88hi def link voscmTodo           Todo
89hi def link voscmTab          	Error
90hi def link voscmError         	Error
91
92let b:current_syntax = "voscm"
93
94" vim: ts=8
95