Mercurial > repos > rhope
comparison compile.rhope @ 131:0a4682be2db2
Modify lexer and new parser to work in compiler
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 05 Nov 2010 02:43:34 +0000 |
parents | 73e978d590c7 |
children |
comparison
equal
deleted
inserted
replaced
130:147dfc703161 | 131:0a4682be2db2 |
---|---|
5 Main[args] | 5 Main[args] |
6 { | 6 { |
7 [args]Index[1] | 7 [args]Index[1] |
8 { | 8 { |
9 Print[["Parsing "]Append[~]] | 9 Print[["Parsing "]Append[~]] |
10 file <- <String@File[~] | 10 file <- [File[~]]Open["r"] |
11 ,data <- [file]Get FString[[file]Length] | 11 data <- String[[file]Read[[file]Length]] |
12 tokens <- Lex[Count String[data]] | 12 tokens <- Lex[Count String[data]] |
13 Pretty Print[Parse[tokens], ""] | 13 Print[Parse[tokens], ""] |
14 }{ | 14 }{ |
15 Print["Usage: rhope compile.rhope <filename>"] | 15 Print["Usage: rhope compile.rhope <filename>"] |
16 } | 16 } |
17 } | 17 } |
18 |