home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / fte0827.zip / config / m_mod3.fte < prev    next >
Text File  |  1999-05-16  |  6KB  |  150 lines

  1. #From: Richard Glidden <rrglidden@uwaterloo.ca>
  2. #
  3. #  I just spent an hour or so configuring FTE to recognize Modula-3. 
  4. #This file is almost complete (there are two minor bugs - Keywords
  5. #immediately following punctuation don't highlight correctly, and
  6. #RoutineRegexp isn't set to recognize Procedures unless they start at
  7. #column 1), but I thought you'd like a copy of it anyway to include with
  8. #FTE.
  9.  
  10. colorize MODULA3 {
  11.     SyntaxParser       = 'SIMPLE';
  12.  
  13.     color {
  14.         { 'Normal',      'Lang_Default' },
  15.         { 'Number',      'Lang_DecimalNumber' },
  16.         { 'HexNumber',   'Lang_HexNumber' },
  17.         { 'Punctuation', 'Lang_Punctuation' },
  18.         { 'String',      'Lang_String' },
  19.         { 'Comment',     'Lang_Comment' },
  20.         { 'Command',     'Lang_Assembler' }, # Pragma
  21.     };
  22.  
  23.     keyword 'Editor_Keywords' {
  24.         'ABS', 'ADDRESS', 'ADR', 'ADRSIZE', 'AND', 'ANY', 'ARRAY', 'AS',
  25.         'BEGIN', 'BITS', 'BITSIZE', 'BOOLEAN', 'BRANDED', 'BY', 'BYTESIZE',
  26.         'CARDINAL', 'CASE', 'CEILING', 'CHAR', 'CONST',
  27.         'DEC', 'DISPOSE', 'DIV', 'DO',
  28.         'ELSE', 'ELSIF', 'END', 'EVAL', 'EXCEPT', 'EXCEPTION', 'EXIT',
  29.         'EXPORTS', 'EXTENDED',
  30.         'FALSE', 'FINALLY', 'FIRST', 'FLOAT', 'FLOOR', 'FOR', 'FROM',
  31.         'GENERIC',
  32.         'IF', 'IMPORT', 'IN', 'INC', 'INTEGER', 'INTERFACE', 'ISTYPE',
  33.         'LAST', 'LOCK', 'LONGREAL', 'LOOP', 'LOOPHOLE',
  34.         'MAX', 'METHODS', 'MIN', 'MOD', 'MODULE', 'MUTEX',
  35.         'NARROW', 'NEW', 'NIL', 'NOT', 'NULL', 'NUMBER',
  36.         'OBJECT', 'OF', 'OR', 'ORD', 'OVERRIDES',
  37.         'PROCEDURE',
  38.         'RAISE', 'RAISES', 'READONLY', 'REAL', 'RECORD', 'REF', 'REFANY',
  39.         'REPEAT', 'RETURN', 'REVEAL', 'ROOT', 'ROUND',
  40.         'SET', 'SUBARRAY', 'TEXT', 'THEN', 'TO', 'TRUE', 'TRUNC', 'TRY',
  41.         'TYPE', 'TYPECASE', 'TYPECODE', 'UNSAFE', 'UNTIL', 'UNTRACED',
  42.         'VAL', 'VALUE', 'VAR',
  43.         'WHILE', 'WITH',
  44.     };
  45.                         
  46.     # The following h_states are lengthy, but work VERY well.  Unlike the
  47.     # m_pascal.fte file (which m_modul3.fte is based on), punctuation
  48.     # colours do not get 'stuck' on Normal text.
  49.  
  50.     # BUG: Keywords immediately following punctuation (ie: .IF) do not
  51.     # highlight.  Please add a space between all punctuation and keywords,
  52.     # for now.
  53.     
  54.     h_state 0 { 'Normal' }
  55.     h_trans { 2, '<', '"', 'String' }
  56.     h_trans { 3, '<', '\'', 'String' }
  57.     h_trans { 4, '<', '(*', 'Comment' }
  58.     h_trans { 8, '<', '<*', 'Command' }
  59.     h_trans { 5, '<', '2_', 'HexNumber' }
  60.     h_trans { 5, '<', '3_', 'HexNumber' }
  61.     h_trans { 5, '<', '4_', 'HexNumber' }
  62.     h_trans { 5, '<', '5_', 'HexNumber' }
  63.     h_trans { 5, '<', '6_', 'HexNumber' }
  64.     h_trans { 5, '<', '7_', 'HexNumber' }
  65.     h_trans { 5, '<', '8_', 'HexNumber' }
  66.     h_trans { 5, '<', '9_', 'HexNumber' }
  67.     h_trans { 5, '<', '10_', 'HexNumber' }
  68.     h_trans { 5, '<', '11_', 'HexNumber' }
  69.     h_trans { 5, '<', '12_', 'HexNumber' }
  70.     h_trans { 5, '<', '13_', 'HexNumber' }
  71.     h_trans { 5, '<', '14_', 'HexNumber' }
  72.     h_trans { 5, '<', '15_', 'HexNumber' }
  73.     h_trans { 5, '<', '16_', 'HexNumber' }
  74.     h_trans { 6, '<-s', '0-9', 'Number' }
  75.     h_trans { 1, '-s', 'a-zA-Z_', 'Normal' }
  76.     h_trans { 0, 's', ' ', 'Normal' }
  77.     h_trans { 7, 'S', '_a-zA-Z0-9 ', 'Punctuation' }
  78.  
  79.     h_state 1 { 'Normal' }
  80.     h_trans { 0, '$', '', 'Normal' }
  81.     h_wtype { 0, 0, 0, '', 'a-zA-Z0-9_' }
  82.  
  83.     h_state 2 { 'String' }
  84.     h_trans { 0, '>', '"', 'String' }
  85.     h_trans { 0, '$', '', 'String' }
  86.  
  87.     h_state 3 { 'String' }
  88.     h_trans { 0, '>', '\'', 'String' }
  89.     h_trans { 0, '$', '', 'String' }
  90.  
  91.     h_state 4 { 'Comment' }
  92.     h_trans { 0, '>', '*)', 'Comment' }
  93.  
  94.     h_state 5 { 'HexNumber' }
  95.     h_trans { 0, '-S', '0-9A-Fa-f', 'Normal' }
  96.     h_trans { 0, '$', '', 'Normal' }
  97.  
  98.     h_state 6 { 'Number' }
  99.     h_trans { 0, '-S', '0-9', 'Normal' }
  100.     h_trans { 0, '$', '', 'Normal' }
  101.  
  102.     h_state 7 { 'Punctuation' }
  103.     h_trans { 2, '<', '"', 'String' }
  104.     h_trans { 3, '<', '\'', 'String' }
  105.     h_trans { 4, '<', '(*', 'Comment' }
  106.     h_trans { 8, '<', '<*', 'Command' }
  107.     h_trans { 5, '<', '2_', 'HexNumber' }
  108.     h_trans { 5, '<', '3_', 'HexNumber' }
  109.     h_trans { 5, '<', '4_', 'HexNumber' }
  110.     h_trans { 5, '<', '5_', 'HexNumber' }
  111.     h_trans { 5, '<', '6_', 'HexNumber' }
  112.     h_trans { 5, '<', '7_', 'HexNumber' }
  113.     h_trans { 5, '<', '8_', 'HexNumber' }
  114.     h_trans { 5, '<', '9_', 'HexNumber' }
  115.     h_trans { 5, '<', '10_', 'HexNumber' }
  116.     h_trans { 5, '<', '11_', 'HexNumber' }
  117.     h_trans { 5, '<', '12_', 'HexNumber' }
  118.     h_trans { 5, '<', '13_', 'HexNumber' }
  119.     h_trans { 5, '<', '14_', 'HexNumber' }
  120.     h_trans { 5, '<', '15_', 'HexNumber' }
  121.     h_trans { 5, '<', '16_', 'HexNumber' }
  122.     h_trans { 0, 's', '_a-zA-Z ', 'Normal' }
  123.     h_trans { 0, '$', '', 'Normal' }    
  124.     h_trans { 7, '<s', '0-9', 'Number' }
  125.     
  126.     h_state 8 { 'Command' }
  127.     h_trans { 0, '>', '*>', 'Command' }
  128. }
  129. mode MODULA3: PLAIN {      # Modula-3 Mode
  130.     FileNameRx          = /\.\c{m3}|{i3}$/;
  131.     HilitOn             = 1;
  132.     Colorizer           = 'MODULA3';
  133.     AutoIndent          = 1;
  134.     IndentMode          = 'PLAIN';
  135.     TabSize             = 4;
  136.     SpaceTabs           = 1;
  137.     MatchCase           = 1;
  138.     Trim                = 1;
  139.     MultiLineHilit      = 1;
  140.     AutoHilitParen      = 1;
  141.  
  142.     SaveFolds           = 2;      # save fold info at end of line
  143.     CommentStart        = ' (*';
  144.     CommentEnd          = '*)';
  145.  
  146.     # Needs to be modified to allow PROCEDURE to start anywhere on a line,
  147.     # not just column 1.
  148.     RoutineRegexp       = '^{PROCEDURE}'; 
  149. }
  150.