diff trunk/src/main.d @ 618:07946b379006

Refactored the way dot expressions are parsed. DotExpression is a binary expression now. Added ModuleScopeExpression. Removed some obsolete expression classes. Added QualifiedType and ModuleScopeType. Removed some obsolete type node classes. Added genAnonymousID() to IdTable. Removed obsolete parser functions. Improved Node.getDocComments(). Added semantic() methods to some declaration classes.
author Aziz K?ksal <aziz.koeksal@gmail.com>
date Fri, 11 Jan 2008 00:42:35 +0100
parents 39fac5531b85
children 2feb88f5c867
line wrap: on
line diff
--- a/trunk/src/main.d	Thu Jan 10 19:47:34 2008 +0100
+++ b/trunk/src/main.d	Fri Jan 11 00:42:35 2008 +0100
@@ -5,16 +5,20 @@
 module main;
 
 import dil.parser.Parser;
-import dil.lexer.Lexer;
-import dil.lexer.Token;
+import dil.lexer.Lexer,
+       dil.lexer.Token;
+import dil.ast.Declarations,
+       dil.ast.Expressions,
+       dil.ast.Node;
 import dil.Messages;
 import dil.Settings;
 import dil.SettingsLoader;
 import dil.CompilerInfo;
 import dil.semantic.Module;
-import dil.ast.Declarations, dil.ast.Expressions, dil.ast.Node;
 import dil.Information;
 import dil.File;
+import dil.semantic.Symbols;
+
 import cmd.Generate;
 import cmd.Statistics;
 import cmd.ImportGraph;
@@ -48,6 +52,20 @@
       mod.parse();
       // Start semantic analysis.
       mod.semantic();
+
+      void printSymbolTable(ScopeSymbol scopeSym)
+      {
+        foreach (member; scopeSym.members)
+        {
+          auto tokens = member.node.getDocComments();
+          char[] docText;
+          foreach (token; tokens)
+            docText ~= token.srcText;
+          Stdout.formatln("Id:{}, Symbol:{}, DocText:{}", member.ident.str, member.classinfo.name, docText);
+        }
+      }
+
+      printSymbolTable(mod);
     }
 
     foreach (info; infoMan.info)