summaryrefslogtreecommitdiff
path: root/sheets/for77kwds.ssh
blob: 5063f0d3715cfcc39d83d14bb6b218dfba53a627 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Style sheet for Fortran 77 keywords
# last modified 19990520

#  While it is advised to print "using" the larger set of Fortran
#  90/95 keywords, the handling of legacy code is done better
#  with this almost pure Fortran 77 set.

#
# This file is part of a2ps.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#

style "Fortran 77 Keywords" is

written by "Denis Girou <Denis.Girou@idris.fr>, Alexander Mai <st002279@hrzpub.tu-darmstadt.de>"
version is 0.60
requires a2ps version 4.12a

documentation is
  "This sheet implements only Fortran 77 keywords, and avoids implementing"
  "comments support. This is to allow for implementation of either fixed"
  "or free source form."
  ""
  "See the documentation of the style sheet code(fortran)code for more details."
end documentation

first alphabet is
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
second alphabet is
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"

# 'case insensitive' is default but set here explicitly
case insensitive

# "call" is missing by intention here; see below
keywords in Keyword_strong are
  assign,
  backspace, block,
  character, close, continue, common, complex,
  data, dimension, /double *precision/, do,
  entry, equivalence, external, else, /else *if/, "end", endfile, /end *if/,
  format,
  /go *to/,
  if, implicit, inquire, integer, intrinsic,
  logical,
  none,
  open,
  parameter, pause, print,
  read, real, return, rewind,
  save, sequence, stop,
  then,
  write
end keywords


# intrinsics and others
# I'd like to switch to 'Keyword' instead of 'Keyword_strong' here ?!
keywords in Keyword_strong are
  abs, acos, aimag, alog10, amax0, amax1, amin0, amin1, amod, anint,
     asin, atan, atan2,
  cabs, ccos, cexp, clog, cmplx, conjg, cos, cosh, csin, csqrt,
  dabs, dacos, dasin, datan, datan2, dble, dcos, dcosh, ddim,
     dexp, dim, dint, dlog, dlog10, dmax0, dmax1, dmin0, dmin1, dmod,
     dprod, dsign, dsin, dsqrt, dtan, dtanh,
  exp,
  float, fmt,
  ichar, idim, idint, ifix, index, int, isign,
  len, lge, lgt, lle, llt, log, log10,
  max, max0, max1, min, min0, min1, mod,
  real,
  sign, sin, sngl, sqrt,
  tan, tanh
end keywords


# Named parameters for built-in commands

keywords in Keyword are
  formatted, unformatted, unit
end keywords

# Fortran operators
operators in Keyword_strong are
  .not., .or., .and., .ge., .gt., .lt., .le., .eq., .ne., .eqv., .neqv.
end operators

optional operators are
    .not.  \not,
    .or.   \vee,
    .and.  \wedge,
    .ge.   \geq,
    .gt.   >,
    .lt.   <,
    .le.   \leq,
    .eq.   \equiv,
    .ne.   \neq,
    .eqv.  \equiv,
    .neqv. \neq
end operators


# Implementation of highlighting of procedures etc.
operators in Plain are
  # labelled entities: program, subroutine and function
  (# 1. The keyword
   /(program|subroutine|function)/
   # 2. Spaces
   /([[:space:]]+)/
   # 3. The label
   /([^[:space:](]+)/
   \1 Keyword_strong, \2, \3 Label_strong),

  # Subroutine calls
  ( # 1. The keyword
   /(call)/
    # 2. Spaces
   /([[:space:]]+)/
    # 3. The label
   /([^[:space:](]+)/
   \1 Keyword_strong, \2, \3 Label)
end operators


# Strings
sequences are
   C-char,
   C-string
end sequences

end style