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

/parsing/d/postfixexprunit.d

http://github.com/wilkie/djehuty
D | 58 lines | 37 code | 9 blank | 12 comment | 1 complexity | 5b752b82cc2d2b2c5a59a93fe7447df8 MD5 | raw file
 1/*
 2 * expressionunit.d
 3 *
 4 * This module parses expressions.
 5 *
 6 */
 7
 8module parsing.d.postfixexprunit;
 9
10import parsing.parseunit;
11import parsing.token;
12
13import parsing.d.tokens;
14import parsing.d.nodes;
15
16import parsing.d.postfixexprlistunit;
17
18import io.console;
19
20import djehuty;
21
22class PostFixExprUnit : ParseUnit {
23	override bool tokenFound(Token current) {
24		switch (current.type) {
25			case DToken.Null:
26			case DToken.True:
27			case DToken.False:
28			case DToken.IntegerLiteral:
29			case DToken.Dollar:
30			case DToken.FloatingPointLiteral:
31				Console.putln("Expression: ", current.value);
32				return false;	
33			case DToken.Mixin:
34				// TODO: MixinExprUnit
35//				auto tree = expand!(MixinExprUnit)();
36				break;
37			case DToken.Assert:
38				// TODO: AssertExprUnit
39//				auto tree = expand!(AssertExprUnit)();
40				break;
41			case DToken.Is:
42				// TODO: IsExprUnit
43//				auto tree = expand!(IsExprUnit)();
44				break;
45			default:
46				lexer.push(current);
47				auto tree = expand!(PostFixExprListUnit)();
48				return false;
49		}
50		return true;
51	}
52
53protected:
54	string cur_string = "";
55
56	static const string _common_error_msg = "";
57	static const string[] _common_error_usages = null;
58}