BSD 4_3 release
[unix-history] / usr / src / usr.lib / libI77 / format.h
index 05d5ac2..331341b 100644 (file)
@@ -1,14 +1,26 @@
 /*
 /*
-char id_format[] = "@(#)format.h       1.1";
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
  *
  *
+ *     @(#)format.h    5.1 (Berkeley) 6/7/85
+ */
+
+/*
  * format parser definitions
  */
 
 struct syl
 {
  * format parser definitions
  */
 
 struct syl
 {
-       int op,p1,p2,p3;
+       short op,p1,p2,rpcnt;
 };
 
 };
 
+/*     do NOT change this defines or add new ones without
+ *     changing the value of the following define for OP_TYPE_TAB.
+ *     change format.h both in the compiler and libI77 simultaneously.
+ */
+
+
 #define RET    1
 #define REVERT         2
 #define GOTO   3
 #define RET    1
 #define REVERT         2
 #define GOTO   3
@@ -29,8 +41,8 @@ struct syl
 #define SP     18
 #define SS     19
 #define P      20
 #define SP     18
 #define SS     19
 #define P      20
-#define BN     21
-#define BZ     22
+#define BNZ    21
+#define B      22
 #define F      23
 #define E      24
 #define EE     25
 #define F      23
 #define E      24
 #define EE     25
@@ -45,9 +57,31 @@ struct syl
 #define DOLAR  34              /*** NOT STANDARD FORTRAN ***/
 #define SU     35              /*** NOT STANDARD FORTRAN ***/
 
 #define DOLAR  34              /*** NOT STANDARD FORTRAN ***/
 #define SU     35              /*** NOT STANDARD FORTRAN ***/
 
+#define LAST_TERM SU
+
+/* OP_TYPE_TAB is used in dofio.c .
+         Each value corresponds to a value above, and must be
+         ED for editing terms: I,IM,F,E,EE,D,DE,G,GE,L,A,AW
+         NED for nonediting terms which change the I/O stream:
+                       X,SLASH,APOS,H,TL,TR,T
+         and just the value of the term for all others.
+
+         E.g. SP is defined above as 17, so the element 17 of
+         OP_TYPE_TAB (counting from zero) is SP since SP does not
+         read or write data;
+         IM is defined as 10 so the element 10 of OP_TYPE_TAB
+         is ED since IM edits data from the i/o list.
+ */
+#define OP_TYPE_TAB {0, RET, REVERT, GOTO, NED, NED, STACK, ED, ED, NED, \
+                       ED, NED, NED, NED, NED, NED, COLON, S, SP, SS, P, \
+                       BNZ, B, ED, ED, ED, ED, ED, ED, ED, ED, ED, ED, \
+                       R, DOLAR, SU }
+
+#define        FMTUNKN -1
 #define FMTOK  1
 #define FMTERR 0
 
 #define FMTOK  1
 #define FMTERR 0
 
-extern struct syl syl[];
-extern int pc,parenlvl,revloc;
+#define FMT_COMP 0x101         /* indicates pre-compiled formats */
 
 
+extern struct syl *syl_ptr;
+extern short pc;