Skip to content
Browse files

Syntactic trees will need to be figured out.

  • Loading branch information...
1 parent 7bdafcf commit f3e89963ed41041fbd9a916ef6dcfcdcfec8f5e6 Live session user committed Mar 21, 2010
Showing with 32 additions and 2 deletions.
  1. +1 −1 Makefile
  2. +3 −0 parsing/ast.d
  3. +3 −1 parsing/d/importdeclunit.d
  4. +19 −0 parsing/d/trees.d
  5. +4 −0 parsing/parseunit.d
  6. +2 −0 tests/test.d
View
2 Makefile
@@ -41,7 +41,7 @@ DFILES_ANALYZING = analyzing/debugger.d
DFILES_CORE = core/tostring.d core/locales/en_us.d core/locales/fr_fr.d core/date.d core/locale.d core/variant.d core/list.d core/exception.d core/event.d core/library.d core/system.d core/random.d core/regex.d core/arguments.d core/definitions.d core/application.d core/time.d core/timezone.d core/unicode.d core/endian.d core/stream.d core/string.d core/main.d core/color.d
DFILES_GUI = gui/container.d gui/trackbar.d gui/radiogroup.d gui/progressbar.d gui/togglefield.d gui/listfield.d gui/listbox.d gui/vscrollbar.d gui/hscrollbar.d gui/button.d gui/textfield.d gui/window.d gui/widget.d gui/application.d
DFILES_UTILS = utils/stack.d utils/linkedlist.d utils/fibonacci.d utils/heap.d
-DFILES_PARSING = parsing/d/addexprunit.d parsing/d/andexprunit.d parsing/d/assignexprunit.d parsing/d/blockstmtunit.d parsing/d/switchstmtunit.d parsing/d/casestmtunit.d parsing/d/defaultstmtunit.d parsing/d/breakstmtunit.d parsing/d/continuestmtunit.d parsing/d/gotostmtunit.d parsing/d/returnstmtunit.d parsing/d/volatilestmtunit.d parsing/d/throwstmtunit.d parsing/d/postfixexprlistunit.d parsing/d/cmpexprunit.d parsing/d/conditionalexprunit.d parsing/d/declarationunit.d parsing/d/expressionunit.d parsing/d/importdeclunit.d parsing/d/isexprunit.d parsing/d/lexer.d parsing/d/logicalandexprunit.d parsing/d/logicalorexprunit.d parsing/d/moduledeclunit.d parsing/d/moduleunit.d parsing/d/mulexprunit.d parsing/d/nodes.d parsing/d/orexprunit.d parsing/d/parser.d parsing/d/postfixexprunit.d parsing/d/primaryexprunit.d parsing/d/shiftexprunit.d parsing/d/staticunit.d parsing/d/declaratorunit.d parsing/d/declaratorsuffixunit.d parsing/d/declaratortypeunit.d parsing/d/tokens.d parsing/d/enumdeclunit.d parsing/d/typeunit.d parsing/d/enumbodyunit.d parsing/d/aggregatedeclunit.d parsing/d/aggregatebodyunit.d parsing/d/classbodyunit.d parsing/d/templatebodyunit.d parsing/d/interfacebodyunit.d parsing/d/classdeclunit.d parsing/d/interfacedeclunit.d parsing/d/constructorunit.d parsing/d/destructorunit.d parsing/d/parameterlistunit.d parsing/d/functionbodyunit.d parsing/d/staticifunit.d parsing/d/versionunit.d parsing/d/debugunit.d parsing/d/unittestunit.d parsing/d/parameterunit.d parsing/d/basictypeunit.d parsing/d/statementunit.d parsing/d/pragmastmtunit.d parsing/d/staticassertunit.d parsing/d/foreachstmtunit.d parsing/d/scopedstmtunit.d parsing/d/forstmtunit.d parsing/d/typedeclarationunit.d parsing/d/unaryexprunit.d parsing/d/xorexprunit.d parsing/ast.d parsing/lexer.d parsing/token.d parsing/parser.d parsing/options.d parsing/cfg.d parsing/parseunit.d
+DFILES_PARSING = parsing/d/trees.d parsing/d/addexprunit.d parsing/d/andexprunit.d parsing/d/assignexprunit.d parsing/d/blockstmtunit.d parsing/d/switchstmtunit.d parsing/d/casestmtunit.d parsing/d/defaultstmtunit.d parsing/d/breakstmtunit.d parsing/d/continuestmtunit.d parsing/d/gotostmtunit.d parsing/d/returnstmtunit.d parsing/d/volatilestmtunit.d parsing/d/throwstmtunit.d parsing/d/postfixexprlistunit.d parsing/d/cmpexprunit.d parsing/d/conditionalexprunit.d parsing/d/declarationunit.d parsing/d/expressionunit.d parsing/d/importdeclunit.d parsing/d/isexprunit.d parsing/d/lexer.d parsing/d/logicalandexprunit.d parsing/d/logicalorexprunit.d parsing/d/moduledeclunit.d parsing/d/moduleunit.d parsing/d/mulexprunit.d parsing/d/nodes.d parsing/d/orexprunit.d parsing/d/parser.d parsing/d/postfixexprunit.d parsing/d/primaryexprunit.d parsing/d/shiftexprunit.d parsing/d/staticunit.d parsing/d/declaratorunit.d parsing/d/declaratorsuffixunit.d parsing/d/declaratortypeunit.d parsing/d/tokens.d parsing/d/enumdeclunit.d parsing/d/typeunit.d parsing/d/enumbodyunit.d parsing/d/aggregatedeclunit.d parsing/d/aggregatebodyunit.d parsing/d/classbodyunit.d parsing/d/templatebodyunit.d parsing/d/interfacebodyunit.d parsing/d/classdeclunit.d parsing/d/interfacedeclunit.d parsing/d/constructorunit.d parsing/d/destructorunit.d parsing/d/parameterlistunit.d parsing/d/functionbodyunit.d parsing/d/staticifunit.d parsing/d/versionunit.d parsing/d/debugunit.d parsing/d/unittestunit.d parsing/d/parameterunit.d parsing/d/basictypeunit.d parsing/d/statementunit.d parsing/d/pragmastmtunit.d parsing/d/staticassertunit.d parsing/d/foreachstmtunit.d parsing/d/scopedstmtunit.d parsing/d/forstmtunit.d parsing/d/typedeclarationunit.d parsing/d/unaryexprunit.d parsing/d/xorexprunit.d parsing/ast.d parsing/lexer.d parsing/token.d parsing/parser.d parsing/options.d parsing/cfg.d parsing/parseunit.d
DFILES = djehuty.d
DFILES_BINARY_CODECS = decoders/binary/decoder.d decoders/binary/base64.d decoders/binary/yEnc.d decoders/binary/deflate.d decoders/binary/zlib.d
DFILES_IMAGE_CODECS = decoders/image/decoder.d decoders/image/all.d decoders/image/bmp.d decoders/image/png.d decoders/image/gif.d decoders/image/jpeg.d
View
3 parsing/ast.d
@@ -9,6 +9,9 @@ import core.tostring;
import io.console;
class AbstractSyntaxTree : List!(AbstractSyntaxTree) {
+ this() {
+ }
+
this(uint type, AbstractSyntaxTree[] nodes ...) {
addList(nodes);
_type = type;
View
4 parsing/d/importdeclunit.d
@@ -14,6 +14,8 @@ import parsing.token;
import parsing.d.tokens;
import parsing.d.nodes;
+import parsing.d.trees;
+
import io.console;
import djehuty;
@@ -37,7 +39,7 @@ class ImportDeclUnit : ParseUnit {
case DToken.Semicolon:
// End of declaration
- Console.putln("Import: ", cur_string);
+ this.root = new Import(cur_string);
return false;
case DToken.Identifier:
View
19 parsing/d/trees.d
@@ -0,0 +1,19 @@
+module parsing.d.trees;
+
+import parsing.ast;
+
+import io.console;
+
+class Import : AbstractSyntaxTree {
+ this(string packageName) {
+ Console.putln("Import: ", packageName);
+ _packageName = packageName;
+ }
+
+ string packageName() {
+ return _packageName;
+ }
+
+protected:
+ string _packageName;
+}
View
4 parsing/parseunit.d
@@ -78,6 +78,10 @@ protected:
_state = value;
}
+ void root(AbstractSyntaxTree ast) {
+ _root = ast;
+ }
+
AbstractSyntaxTree root() {
return _root;
}
View
2 tests/test.d
@@ -1,5 +1,7 @@
module test.foo;
+import foo;
+
pragma(msg);
int b[][][][][];

0 comments on commit f3e8996

Please sign in to comment.
Something went wrong with that request. Please try again.