changeset 3:4bbce78bfb1e

- Added TOK enum. - Added two methods to Lexer class.
author aziz
date Thu, 21 Jun 2007 18:36:04 +0000
parents 81c6cc33f5c8
children 92df59b1ec4a
files trunk/src/Lexer.d trunk/src/Token.d trunk/src/main.d
diffstat 3 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/trunk/src/Lexer.d	Wed May 30 13:14:00 2007 +0000
+++ b/trunk/src/Lexer.d	Thu Jun 21 18:36:04 2007 +0000
@@ -3,6 +3,7 @@
   License: GPL2
 +/
 module Lexer;
+import Token;
 import std.stdio;
 
 /// ASCII character properties table.
@@ -64,5 +65,13 @@
 
 class Lexer
 {
+  Token t;
+  public void scan(ref Token t)
+  {
 
+  }
+  public TOK nextToken()
+  {
+    return TOK.max;
+  }
 }
\ No newline at end of file
--- a/trunk/src/Token.d	Wed May 30 13:14:00 2007 +0000
+++ b/trunk/src/Token.d	Thu Jun 21 18:36:04 2007 +0000
@@ -10,14 +10,16 @@
   size_t col;
 }
 
+enum TOK
+{
+  Identifier,
+  Whitespace,
+  Comment
+}
+
 struct Token
 {
-  enum Type
-  {
-
-  }
-
-  Type type;
+  TOK type;
   Position pos;
 
   union
--- a/trunk/src/main.d	Wed May 30 13:14:00 2007 +0000
+++ b/trunk/src/main.d	Thu Jun 21 18:36:04 2007 +0000
@@ -3,6 +3,9 @@
   License: GPL2
 +/
 module dparser;
+import Lexer;
+import Token;
+import std.stdio;
 
 void main(char[][] args)
 {