it(ch) or else ch = '_' loop if k <= 10 then id(k) := upper(ch); k := k + 1; end if; declare och : character := ch; begin next_ch; if och = '_' then if not letter_or_digit(ch) then error(1,line_count); exit; end if; end if; end; end loop; -- perform binary search for reserved word h := symbol'pos(abort_sy); j := symbol'pos(xor_sy); loop k := (h+j)/2; if id <= word(symbol'val(k)) then j := k - 1; end if; if id >= word(symbol'val(k)) then h := k + 1; end if; exit when h > j; end loop; if h - 1 > j then token := symbol'val(k); else token := identifier; end if; elsif digit(ch) then number_cruncher: declare base : integer := 10; -- fefault base is decimal i : integer; -- integer converted from last character exponent : integer; based_ch : character; -- # or : function in_base(ch : character) return boolean is begin if digit(ch) then i := character'pos(ch) - character'pos('0'); elsif hex(ch) then i := character'pos(ch) - character'pos('A') + 10; else return false; end if; if i < base then return true; else return false; end if; end in_base; function get_integer return integer is num : integer := 0; begin while in_base(ch) loop num := num * base + i; next_ch; if ch = '_' then next_ch; if not in_base(ch) then error(3,line_count); end if; end if; end loop; return num; end get_integer; function get_fraction return float is num : float := 0.0; divi : float := 1.0 / float(base); begin while in_base(ch) loop num := num + float(i) * divi; divi := divi / float(base); next_ch; if ch = '_' then next_ch; if not in_base(ch) then error(3,line_coun