Mercurial > projects > dil
annotate trunk/src/main.d @ 4:92df59b1ec4a
- Started implementation of scan().
author | aziz |
---|---|
date | Fri, 22 Jun 2007 14:12:02 +0000 |
parents | 4bbce78bfb1e |
children | 79b4e8848794 |
rev | line source |
---|---|
0 | 1 /++ |
2 Author: Aziz Köksal | |
3 License: GPL2 | |
4 +/ | |
5 module dparser; | |
3 | 6 import Lexer; |
7 import Token; | |
8 import std.stdio; | |
4 | 9 import std.file; |
0 | 10 |
11 void main(char[][] args) | |
12 { | |
4 | 13 auto srctext = cast(char[]) std.file.read(args[1]); |
14 auto lx = new Lexer(srctext); | |
0 | 15 |
4 | 16 foreach(token; lx.getTokens()) |
17 { | |
18 if (token.type == TOK.Whitespace) | |
19 writefln("%s", token.start[0..token.end-token.start]); | |
20 } | |
0 | 21 } |