/parsing/d/xorexprunit.d
http://github.com/wilkie/djehuty · D · 53 lines · 34 code · 11 blank · 8 comment · 5 complexity · 6747124922a71e6c9e84f696de42f6e4 MD5 · raw file
- /*
- * expressionunit.d
- *
- * This module parses expressions.
- *
- */
- module parsing.d.xorexprunit;
- import parsing.parseunit;
- import parsing.token;
- import parsing.d.tokens;
- import parsing.d.nodes;
- import parsing.d.andexprunit;
- import io.console;
- import djehuty;
- class XorExprUnit : ParseUnit {
- override bool tokenFound(Token current) {
- switch (current.type) {
- case DToken.Xor:
- if (this.state == 1) {
- Console.putln("XOR");
- this.state = 0;
- break;
- }
- // Fall through
- goto default;
- default:
- lexer.push(current);
- if (this.state == 1) {
- // Done.
- return false;
- }
- auto tree = expand!(AndExprUnit)();
- this.state = 1;
- break;
- }
- return true;
- }
- protected:
- string cur_string = "";
- static const string _common_error_msg = "";
- static const string[] _common_error_usages = null;
- }