[<<][staapl][>>][..]
Thu Apr 10 01:14:34 EDT 2008

matcher

it's probably best to:
  * represent assembler instructions with structs + explicit type info
  * write a special purpose matcher that takes into account bitfield
    widths.

the idea is this: the asmgen goes from the textual rep -> symbolic rep
-> procedure rep. what about stopping that compilation somewhere and
leave a little bit of interpretation of the proto?

(define (proto->assembler . proto)
  (match proto
         ((name formals . operands)
          #`(make-asm
             (lambda args
              (parameterize
                  ((asm-error
                    (proto->asm-error-handler '#,proto args)))
                (apply
                 (lambda #,formals
                   (list #,@(map assembler-body operands)))
                 args)))
             '#,proto))))

proto looks like this:
(movlw (k) ((14 . 8) (k . 8))))

moved the asm-error parameterization to assembler.ss resolve/assemble

ok. arity check works.

let's move on to making a pattern matcher. the thing to do is to make
it match instances.


need to revert to find other bug. the problem was with '(list-rest',
which behaves differently than the dotted notation in the other
matcher. as far as i can see the following was legal in match:

   #`(#,@'() . rest)  -> rest

however, in the alternative syntax this becomes:

   #`(list-rest #,@'() rest)  -> (list-rest rest)

which isn't the same:

box> (match '(a b c) ((list-rest bla) bla))
match: no matching clause for (a b c)

tricky business

ok, so now the plt matcher is in place, and it should be possible to
start matching struct instances instead of symbols. on the other hand,
it's not so essential: got plenty of checking implemented now.. maybe
move on to real work?




[Reply][About]
[<<][staapl][>>][..]