/************************************************************************ * ratfor.def -Every definition your heart could desire * * (including a few you don't want) * * --> This is set up for an 11 (not a VAX) * * --> Error returns are setup for 11M * * notes: * * 1. This file should be included into all files * * in the ratfor preprocessor. * * 2. There are two differences for VAX versus and PDP-11 * * in SEV_ERR_RET and DEFAULT_MAGIC. * ************************************************************************/ /************************************************************************ * VMS/VAX specific values * ************************************************************************/ define DEFAULT_MAGIC -2147483648 #VMS - a magic value, illegal case label define HUGESIZE 1500 #a very large buffer #define MAXFORVAR 15 #VMS V1 - max # of characters in variable name #define MAXFORVARNAME 16 #MAXFORVAR + 1 define MAXFORVAR 32 #VMS V2- max # of characters in variable name define MAXFORVARNAME 33 #MAXFORVAR + 1 define MAXINT 32767 #maximum integer define MAXNAME 32 #maximum number of characters in a file name /* VMS exit with status conventions */ define ERROR_RET 2 #return indicating an error define SEV_ERR_RET 4 #VMS define SUCCESS_RET 1 #successful return define WARN_RET 0 #return with a warning /************************************************************************ * PDP11, F4P and FOR specific values * ************************************************************************/ /* DEFAULT_MAGIC could be -32768 in F4P, but it didn't seem worth the bother to change it for the different compilers */ /*---> commented out define DEFAULT_MAGIC -32767 #11's - a magic value, illegal case label define HUGESIZE 700 #a very large buffer define MAXFORVAR 6 #11's - max # of characters in variable name define MAXFORVARNAME 7 #MAXFORVAR + 1 define MAXINT 32767 #maximum integer define MAXNAME 32 #maximum number of characters in a file name -- end of PDP stuff */ /*------> The internal table size, determined by MAXTBL is the biggest cause * of RATFOR growing to big for memory, if you have problems, try * making it smaller. MAXTBL is kept in the general area */ /************************************************************************ * RSX-11M V3.2 Exit with status system convention values * ************************************************************************/ /*---> commented out define ERROR_RET 2 #return indicating an error define SEV_ERR_RET 3 #11m - a severe error return define SUCCESS_RET 1 #successful return define WARN_RET 0 #return with a warning ---> end of exit conventions for 11M */ /************************************************************************ * general definitions - apply to all installations * ************************************************************************/ define AMPER 38 # AMPERSAND define ATSIGN 64 #'@' define BACKSLASH 92 #'\' define BACKWARDS 8 #backspace define BANG 33 #'!' define BAR 124 #'|' define BIG_A 65 #'A' define BIG_B 66 #'B' define BIG_C 67 #'C' define BIG_D 68 #'D' define BIG_E 69 #'E' define BIG_F 70 #'F' define BIG_G 71 #'G' define BIG_H 72 #'H' define BIG_I 73 #'I' define BIG_J 74 #'J' define BIG_K 75 #'K' define BIG_L 76 #'L' define BIG_M 77 #'M' define BIG_N 78 #'N' define BIG_O 79 #'O' define BIG_P 80 #'P' define BIG_Q 81 #'Q' define BIG_R 82 #'R' define BIG_S 83 #'S' define BIG_T 84 #'T' define BIG_U 85 #'U' define BIG_V 86 #'V' define BIG_W 87 #'W' define BIG_X 88 #'X' define BIG_Y 89 #'Y' define BIG_Z 90 #'Z' define BLANK 32 #' ' define CHARACTER BYTE #for portability and general goodness define COLON 58 #':' define COMMA 44 #',' define CR 13 #carriage return define DIG_0 48 #'0' define DIG_1 49 #'1' define DIG_2 50 #'2' define DIG_3 51 #'3' define DIG_4 52 #'4' define DIG_5 53 #'5' define DIG_6 54 #'6' define DIG_7 55 #'7' define DIG_8 56 #'8' define DIG_9 57 #'9 define DOLLAR 36 #'$' define DQUOTE 34 #'"' define EOF -10 #end of file define EOS 0 #marks the end of a string define EQUALS 61 #'=' define ERRLUN 6 #lun to write errors to define ESC 27 define FF 12 #form feed define GARBAGE -128 #char to mark garbage in name table define GLOBAL_LUN 8 #lun for global file define GREATER 62 #'>' define INBUFSIZE HUGESIZE #number of bytes in the input buffer define LBRACE 123 #'{' define LBRACK 91 #'[' define LESS 60 #'<' define LET_A 97 #'a' define LET_B 98 #'b' define LET_C 99 #'c' define LET_D 100 #'d' define LET_E 101 #'e' define LET_F 102 #'f' define LET_G 103 #'g' define LET_H 104 #'h' define LET_I 105 #'i' define LET_J 106 #'j' define LET_K 107 #'k' define LET_L 108 #'l' define LET_M 109 #'m' define LET_N 110 #'n' define LET_O 111 #'o' define LET_P 112 #'p' define LET_Q 113 #'q' define LET_R 114 #'r' define LET_S 115 #'s' define LET_T 116 #'t' define LET_U 117 #'u' define LET_V 118 #'v' define LET_W 119 #'w' define LET_X 120 #'x' define LET_Y 121 #'y' define LET_Z 122 #'z' /* to renumber put cursor at begining and type "xama" 49ua2l<::@s/define/;@s/-/2d%a\l> */ define LEXBEGIN -50 #beginning of block define LEXBREAK -51 #break define LEXCASE -52 #case statement define LEXCOLON -53 #a colon (what else you ninny?) define LEXDEFINE -54 #define statement define LEXDO -55 #do define LEXELSE -56 #else define LEXEND -57 #end of block define LEXEND_STAT -58 #the end statement, used in strings define LEXERROR -59 #error in scan define LEXFOR -60 #for define LEXFORINIT -61 #end of initialization code for for define LEXGLOBAL_DEF -62 #a global definition define LEXGLOBAL_FILE -63 #specify the global definition file define LEXIDENT -64 #token is an identifier define LEXIF -65 #token is if define LEXINCLUDE -66 #include define LEXLABEL -67 #label statement define LEXLPAREN -68 #a left parenthessis define LEXNEXT -69 #next define LEXNUMBER -70 #token is a number define LEXOTHER -71 #undefined token define LEXREPEAT -72 #repeat define LEXRPAREN -73 #a right parenthesis define LEXSCOPE_BEGIN -74 #beginning of a scope block define LEXSCOPE_END -75 #end of a scope block define LEXSEMICOL -76 #a semicolon define LEXSPECIAL -77 #special fortran names > 6 characters define LEXSTRING -78 #token is a string define LEXSTRING_STAT -79 #the ratfor string statement define LEXSWITCH -80 #switch/case statements define LEXUNDEFINE -81 #undefine a previously defined name define LEXUNTIL -82 #until define LEXWHILE -83 #while define LF 10 #line feed define LPAREN 40 #'(' define MAXCASE 100 #maximum number of case labels (sort of) define MAXFORSTAT 100 #maximum characters handled by for define MAXLINE 132 #maximum line length define MAXLUN 4 #maximum opened files define MAXPTR 607 #maximum pointers to defn -- must be prime! define MAXSTACK 100 #maximum number of stack states define MAXTBL 8000 #maximum characters allowed for definitions define MAXTOKEN 80 #maximum number of characters in a token define MAX_STRING 20 #maximum number of strings define MAX_STRING_TOTAL HUGESIZE #maximum number of chars for strings define MINUS 45 #'-' define NAME_LUN 8 #used in name file define NEWLINE 10 #same as ascii LF define OK 1 #all systems go define OUTLUN 7 #output goes to logical unit 7 define OUTBUFSIZE 80 #number of characters in output buffer define outstr outchs #for compatibility define PERCENT 37 #'%' define PERIOD 46 #'.' define PLUS 43 #'+' define QMARK 63 #'?' define RBRACE 125 #'}' define RBRACK 93 #']' define RPAREN 41 #')' define SEMICOL 59 #';' define SHARP 35 #'#' define SLASH 47 #'/' define SPACE 32 #same as blank define SQUOTE 39 #'''' define STAR 42 #'*' define STRLEN 2000 #largest strings to be passed by scopy /* for renumbering to work, each error code should be followed by a # This little renumbering magic is TECO magic, (thanks to MAP) place the following line in a queue and execute it. 0ua2l<::@s/define/;@s/#/r-2dqa-9"l@i/0/'%a\l> */ define F_CASE_BIG 01 #fatal, "Too many case statements" define F_CASE_NAME 02 #fatal, "Switch expression lost" define F_CASE_NEST 03 #fatal, "Case statements nested too deeply" define F_ERR_RATINI 04 #fatal, "Failure installing key words" define F_FOR_NEST 05 #fatal, "Fors nested too deeply" define F_FOR_REIN 06 #fatal, "For reinitialization lost" define F_FOR_TST 07 #fatal, "For test lost" define F_LAB_LOST 08 #fatal, "Label lost" define FATAL_ERR_LIM 09 #limit of fatal errors (for seterr) define S_2_MANY_DEF 10 #error, "Too many definitions" define S_CASE_DUP 11 #error, "Duplicate case value found" define S_CASE_VAL 12 #error, "Illegal case value" define S_CASE_SEMI 13 #error, "Missing semicolon in case statement" define S_EOF 14 #error, "Unexpected end of file" define S_IDENT_EXP 15 #error, "Identifier expected" define S_ILL_BREAK 16 #error, "Illegal break" define S_ILL_CHAR 17 #error, "Illegal character" define S_ILL_DEF 18 #error, "Illegal definition" define S_ILL_ELSE 19 #error, "Illegal else" define S_ILL_LABEL 20 #error, "Illegal label" define S_ILL_NEXT 21 #error, "Illegal next" define S_ILL_OCTAL 22 #error, "Illegal octal number, ignored" define S_ILL_RBRACE 23 #error, "Illegal right brace" define S_ILL_STR 24 #error, "Illegal string" define S_ILL_STRING 25 #error, "Illegal string statement" define S_ILL_UNTIL 26 #error, "Illegal until" define S_INBUF_OVFL 27 #error, "Input buffer overflow" define S_INPUT_FILE 28 #error, "Error reading input file" define S_LPAREN_EXP 29 #error, "Left parenthesis expected" define S_MIS_LPAREN 30 #error, "Missing left parenthesis" define S_MIS_PAREN 31 #error, "Missing parenthesis" define S_NO_CHAR 32 #error, "CHARACTER not defined" define S_OVRFL_TBL 33 #error, "Definition table full" define S_RPAREN_EXP 34 #error, "Right parenthesis expected" define S_STACK_OVR 35 #error, "Parse stack overflow" define S_UNBAL_BRACES 36 #error, "Unbalanced parenthesis" define S_UNBAL_PARENS 37 #error, "Unbalanced parenthesis" define TAB 9 #' ' define UNDERLINE 95 #'_' define UPARROW 94 #'^' /* This little renumbering magic is TECO magic, (thanks to MAP) place the following line in a queue and execute it. 0ua2l<::@s/define/;@s/-/d%a\l> */ define W_SUS_STATE -1 #warning, "Suspect statement found" define W_INC_OVR -2 #warning, "Includes nested too deep" define W_INVAL_DEF -3 #warning, "Invalid re-definition" define W_OPEN_FILE -4 #warning, "Error in opening file" define W_6_CH_VAR -5 #warning, "Long variable name lost"