home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / VSCPPv7.zip / VACPP / IBMCPP / macros / FOR.PPR < prev    next >
Text File  |  1995-05-11  |  5KB  |  333 lines

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