PageRenderTime 16ms CodeModel.GetById 3ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/parsing/d/volatilestmtunit.d

http://github.com/wilkie/djehuty
D | 51 lines | 28 code | 13 blank | 10 comment | 3 complexity | 31c38818d2371ebc6349ed3d117317c7 MD5 | raw file
 1/*
 2 * expressionunit.d
 3 *
 4 * This module parses expressions.
 5 *
 6 */
 7
 8module parsing.d.volatilestmtunit;
 9
10import parsing.parseunit;
11import parsing.token;
12
13import parsing.d.tokens;
14import parsing.d.nodes;
15
16import parsing.d.statementunit;
17
18import io.console;
19
20import djehuty;
21
22class VolatileStmtUnit : ParseUnit {
23	override bool tokenFound(Token current) {
24		switch (current.type) {
25			case DToken.Semicolon:
26				// Done.
27				return false;
28
29			default:
30				if (this.state == 1) {
31					// Error: Multiple statements!?
32					// TODO:
33				}
34
35				lexer.push(current);
36
37				// Statement Follows.
38				auto tree = expand!(StatementUnit)();
39				this.state = 1;
40
41				break;
42		}
43		return true;
44	}
45
46protected:
47	string cur_string = "";
48
49	static const string _common_error_msg = "";
50	static const string[] _common_error_usages = null;
51}