PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/parsing/d/parser.d

http://github.com/wilkie/djehuty
D | 43 lines | 25 code | 9 blank | 9 comment | 0 complexity | b4201e29890881fffcb2976cd31a5c03 MD5 | raw file
 1/*
 2 * parser.d
 3 *
 4 * This module will provide a parser for the D programming language.
 5 *
 6 * Author: Dave Wilkinson
 7 * Originated: February 1st, 2010
 8 *
 9 */
10
11module parsing.d.parser;
12
13import parsing.d.lexer;
14import parsing.d.tokens;
15import parsing.d.nodes;
16
17import parsing.d.moduleunit;
18
19import parsing.token;
20import parsing.ast;
21import parsing.lexer;
22import parsing.parser;
23import parsing.parseunit;
24
25import djehuty;
26
27import io.console;
28
29class DParser : Parser {
30	this(Stream stream) {
31		super(stream);
32		_lexer = new DLexer(stream);
33	}
34
35	override AbstractSyntaxTree parse() {
36		ParseUnit parseUnit = new ModuleUnit();
37		parseUnit.lexer = _lexer;
38		return parseUnit.parse();
39	}
40
41private:
42	DLexer _lexer;
43}