PageRenderTime 27ms CodeModel.GetById 18ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/parsing/d/interfacebodyunit.d

http://github.com/wilkie/djehuty
D | 56 lines | 29 code | 12 blank | 15 comment | 1 complexity | 056a5a1e3793bd4f39867f76b2f70b5e MD5 | raw file
 1/*
 2 * expressionunit.d
 3 *
 4 * This module parses expressions.
 5 *
 6 */
 7
 8module parsing.d.interfacebodyunit;
 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 InterfaceBodyUnit : 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			// We cannot have allocators in interfaces!
31			case DToken.New:
32				// Error: No allocators allowed.
33				// TODO:
34				break;
35
36			// Ditto for a delete token for deallocator.
37			case DToken.Delete:
38				// Error: No deallocators allowed.
39				// TODO:
40				break;
41
42			// Otherwise, it must be some Declarator
43			default:
44				lexer.push(current);
45				auto tree = expand!(DeclarationUnit)();
46				break;
47		}
48		return true;
49	}
50
51protected:
52	string cur_string = "";
53
54	static const string _common_error_msg = "";
55	static const string[] _common_error_usages = null;
56}