asm.jsf (4502B)
1 # JOE syntax highlight file for assembly language 2 3 # Highlights ';' comments, C-preprocessor stuff and C-like constants. 4 5 # Some assembly languages do not use C-preprocessor and use '#' for 6 # comments. For them, eliminate all states up to ':idle'. and change the 7 # ";" line in 'idle' to '#'. 8 9 # For UNIX assembly ';' actually separates instructions, but I've only seen 10 # this for 'rep; movsb'. If it bothers you eliminate the ';' line in 11 # ':idle'. 12 13 # This highlighter is too strict for numeric constants. Many assembly 14 # languages allow '000009', which looks like a bad octal constant in C/UNIX. 15 16 =Idle 17 =Ident 18 =Bad 19 =Preproc 20 =Define 21 =Comment 22 =IncLocal +String +Preproc 23 =IncSystem +Preproc 24 =Constant 25 =Number +Constant 26 =String +Constant 27 =Character +String 28 =CharacterEscape +Escape +Character 29 =StringEscape +Escape +String 30 =Type 31 =Brace 32 =Control 33 34 :reset Idle 35 * first noeat 36 " \t" reset 37 38 :first Idle 39 * idle noeat 40 "#" pre recolor=-1 41 42 :pre Preproc 43 * preproc noeat 44 " \t" pre 45 "a-z" preident recolor=-1 buffer 46 47 :preident Preproc 48 * preproc noeat strings 49 "define" predef 50 "include" preinc 51 done 52 "a-z" preident 53 54 :preinc Preproc 55 * preinc 56 " \t" preinc_ws 57 "\n" reset 58 59 :preinc_ws Preproc 60 * prebad recolor=-1 61 " \t" preinc_ws 62 "\"" preinc_local recolor=-1 63 "<" preinc_system recolor=-1 64 65 :preinc_local IncLocal 66 * preinc_local 67 "\"\n" reset 68 69 :preinc_system IncSystem 70 * preinc_system 71 ">\n" reset 72 73 :prebad Bad 74 * prebad 75 "\n" reset 76 77 78 :predef Preproc 79 * predef 80 " \t" predef_ws 81 "\n" reset 82 83 :predef_ws Preproc 84 * prebad recolor=-1 85 " \t" predef_ws 86 "a-zA-Z0-9_" predef_ident recolor=-1 87 88 :predef_ident Define 89 * idle noeat 90 "a-zA-Z0-9_" predef_ident 91 92 93 :preproc Preproc 94 * preproc 95 "\n" reset 96 "\\" preproc_cont 97 "/" preproc_slash 98 99 :preproc_slash Preproc 100 * preproc noeat 101 "*" comment recolor=-2 102 "/" line_comment recolor=-2 103 104 :preproc_cont Preproc 105 * preproc_cont 106 "\n" preproc 107 108 # All following states are for when we're not in a preprocessor line 109 110 :idle Idle 111 * idle 112 ";" line_comment recolor=-1 113 "\n" reset 114 "/" slash 115 "0" first_digit recolor=-1 116 "1-9" decimal recolor=-1 117 "." maybe_float 118 "\"" string recolor=-1 119 "'" char recolor=-1 120 "a-zA-Z_" ident buffer 121 "{}" brace recolor=-1 122 ",:=()><[]*&|!~+\-%^" control recolor=-1 123 124 :brace Brace 125 * idle noeat 126 127 :control Control 128 * idle noeat 129 130 :slash Idle 131 * idle noeat recolor=-2 # Not sure about this 132 "*" comment recolor=-2 133 "/" line_comment recolor=-2 134 135 :comment Comment comment 136 * comment 137 "BFHNTX" comment noeat call=comment_todo.comment_todo() 138 "*" maybe_end_comment 139 140 :maybe_end_comment Comment comment 141 * comment 142 "/" idle 143 "*" maybe_end_comment 144 145 :line_comment Comment comment 146 * line_comment 147 "BFHNTX" line_comment noeat call=comment_todo.comment_todo() 148 "\n" reset 149 150 :first_digit Number 151 * idle noeat 152 "xX" hex 153 "." float 154 "eE" epart 155 "0-7" octal 156 "89" bad_number recolor=-1 157 158 :bad_number Bad 159 * idle noeat 160 "0-9" bad_number 161 162 :octal Number 163 * idle noeat 164 "0-7" octal 165 "89" bad_number recolor=-1 166 167 :hex Number 168 * idle noeat 169 "0-9A-Fa-f" hex 170 171 :decimal Number 172 * idle noeat 173 "0-9" decimal 174 "eE" epart 175 "." float 176 177 :maybe_float Number 178 * idle recolor=-2 noeat 179 "0-9" float recolor=-2 180 181 :float Number 182 * idle noeat 183 "eE" epart 184 "0-9" float 185 186 :epart Number 187 * idle noeat 188 "0-9+\-" enum 189 190 :enum Number 191 * idle noeat 192 "0-9" enum 193 194 :string String string 195 * string 196 "\"" idle 197 "\\" string_escape recolor=-1 198 "%" string_control recolor=-1 199 200 :string_escape StringEscape string 201 * string 202 "x" string_hex1 203 "0-7" string_octal2 204 "\n" string recolor=-2 205 206 :string_hex1 StringEscape string 207 * string noeat 208 "0-9a-fA-F" string_hex2 209 210 :string_hex2 StringEscape string 211 * string noeat 212 "0-9a-fA-F" string 213 214 :string_octal2 StringEscape string 215 * string noeat 216 "0-7" string_octal3 217 218 :string_octal3 StringEscape string 219 * string noeat 220 "0-7" string 221 222 :string_control StringEscape string 223 * string_control 224 "\n" reset 225 "diouxXeEfFgGaAcspn%SC" string 226 227 :char CharacterEscape 228 * char 229 "\n" reset 230 "'" idle 231 "\\" char_escape recolor=-1 232 233 :char_escape CharacterEscape 234 * char 235 "x" char_hex1 236 "0-7" char_octal2 237 "\n" char recolor=-2 238 239 :char_hex1 CharacterEscape 240 * char noeat 241 "0-9a-fA-F" char_hex2 242 243 :char_hex2 CharacterEscape 244 * char noeat 245 "0-9a-fA-F" char 246 247 :char_octal2 CharacterEscape 248 * char noeat 249 "0-7" char_octal3 250 251 :char_octal3 CharacterEscape 252 * char noeat 253 "0-7" char 254 255 :ident Ident 256 * idle noeat 257 "a-zA-Z0-9_" ident