! notes: ! arg_buff contains the arguments collected so far. ! ! prm_buff contains the lexemes collected so far for ! the current argument. ! ! when tracing is on, RUND will place the lexemes ! encoutered in trace_buff. symbols and delimiters ! are stored together in each lexeme word. ! ! when the macro context changes (e.g. a macro ! within a macro) then the trace buffer is concatenated ! to the appropriate trace list for the current ! macro context and trace_buff is reset. thus there ! is no need to push trace_buff. Literal SRC_FILE = 0, SRC_MACRO = 1, SRC_STRUCTURE = 2, SRC_MACRO_ARG = 3, SRC_LEXICAL = 4; Literal SZ_MAC_INFO = 21, SZ_ARG_BUFF = 32, SZ_PRM_BUFF = 32, SZ_TRACE_BUFF = 32; External mac_info : Block[21], arg_buff : Vector[SZ_ARG_BUFF], prm_buff : Vector[SZ_PRM_BUFF], trace_buff : Vector[SZ_TRACE_BUFF]; ! ! notes: ! mac_next -> previous macro block ! ! mac_type source stream type (SRC_xxx) ! ! mac_mode macro attributes (iterative, recursive, etc) ! ! mac_v_eos TRUE if the end of the macro stream has been reached ! ! mac_v_peek TRUE if a lookahead was performed ! ! mac_v_trace TRUE if this macro is being traced ! ! mac_trace1 -> stream of traced lexemes for the whole ! macro expansion. for non-iterative macros, ! the trace buffer is appended to this whenever ! the mac_info block is pushed or at the end ! of the macro. for iterative macros, the ! mac_trace2 list is appended to it at the ! end of each iteration. when the macro expansion ! is complete this list is displayed. if the ! previous macro was being traced then this ! list is appended to the previous macro's ! trace list. if not then this list is ! destroyed. ! ! mac_trace2 -> stream of traced lexemes for iterations. ! for iterative macros, the trace buffer is ! appended to this list. at the end of an ! iteration, this list is displayed and then ! append to the mac_trace1 list. ! ! mac_iteration interation number. incremented each time ! a new interation starts on an interative ! macro. the $COUNT lexical function returns ! this. ! ! mac_length total number of arguments to a macro. the ! $LENGTH lexical function returns this. ! ! mac_body -> stream of lexemes being read. ! ! mac_body0 -> original stream of lexemes. used ! for resetting mac_body for the next ! iteration. ! ! mac_ibody index into mac_body stream ! ! mac_name -> macro/structure symbol ! ! mac_argv -> stream of arguments to macro ! ! mac_argv0 -> original stream of arguments. ! used to release the argument when ! the macro is done. ! ! mac_argc number of arguments left in mac_argv ! ! mac_iarg index into mac_argv ! ! mac_num_actual number of actuals consumed this ! iteration. for the first iteration ! it is the number of fixed plus the ! number of iterative arguments. for ! iterations thereafter it is just the ! number of iterative arguments. ! ! mac_actuals -> vector of actual arguments for the ! current iteration. ! ! mac_delim iteration delimiters ! [0] = separator ! [1] = closing delimiter ! [2] = opening delimiter ! ! mac_num_fixed number of fixed arguments this macro ! takes. ! ! mac_num_iter number of iterative arguments this ! macro takes. ! ! mac_file for source file stream, a pointer ! to a file context block. ! ! mac_index index into mac_stack. ! ! mac_stack stack of future lexemes. whenever ! a file or stream take is performed, ! the atom taken is placed on this stack. ! iteration delimiters and lexical function ! expansions are also placed on this stack. Bind mac_next = MAC_INFO[ 0, 0,64,1] : Ref Block, mac_type = MAC_INFO[ 1, 0, 8,0] : Byte, mac_mode = MAC_INFO[ 1, 8, 8,0] : Byte, mac_num_fixed = MAC_INFO[ 1,16, 8,0] : Byte, mac_num_iter = MAC_INFO[ 1,24, 8,0] : Byte, mac_num_actual = MAC_INFO[ 1,32, 8,0] : Byte, mac_v_eos = MAC_INFO[ 1,40, 8,0] : Byte, mac_v_peek = MAC_INFO[ 1,48, 8,0] : Byte, mac_v_trace = MAC_INFO[ 1,56, 8,0] : Byte, mac_name = MAC_INFO[ 2, 0,64,1] : Ref ST, mac_actuals = MAC_INFO[ 3, 0,64,1] : Ref Vector, mac_body = MAC_INFO[ 4, 0,64,1] : Ref Vector, mac_body0 = MAC_INFO[ 5, 0,64,1] : Ref Vector, mac_ibody = MAC_INFO[ 6, 0,64,1] : Integer, mac_argv = MAC_INFO[ 7, 0,64,1] : Ref Vector, mac_argv0 = MAC_INFO[ 8, 0,64,1] : Ref Vector, mac_argc = MAC_INFO[ 9, 0,64,1] : Integer, mac_iarg = MAC_INFO[10, 0,64,1] : Integer, mac_trace1 = MAC_INFO[11, 0,64,1] : Ref Vector, mac_trace2 = MAC_INFO[12, 0,64,1] : Ref Vector, mac_iteration = MAC_INFO[13, 0,64,1] : Integer, mac_length = MAC_INFO[14, 0,64,1] : Integer, mac_delim = MAC_INFO[15, 0,64,1] : Vector[4,Byte], mac_index = MAC_INFO[16, 0,64,1] : Integer, mac_stack = MAC_INFO[17, 0,64,1] : Vector[4], mac_file = MAC_INFO[ 2, 0,64,1];