home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv7.zip / vac22os2 / ibmcobol / macros / for.pp- < prev    next >
Text File  |  1998-02-24  |  4KB  |  333 lines

  1.  
  2.  * Parser Profile for IBM FORTRAN/2 programs
  3.  * Copyright (C) IBM Corporation 1993
  4.  
  5. formsize
  6. size 72
  7.  
  8. lists
  9.  
  10. states if fs si fk ik format istr ck string comment errline inline cmdline d6 d5 d4 d3 d2 s6 s5 s4 s3 s2 s1
  11.  
  12. symbols nonexec if format name punctuation rcommand program operator qin quote number comment space debug digit five all zero any
  13.  
  14. classes label sub comment error code
  15.  
  16.  
  17. states
  18.  
  19. state s1 spacetrap
  20. fonts comment C five _ space _ debug D digit L
  21. changes five s6 comment comment space s2 debug s2 digit d2
  22. unknown errline
  23. end
  24.  
  25. state s2 spacetrap
  26. fonts space _ digit L
  27. changes space s3 digit d3
  28. unknown errline
  29. end
  30.  
  31. state s3 spacetrap
  32. fonts space _ digit L
  33. changes space s4 digit d4
  34. unknown errline
  35. end
  36.  
  37. state s4 spacetrap
  38. fonts space _ digit L
  39. changes space s5 digit d5
  40. unknown errline
  41. end
  42.  
  43. state s5 spacetrap
  44. fonts space _ digit L
  45. changes space s6 digit d6
  46. unknown errline
  47. end
  48.  
  49. state s6 spacetrap
  50.  * check for continuation line.
  51. fonts space _ zero N any F
  52. changes space cmdline zero cmdline any inline
  53. end
  54.  
  55. state d2 spacetrap
  56. fonts space _ digit L
  57. changes space d3 digit d3
  58. unknown errline
  59. end
  60.  
  61. state d3 spacetrap
  62. fonts space _ digit L
  63. changes space d4 digit d4
  64. unknown errline
  65. end
  66.  
  67. state d4 spacetrap
  68. fonts space _ digit L
  69. changes space d5 digit d5
  70. unknown errline
  71. end
  72.  
  73. state d5 spacetrap
  74. fonts space _ digit L
  75. changes space d6 digit d6
  76. unknown errline
  77. end
  78.  
  79. state d6 spacetrap
  80. fonts space _ zero N
  81. changes space cmdline zero cmdline
  82. unknown errline
  83. end
  84.  
  85. state comment
  86. fonts all C
  87. end
  88.  
  89. state errline
  90. fonts all E
  91. end
  92.  
  93. state cmdline
  94. fonts  program S rcommand K nonexec M format M name A
  95. changes name inline program inline rcommand inline nonexec inline format format
  96. unknown errline
  97. end
  98.  
  99. state inline
  100. fonts rcommand K nonexec M program S name A operator P punctuation P number N quote Q any E
  101. changes quote string
  102. end
  103.  
  104. state string
  105. fonts quote Q qin Q
  106. changes quote inline
  107. return istr
  108. end
  109.  
  110. state istr spacetrap
  111. fonts five _
  112. changes five ck
  113. unknown s1
  114. end
  115.  
  116. state ck spacetrap
  117.  * check it is a continuation line, for continued string
  118. fonts space _ zero N any F
  119. changes space cmdline zero cmdline any string
  120. end
  121.  
  122. state format
  123. fonts punctuation P if A quote Q any E
  124. changes quote fs
  125. return if
  126. end
  127.  
  128. state fs
  129.  * string in a Format statement
  130. fonts quote Q qin Q
  131. changes quote format
  132. return si
  133. end
  134.  
  135. state si spacetrap
  136. fonts five _
  137. changes five fk
  138. unknown s1
  139. end
  140.  
  141. state fk spacetrap
  142.  * check it is a continuation line, for continued string in a FORMAT
  143. fonts space _ zero N any F
  144. changes space cmdline zero cmdline any fs
  145. end
  146.  
  147. state if spacetrap
  148. fonts five _
  149. changes five ik
  150. unknown s1
  151. end
  152.  
  153. state ik spacetrap
  154.  * check it is a continuation line, for continued FORMAT
  155. fonts space _ zero N any F
  156. changes space cmdline zero cmdline any format
  157. end
  158.  
  159.  
  160. symbols
  161.  
  162. symbol all
  163. form
  164. !
  165.  
  166. symbol space
  167. form
  168. '  '
  169.  
  170. symbol any
  171. form
  172. .
  173.  
  174. symbol five
  175. form
  176. '      '
  177.      * one extra space - escape sequence
  178.  
  179. symbol digit
  180. form
  181. 0
  182.  
  183. symbol comment
  184. form
  185. [' >C','*']
  186.  
  187. symbol debug
  188. form
  189. ' >D'
  190.  
  191. symbol zero
  192. form
  193. '0'
  194.  
  195. symbol name
  196. form
  197. [A,a]({[$,'_','$']})
  198.  
  199. symbol punctuation
  200. sizelist small
  201. (
  202. )
  203. *
  204. +
  205. ,
  206. -
  207. .
  208. /
  209. :
  210. <
  211. =
  212. >
  213. \
  214. _
  215.  
  216. symbol number
  217. form
  218. [#('.'),'.'](#)([' >E',' >D']('-','+')#)
  219.  
  220. symbol qin
  221. form
  222. /''''''
  223.  
  224. symbol quote
  225. form
  226. ''''
  227.  
  228. symbol program
  229. alphalist upper small &
  230. BLOCK
  231. ENTRY
  232. FUNCTION
  233. PROGRAM
  234. SUBROUTINE
  235.  
  236. symbol format
  237. alphalist upper single &
  238. FORMAT
  239.  
  240. symbol if
  241. form
  242. [$,'$','_']
  243.  
  244. symbol nonexec
  245. alphalist upper small &
  246. CHARACTER
  247. COMMON
  248. COMPLEX
  249. DATA
  250. DIMENSION
  251. DOUBLE
  252. EJECT
  253. EQUIVALENCE
  254. EXTERNAL
  255. IMPLICIT
  256. INCLUDE
  257. INTEGER
  258. INTRINSIC
  259. LOGICAL
  260. PARAMETER
  261. PRECISION
  262. REAL
  263. SAVE
  264.  
  265. symbol rcommand
  266. alphalist upper small &
  267. ASSIGN
  268. BACKSPACE
  269. CALL
  270. CLOSE
  271. CONTINUE
  272. DBLE
  273. DO
  274. ELSE
  275. ELSEIF
  276. END
  277. ENDFILE
  278. ENDIF
  279. GO
  280. GOTO
  281. IF
  282. INQUIRE
  283. OPEN
  284. PAUSE
  285. PRINT
  286. READ
  287. RETURN
  288. REWIND
  289. STOP
  290. THEN
  291. TO
  292. WRITE
  293.  
  294. symbol operator
  295. alphalist upper small '.'&'.'
  296. .AND.
  297. .EQ.
  298. .EQV.
  299. .GE.
  300. .GT.
  301. .LE.
  302. .LT.
  303. .NE.
  304. .NEQV.
  305. .NOT.
  306. .OR.
  307.  
  308.  
  309. classes
  310.  
  311. class comment
  312. needed C
  313. not
  314.  
  315. class error
  316. needed E
  317. not
  318.  
  319. class code
  320. needed K || A || P || N || Q || S
  321. not
  322.  
  323. class label
  324. needed L
  325. not
  326.  
  327. class sub
  328. needed S
  329. not
  330.  
  331. end
  332.  * that's all!
  333.