dotfiles

My dotfiles.
Log | Files | Refs | LICENSE

4gl.jsf (3571B)


      1 # JOE syntax highlight file for Progress 4GL
      2 # by Gediminas http://proc.w3.lt
      3 # Version 1.04
      4 
      5 =Idle
      6 =Comment
      7 =Constant
      8 =String		+Constant
      9 =Number		+Constant
     10 =Type
     11 =Ident
     12 
     13 # conditional operators, blocks
     14 =Keyword
     15 =Conditional	+Keyword
     16 =Operator	+Keyword
     17 
     18 # preprocessor include, definition, reference
     19 =Preproc
     20 =Include	+Preproc
     21 =PreRef		+Ident
     22 
     23 :idle Idle
     24 	*		idle
     25 	"/"		slash
     26 	"{"		brace
     27 	"&"		prep		buffer
     28 	"a-zA-Z"	ident		buffer
     29 	"'"		string		recolor=-1
     30 	"\""		string2		recolor=-1
     31 	"0-9"		number		recolor=-1 
     32 	"?"		question	recolor=-1
     33 
     34 # Comments - 2 levels of nesting allowed
     35 
     36 :slash Idle
     37 	*		idle		noeat
     38 	"*"		comment		recolor=-2
     39 :comment Comment comment
     40 	*		comment
     41 	"/"		slash2
     42 	"*"		maybe_end_comment
     43 	"BFHNTX"        comment         noeat call=comment_todo.comment_todo()
     44 :maybe_end_comment Comment comment
     45 	*		comment
     46 	"/"		idle
     47 	"*"		maybe_end_comment
     48 
     49 :slash2 Idle
     50 	*		comment		noeat
     51 	"*"		comment2	recolor=-2
     52 :comment2 Comment comment
     53 	*		comment2
     54 	"*"		maybe_end_comment2
     55 	"BFHNTX"        comment2         noeat call=comment_todo.comment_todo()
     56 :maybe_end_comment2 Comment comment
     57 	*		comment2
     58 	"/"		comment
     59 	"*"		maybe_end_comment2
     60 
     61 # Preprocessor
     62 #     Allow preprocessor name reference inside include file reference:
     63 #     {include/trace {&FILE-NAME} {&LINE-NUMBER}}
     64 
     65 :brace Include
     66 	*		include		noeat
     67 	"&"		scoped		recolor=-2
     68 	"}"		idle
     69 
     70 :include Include
     71 	*		include		recolor=-2
     72 	"{"		brace2
     73 	"}"		idle
     74 
     75 :brace2 Include
     76 	*		include2	noeat
     77 	"}"		idle
     78 
     79 :include2 Include
     80 	*		include2	recolor=-2
     81 	"}"		include
     82 
     83 :scoped PreRef
     84 	*		scoped
     85 	"}"		idle
     86 
     87 :prep Preproc
     88 	*			idle		noeat istrings
     89 	"&IF"			predir
     90 	"&THEN"			predir
     91 	"&ELSEIF"		predir
     92 	"&ELSE"			predir
     93 	"&ENDIF"		predir
     94 	"&SCOPED-DEFINE"	predir
     95 	"&SCOP"			predir
     96 	"&GLOBAL-DEFINE"	predir
     97 	"&GLOB"			predir
     98 	"&MESSAGE"		predir
     99 	"&UNDEFINE"		predir
    100 	"&UNDEF"		predir
    101 done
    102 	"-a-zA-Z0-9_"		prep
    103 
    104 :predir Preproc
    105 	*		idle		noeat
    106 
    107 
    108 # String constants, copied from pascal.jsf with " added
    109 
    110 :string String string
    111 	*		string
    112 	"\n"		idle
    113 	"'"		maybe_end_string
    114 
    115 :maybe_end_string String string
    116 	*		idle		recolor=-1 noeat
    117 	"'"		string
    118 
    119 :string2 String string
    120 	*		string2
    121 	"\n"		idle
    122 	"\""		maybe_end_string2
    123 
    124 :maybe_end_string2 String string
    125 	*		idle		recolor=-1 noeat
    126 	"\""		string2
    127 
    128 # Numeric constant, same as pascal.jsf
    129 
    130 :number Number
    131 	*		idle		noeat
    132 	"0-9"		number
    133 	"eE"		epart
    134 	"."		dot
    135 
    136 :dot Number
    137 	*		idle	noeat
    138 	"0-9"		float
    139 
    140 :float Number
    141 	*		idle	noeat
    142 	"eE"		epart
    143 	"0-9"		float
    144 
    145 :epart Number
    146 	*		idle	noeat
    147 	"0-9+\-"	enum
    148 
    149 :enum Number
    150 	*		idle	noeat
    151 	"0-9"		enum
    152 
    153 :question Constant
    154 	*		idle noeat
    155 
    156 # Keywords
    157 # Available jumps: cond type oper kw
    158 
    159 # TODO: This needs to be vastly expanded, it seems like every other
    160 # token in this language is a keyword.
    161 
    162 :ident Ident
    163 	*		idle		noeat istrings
    164 	"assign"	cond
    165 	"case"		cond
    166 	"cha"		type
    167 	"char"		type
    168 	"character"	type
    169 	"create"	reserved
    170 	"dat"		type
    171 	"date"		type
    172 	"dec"		type
    173 	"decimal"	type
    174 	"defined"	oper
    175 	"delete"	reserved
    176 	"do"		reserved
    177 	"else"		cond
    178 	"end"		cond
    179 	"find"		reserved
    180 	"for"		reserved
    181 	"function"	cond
    182 	"get"		reserved
    183 	"handle"	type
    184 	"if"		cond
    185 	"int"		type
    186 	"integer"	type
    187 	"leave"		cond
    188 	"log"		type
    189 	"logical"	type
    190 	"memptr"	type
    191 	"next"		cond
    192 	"otherwise"	cond
    193 	"param"		cond
    194 	"parameter"	cond
    195 	"procedure"	cond
    196 	"raw"		type
    197 	"rec"		type
    198 	"repeat"	cond
    199 	"reposition"	reserved
    200 	"return"	cond
    201 	"rowid"		type
    202 	"run"		cond
    203 	"then"		cond
    204 	"when"		cond
    205 	"widget-handle"	type
    206 done
    207 	"-a-zA-Z0-9_"	ident
    208 
    209 :cond Conditional
    210 	*	idle	noeat
    211 
    212 :type Type
    213 	*	idle	noeat
    214 
    215 :oper Operator
    216 	*	idle	noeat
    217 
    218 :reserved Keyword
    219 	*	idle	noeat