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

  1. # FORTRAN-90 mode
  2. # Contributed by: Andrew Pitonyak <pitonyak@math.tu-dresden.de>
  3.  
  4. # Operators include +, -, *, /, **, %, //
  5. # Comments start with ! and go to the end of the line
  6. # Comparison operators <, <=, ==, >, >=, /=, .LT, .LTE., .EQ., .GT.,.GTE., .NE.
  7. # Logical operators, .AND., .OR., .NOT.
  8. #
  9. # I should probably add the things like .EQ. to the keywords, I already
  10. # added .OR. and such.
  11. # How about a line comment command and then this will be pretty much
  12. # finished!
  13. #
  14. # In Fortran, arrays are accessed with () so you can not assume that
  15. # xpy(<something>) means that a function call is about to happen, it
  16. # could be an
  17. # array reference or a substring reference.
  18.  
  19. colorize FORTRAN {
  20.     SyntaxParser = 'SIMPLE';
  21.  
  22.     color {
  23.         { 'Normal',        'Lang_Default' },
  24.         { 'Number',        'Lang_DecimalNumber' },
  25.         { 'HexNumber',     'Lang_HexNumber' },
  26.         { 'Punctuation',   'Lang_Punctuation' },
  27.         { 'String',        'Lang_String' },
  28.         { 'Comment',       'Lang_Comment' },
  29.         { 'CPreprocessor', 'Lang_Preprocessor' },
  30.         { 'Function',      'Lang_Function' },
  31.         { 'Label',         'Lang_Label' },
  32.     };
  33.  
  34.     keyword 'Editor_Keywords' {
  35.         'abs', 'achar', 'acos', 'adjustl', 'adjustr',
  36.         'aimag', 'aint', 'all', 'allocatable', 'allocate',
  37.         'allocated', '.and.',
  38.         'anint', 'any', 'asin', 'assignment',
  39.         'associated', 'atan', 'atan2', 'backspace', 'bit_size',
  40.         'block', 'blockdata', 'btest', 'call', 'random_number',
  41.         'random_seed', 'system_clock', 'call', 'case', 'ceiling',
  42.         'char', 'character', 'close', 'cmplx', 'common', 'complex',
  43.         'conjg', 'contains', 'continue', 'cos', 'cosh', 'count',
  44.         'cshift', 'cycle', 'data', 'date_and_time', 'dble',
  45.         'deallocate', 'default', 'digits', 'dim', 'dimension', 'do',
  46.         'dot_product', 'double', 'doubleprecision', 'dprod', 'else', 'elseif',
  47.         'elsewhere', 'end', 'endblock', 'endblockdata', 'enddo',
  48.         'endfile', 'endif', 'endinterface', 'endselect', 'endtype',
  49.         'endwhere', 'entry', 'eoshift', 'epsilon', 'equivalence',
  50.         'exit', 'exp', 'exponent', 'external', 'file', 'floor', 'format.',
  51.         'fraction', 'function', 'go', 'goto', 'huge', 'iachar', 'iand',
  52.         'ibclr', 'ibits', 'ibset', 'ichar', 'ieor', 'if', 'implicit', 'in',
  53.         'index', 'inout', 'inquire', 'int', 'integer', 'intent', 'interface',
  54.         'intrinsic', 'iolength', 'ior', 'ishftc', 'ishift', 'kind', 'lbound',
  55.         'len', 'len_trim', 'lge', 'lgt', 'lle', 'llt', 'log', 'log10',
  56.         'logical', 'matmul', 'max', 'maxexponent', 'maxloc', 'maxval',
  57.         'merge', 'min', 'minexponent', 'minloc', 'minval', 'mod', 'module',
  58.         'modulo', 'mvbits', 'namelist', 'nearest', 'nint', 'none', '.not.',
  59.         'nullify', 'only', 'open', 'operator', 'optional', '.or.', 'out', 'pack',
  60.         'parameter', 'pointer', 'precision', 'present', 'print', 'private',
  61.         'procedure', 'product', 'program', 'public', 'radix', 'rangereal',
  62.         'read', 'real', 'recursive', 'repeat', 'reshape', 'result',
  63.         'return', 'rewrind', 'rrspacing', 'save', 'scale', 'scan', 'select',
  64.         'selectcase', 'selected_int_kind', 'selected_real_kind', 'sequence',
  65.         'set_exponent', 'shape', 'sign', 'sin', 'sinh', 'size', 'spacing',
  66.         'spread', 'sqrt', 'stop', 'subroutine', 'sum', 'tan', 'tanh',
  67.         'target', 'then', 'tiny', 'to', 'transfer', 'transpose',
  68.         'trim', 'type', 'unbound', 'unpack', 'use', 'verify',
  69.         'where', 'while', 'write'
  70.     };
  71.  
  72.     # Syntax Parser by Marko Macek
  73.     # not complete, see comments below
  74.  
  75.     h_state 0 { 'Normal' }
  76.     h_trans { 1, '-s', 'a-zA-Z_', 'Normal' }
  77.     h_trans { 2, '<', '!', 'Comment' }
  78.     h_trans { 3, '<', '"', 'String' }
  79.     h_trans { 4, '<', '\'', 'String' }
  80.     h_trans { 5, '<s', '0-9', 'Number' }
  81.     h_trans { 0, 'S', '_a-zA-Z0-9', 'Punctuation' }
  82.  
  83.     h_state 1 { 'Normal' }
  84.     h_trans { 0, '$', '', 'Normal' }
  85.     h_wtype { 1, 1, 0, '', 'a-zA-Z0-9_' }
  86.  
  87.     h_state 2 { 'Comment' }
  88.     h_trans { 0, '$', '', 'String' }       # can comments can be continued ?
  89.  
  90.     h_state 3 { 'String' }                 # are strings accross multiple lines
  91.     h_trans { 0, '>', '"', 'String' }      # how can things be quoted?
  92.     h_trans { 0, '$', '', 'String' }
  93.  
  94.     h_state 4 { 'String' }
  95.     h_trans { 0, '>', '\'', 'String' }
  96.     h_trans { 0, '$', '', 'String' }
  97.  
  98.     h_state 5 { 'Number' }
  99.     h_trans { 0, '-S', '0-9', 'Normal' }
  100.     h_trans { 0, '$', '', 'Normal' }
  101. }
  102.  
  103. mode FORTRAN: PLAIN {
  104.     FileNameRx          = /\.\c{F||{F90}|{F9P}|{FPP}}$/;
  105.     HilitOn             = 1;
  106.     Colorizer           = 'FORTRAN';
  107.     AutoIndent          = 1;
  108.     IndentMode          = 'PLAIN';
  109.     TabSize             = 8;
  110.     SpaceTabs           = 1;
  111.     MatchCase           = 1;
  112.     Trim                = 1;
  113.     MultiLineHilit      = 1;
  114.     AutoHilitParen      = 1;
  115.  
  116.     SaveFolds           = 2;      # save fold info at end of line
  117.     CommentStart        = ' !';
  118.     CommentEnd          = '';
  119.  
  120.     # ? RoutineRegexp       = /^\w[\w_:*&~]+[\w\s_:*&~]@\([^;]*$/;
  121. }
  122.