1 /* ====== BEGIN INCLUDE SEGMENT apl_lexed_function_bead.incl.pl1 ========================== */ 2 3 /* this is the format of a user-defined function after it has been run 4 through apl_lex_, the first (left to right) parsing phase. */ 5 6 dcl 1 lexed_function_bead based aligned, 7 2 header like general_bead, /* type bits, etc. */ 8 9 2 name pointer unaligned, /* -> symbol bead which names the function */ 10 2 bits_for_parse unaligned like operator_bead.bits_for_parse, /* so can treat like system function */ 11 2 number_of_statements fixed bin, 12 2 number_of_localized_symbols fixed bin, /* including labels and parameter variables, return var */ 13 /* even if they aren't there, thus >^H_ 3 */ 14 2 number_of_labels fixed bin, 15 2 label_values_ptr pointer unaligned, /* -> label_values below */ 16 2 statement_map_ptr pointer unaligned, /* -> statement_map below */ 17 2 lexeme_array_ptr pointer unaligned, /* -> lexeme_array below */ 18 19 /* the first 3 localized symbols are always reserved for ReturnSymbol, LeftArgSymbol, RighArgSymbol respectively. 20 If some of these symbols are not present (e.g. monadic or value-less function), null pointers are used. 21 So beware!, there can be null ptrs in the localized_symbols array. */ 22 23 2 localized_symbols( (0) refer (lexed_function_bead.number_of_localized_symbols)) pointer unaligned, 24 /* first localized vars from header line, then labels */ 25 2 label_values ( (0) refer (lexed_function_bead.number_of_labels)) pointer unaligned, 26 /* ptrs to label-value beads for labels */ 27 2 statement_map ( (0) refer (lexed_function_bead.number_of_statements)) fixed bin(18), 28 /* index in lexeme_array of rightmost lexeme of each stmt */ 29 2 lexeme_array ( (0) refer (lexed_function_bead.number_of_labels) /* not really, but fake out compiler */ ) pointer unaligned; 30 /* the actual lexemes. Length of array is 31 statement_map(number_of_statements) */ 32 33 34 /* manifest constants for first 3 localized symbols */ 35 36 dcl (ReturnSymbol init(1), 37 LeftArgSymbol init(2), 38 RightArgSymbol init(3) 39 ) fixed binary static; 40 41 42 /* the last three parts of this bead are referenced separately, though ptrs earlier in the bead. 43 Here are declarations for them as level-1 structures */ 44 45 dcl 1 lexed_function_label_values_structure based aligned, 46 2 lexed_function_label_values ( 500 /* or so */ ) pointer unaligned, 47 48 statement_count fixed bin, 49 lexed_function_statement_map (statement_count) fixed bin(18) aligned based, 50 51 1 lexed_function_lexemes_structure based aligned, 52 2 lexed_function_lexeme_array ( 500 /* or so */ ) pointer unaligned; 53 54 /* ------ END INCLUDE SEGMENT apl_lexed_function_bead.incl.pl1 -------------------------- */