annotate modules/compiler.tp @ 263:98147071baf6

Add support for llMessage definitions in buildMethodTables
author Michael Pavone <pavone@retrodev.com>
date Mon, 14 Jul 2014 09:30:31 -0700
parents 004946743678
children
rev   line source
pavone@252 1 #{
pavone@252 2 main <- :args {
pavone@252 3 if: (args length) > 1 {
pavone@252 4 file <- os open: (args get: 1) (os O_RDONLY)
pavone@252 5
pavone@252 6 code <- ""
pavone@252 7 chunksize <- 1024
pavone@252 8 readsize <- chunksize
pavone@252 9 while: { readsize = chunksize} do: {
pavone@252 10 seg <- os read: file chunksize
pavone@252 11 code <- code . seg
pavone@252 12 readsize <- seg byte_length
pavone@252 13 }
pavone@252 14 res <- parser top: code
pavone@252 15 if: res {
pavone@252 16 methods <- symbols buildMethodTable: (res yield)
pavone@252 17 print: methods
pavone@252 18 } else: {
pavone@252 19 print: "Parse failed!\n"
pavone@252 20 }
pavone@252 21 } else: {
pavone@252 22 print: "Usage compiler FILE\n"
pavone@252 23 }
pavone@252 24 }
pavone@252 25 }