rigal.1 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. .TH RIGAL 1 "7.7.1993, Linkoping Univ"
  2. .SH NAME
  3. \fBrc\fP \- checks and compiles RIGAL file
  4. \fBic\fP \- interprets intermediate RIGAL code
  5. \fBv\fP \- viewer for RIGAL data saved in file
  6. \fBrig_crf\fP \- RIGAL cross\-referencer
  7. \fBrig_lint\fP \- RIGAL Lint (data type checker)
  8. .SH SYNOPSIS
  9. \fBrc\fP \fIfilename\fP \fB [-c] [\-D] [\-P \fP parameter]...
  10. \fBic\fP \fIcodefilename\fP \fB [\-p\fP \fIprintfilename\fP]\fB [\-d][\fP parameter...]
  11. \fBv\fP \fIfilename\fP
  12. \fBrig_crf\fP \fIfilename\fP
  13. \fBrig_lint\fP \fIfilename\fP
  14. \fIexecutable\fP \fB [\-p \fP\fIprintfilename\fP] [ parameter...]
  15. \fB (!) \fP the options and parameters must be separated by one or more
  16. spaces.
  17. .SH COMPILATION TARGET (Pascal and C)
  18. There are two variants of RIGAL implementation: RIGAL/Pascal in UNIX Pascal and RIGAL/C in UNIX C.
  19. The differences between them are mentioned below.
  20. .SH DESCRIPTION OF \fBrc\fP
  21. \fBrc\fP \fIfilename\fP \fB [\-c] [\-D] [\-P \fP parameter]...
  22. \fBrc\fP \- checks source file written in RIGAL language. The
  23. source code file must have suffix \fB.rig\fP, but in the command \fIfilename\fP is
  24. specified without the suffix.
  25. \fBrc\fP reports error messages if any appear; file
  26. name, row, column
  27. and message text are reported to standard output.
  28. \fBrc\fP creates intermediate code \fIfilename\fP\fB.rsc\fP which can be used for interpretation.
  29. .SH OPTIONS
  30. .TP
  31. .BI \-c
  32. creates an executable file \fIfilename\fP (without suffix).
  33. In RIGAL/Pascal variant an intermediate
  34. Pascal code is generated and then Pascal compiler (\fBpc\fP) and linker are invoked.
  35. In RIGAL/C variant
  36. an intermediate C code is generated and then C compiler (\fBcc\fP) and linker are invoked.
  37. Some intermediate files, among them script file \fBxd\fP,
  38. also appear.
  39. .TP
  40. .BI \-D
  41. does not remove intermediate files after the compilation.
  42. .TP
  43. .BI \-P " parameter "
  44. passes option to Pascal or C compiler. You can use \fB\-P\fP several times or
  45. use \fB\-P \fP\fI 'param1 param2' \fP syntax. Typically you may be need to compile
  46. with statically linked standard libraries, e.g. \fB$rig/rc rigcrf -c -P -Bstatic\fP
  47. .SH DESCRIPTION OF \fIexecutable\fP file (compilation result)
  48. \fIexecutable\fP\fB [\-p\fP \fIprintfilename\fP] [parameter...]
  49. The parameters
  50. are passed to RIGAL program and can be received through #PARM
  51. built\-in rule which returns list of parameters. The execution
  52. is identical to the interpreted program.
  53. .SH OPTION
  54. \fB\-p\fP \fIprintfilename\fP \- name of file for statement PRINT output.
  55. By default output is written to standard output.
  56. .SH DESCRIPTION OF \fBic\fP
  57. \fBic\fP \fIcodefilename\fP [\fB\-p\fP \fIprintfilename\fP] [\fB\-d\fP] [parameter...]
  58. \fBic\fP \- interprets the intermediate code, created by \fBrc\fP.
  59. The intermediate code must have suffix \fB.rsc\fP, but in the command
  60. it is specified without the suffix. Other parameters are passed
  61. to RIGAL program and can be received through #PARM built\-in rule
  62. which returns list of parameters.The execution is identical to
  63. the compiled program.
  64. .SH OPTIONS
  65. .TP
  66. .BI \fB\-p\fP " printfilename"
  67. name of file for statement PRINT output.
  68. By default output is written to standard output.
  69. .TP
  70. .BI \-d " "
  71. tracing mode is turned on. Trace of rules and branches,
  72. rule arguments and success/unsuccess messages is written to file
  73. specified by \fB\-p\fP option and is mixed with output from PRINT
  74. statements. If \fB\-p\fP option is absent trace is written to standard
  75. output.
  76. .SH DESCRIPTION of v
  77. \fBv\fP \fIfilename\fP
  78. \fBv\fP writes the contents of RIGAL code saved in file to standard
  79. output. The structure of code is written with indentation, in
  80. well\-readable form. If the depth of some element of the structure
  81. is more than 15 levels, then characters '..' appear instead of the
  82. element.
  83. The \fIfilename\fP must contain data saved by RIGAL statement
  84. SAVE $\fIvar 'filename\fP'
  85. .SH DESCRIPTION of \fBrig_crf\fP
  86. \fBrig_crf\fP \fIfilename\fP
  87. \fBrig_crf\fP creates cross reference table for given RIGAL program
  88. \fIfilename\fP. The program file must have suffix \fB.rig\fP, but in the command
  89. \fIfilename\fP is specified without the suffix. The result is written
  90. to file \fIfilename\fP\fB.crf\fP. For every rule the following is reported:
  91. rules calling this one, rules called by this one, variables, use
  92. of global variables.
  93. .SH DESCRIPTION of \fBrig_lint\fP
  94. \fBrig_lint\fP \fIfilename\fP
  95. \fBrig_lint\fP creates warning table for given RIGAL program
  96. \fIfilename\fP. The program file must have suffix \fB.rig\fP, but in the command
  97. \fIfilename\fP is specified without the suffix. The result is written
  98. to file \fIfilename\fP\fB.lnt\fP.
  99. \fBrig_lint\fP checks type compatibility and cases when values of
  100. different types can be assigned to the same variable.
  101. .SH ERROR MESSAGES
  102. \fB Error in file\fP \fIfilename\fP \fB
  103. Line=\fP\fInn\fP\fB Message=\fP\fItext\fP\fB
  104. Column=\fP\fImm\fP
  105. \- checker found syntax error in your RIGAL file. Intermediate
  106. code is not created, compilation failed.
  107. \fB *** ERROR\fP \fI nn xxx\fP
  108. \- runtime warnings about dangerous manipulations with RIGAL
  109. data structures or runtime input/output errors.
  110. \fB rig:undefined variable
  111. pc:command not found\fP
  112. \- see ENVIRONMENT section of this manual
  113. \fB ERROR:COMPILATION ERROR IN RIGAL, rule #\fP\fIname\fP
  114. \- internal compilation message, normally does not appear;
  115. try to simplify this rule.
  116. \fB ld() errors or warnings \fP
  117. \- try command
  118. \fB ranlib $rig/lib/riglib.a\fP
  119. to remove errors.
  120. .SH ENVIRONMENT
  121. For running RIGAL/Pascal you must have Sun Pascal release 2.1 (or higher). Command \fBpc\fP
  122. (Pascal compiler) must be available.
  123. For running RIGAL/C you must have a C compiler (command \fBcc\fP) available.
  124. You must have environment variable \fBrig\fP set to the
  125. name of directory where RIGAL system binary files are located.
  126. You can set it by command
  127. \fBsetenv rig \fP\fIfull_path\fP\fB/bin\fP
  128. in your \fB.login\fP file
  129. It is recommended to include this directory at the start of
  130. path list by command
  131. \fB set path=( $rig ... )\fP
  132. in your \fB.login\fP file. Then you can use RIGAL commands \fBrc\fP,
  133. \fBic\fP etc. from any directory.
  134. .SH INSTALLATION of RIGAL from sources
  135. All files are packed and compressed in file
  136. \fBrigs\fP\fIvariant.system_version.\fP\fBtar.Z\fP
  137. (e.g. rigsp.444.tar.Z). Here \fBrigsp\fP denotes Pascal sources, \fBrigsc\fP - C sources.
  138. \fBuncompress\fP file (without suffix \fB.Z\fP)
  139. \fBtar \-xvf\fP file
  140. execute instructions in ENVIRONMENT section.
  141. Go to RIGAL source directory (\fB/src\fP) and execute \fB make\fP ;
  142. it takes 3-5 minutes to compile all sources by Sun Pascal (or C)
  143. compiler and perform self-test. The result is in \fB/bin\fP
  144. .SH FILES
  145. \fB bin/rc, bin/ic, bin/rig_crf, bin/rig_lint, bin/v\fP basic RIGAL system executable files
  146. \fB lib/riglib.a\fP RIGAL compiler runtime library. If you move it from one directory to another, execute command
  147. \fBranlib\fP\fI new_directory\fP\fB/riglib.a\fP
  148. \fBinclude/\fP\fIfile\fP.\fBinc\fP, \fBinclude/\fP\fIfile\fP.\fBh\fP m
  149. include files for compilation
  150. \fB bin/anrig, bin/genrig\fP parts of RIGAL compiler
  151. \fB doc/rigal.1 \fP this manual
  152. \fB doc/langdesc.txt \fP RIGAL language description
  153. \fB doc/impl.txt \fP User's guide
  154. \fIfile\fP\fB.rig\fP source programs in RIGAL
  155. \fIfile\fP\fB.rsc\fP intermediate code for interpreter
  156. \fBxcrg*.pas,\fP \fIfile\fP.\fBRC2\fP, \fIfile\fP.\fBRC4\fP, \fIfile\fP.\fBTMP\fP
  157. intermediate files, appear and by default are removed during compilation.
  158. .SH PRINTED DOCUMENTATION
  159. The documentation is in \fBdoc\fP subdirectory.
  160. Use
  161. \fBtroff -man -t rigal.1 | lpr -h -t\fP to print manual page
  162. \fBnroff -man -t rigal.1 > rigal.man\fP to prepare readable manual page file
  163. \fBtroff -ms -t langdesc.txt | lpr -h -t\fP to print language description
  164. \fBtroff -ms -t impl.txt | lpr -h -t\fP to print the programmer's guide
  165. .SH AUTHORS
  166. Mikhail Auguston and Vadim Engelson, Inst. of Math. and Comp.Sci, University of Latvia,
  167. Rainis blvd. 29, Riga, LV-1459, Latvia (Lettland). Currently (1994-1995) Vadim Engelson is
  168. at IDA, S-58183, Linkoping University, Linkoping, Sweden.
  169. e\-mail: vadim@mii.lu.lv , vaden@ida.liu.se.
  170. Some info and pointers to papers are available from http://www.ida.liu.se/labs/pelab/members/vaden/rigal.html
  171. Rigal and papers about it available by ftp ftp.ida.liu.se /pub/labs/pelab/rigal