/parsing/d/classbodyunit.d
http://github.com/wilkie/djehuty · D · 54 lines · 29 code · 12 blank · 13 comment · 1 complexity · 6f982cc2d8ffb62fcd7bd2996d8a9b48 MD5 · raw file
- /*
- * expressionunit.d
- *
- * This module parses expressions.
- *
- */
- module parsing.d.classbodyunit;
- import parsing.parseunit;
- import parsing.token;
- import parsing.d.tokens;
- import parsing.d.nodes;
- import parsing.d.declarationunit;
- import io.console;
- import djehuty;
- class ClassBodyUnit : ParseUnit {
- override bool tokenFound(Token current) {
- switch (current.type) {
- // We are always looking for the end of the body.
- case DToken.RightCurly:
- // Done.
- return false;
- // A new keyword will set up an allocator.
- case DToken.New:
- // TODO:
- break;
- // Ditto for a delete token for deallocator.
- case DToken.Delete:
- // TODO:
- break;
- // Otherwise, it must be some Declarator
- default:
- lexer.push(current);
- auto tree = expand!(DeclarationUnit)();
- break;
- }
- return true;
- }
- protected:
- string cur_string = "";
- static const string _common_error_msg = "";
- static const string[] _common_error_usages = null;
- }