PageRenderTime 15ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 2ms app.codeStats 0ms

/parsing/d/classbodyunit.d

http://github.com/wilkie/djehuty
D | 54 lines | 29 code | 12 blank | 13 comment | 1 complexity | 6f982cc2d8ffb62fcd7bd2996d8a9b48 MD5 | raw file
 1/*
 2 * expressionunit.d
 3 *
 4 * This module parses expressions.
 5 *
 6 */
 7
 8module parsing.d.classbodyunit;
 9
10import parsing.parseunit;
11import parsing.token;
12
13import parsing.d.tokens;
14import parsing.d.nodes;
15
16import parsing.d.declarationunit;
17
18import io.console;
19
20import djehuty;
21
22class ClassBodyUnit : ParseUnit {
23	override bool tokenFound(Token current) {
24		switch (current.type) {
25			// We are always looking for the end of the body.
26			case DToken.RightCurly:
27				// Done.
28				return false;
29
30			// A new keyword will set up an allocator.
31			case DToken.New:
32				// TODO:
33				break;
34
35			// Ditto for a delete token for deallocator.
36			case DToken.Delete:
37				// TODO:
38				break;
39
40			// Otherwise, it must be some Declarator
41			default:
42				lexer.push(current);
43				auto tree = expand!(DeclarationUnit)();
44				break;
45		}
46		return true;
47	}
48
49protected:
50	string cur_string = "";
51
52	static const string _common_error_msg = "";
53	static const string[] _common_error_usages = null;
54}