som v 2.4

token-s.txt
(the old version is in som\old\old-ctype-s.txt)

Rewrite to change bitvector for ctype. To speed it up (I think lex is used very often in the compiler) I trade off space by increasing the size of array to 256 (bitvec use 32) to make it direct accessible instead of using a lot of bit masking like this:

// test bitvector
to is1 bitv c =
	bitv[ c / 32 ] & (1 << ( c % 32))

: isLetter c = is1 cLetter c

The new version is faster and simpler like this:

: isLetter c = ctype[c] & 1

I take advantage of som v 1.6 that has static-array to create ctype[.] and get rid of "initctype" function.  This makes the source a bit cleaner.

ctype[.] is still a kind of bitvector implemented as an array 256 of hexval:hex:sep:space:letter where hexval is 4 bits, hex, sep, space and letter is one bit each. For example '9' = 1001:1:0:0:1 = 9*16+9 = 153.  Hexval is included in ctype (attempt to use space a bit more efficient).

patchcalli

To allow loadfile and compile-run immediately we must check calli before runimm everytime.  To reduce the amount of scanning the whole code segment repeatedly, we keep the list of addresses which have "calli".  This list is scanned instead of the whole code segment. (callis[.], Ncall)

error report

when incorrect arity, incorrect report, such as "syntax error"
should check arity when parsing

2 Jan 2007

fix bug
in genatom for type ADS
in gencase, the last patch is incorrect, it is removed.
in prlist, print ADS with prefix $

9 Jan 2007

