/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. module parsing.d.postfixexprunit;
  8. import parsing.parseunit;
  9. import parsing.token;
  10. import parsing.d.tokens;
  11. import parsing.d.nodes;
  12. import parsing.d.postfixexprlistunit;
  13. import io.console;
  14. import djehuty;
  15. class PostFixExprUnit : ParseUnit {
  16. override bool tokenFound(Token current) {
  17. switch (current.type) {
  18. case DToken.Null:
  19. case DToken.True:
  20. case DToken.False:
  21. case DToken.IntegerLiteral:
  22. case DToken.Dollar:
  23. case DToken.FloatingPointLiteral:
  24. Console.putln("Expression: ", current.value);
  25. return false;
  26. case DToken.Mixin:
  27. // TODO: MixinExprUnit
  28. // auto tree = expand!(MixinExprUnit)();
  29. break;
  30. case DToken.Assert:
  31. // TODO: AssertExprUnit
  32. // auto tree = expand!(AssertExprUnit)();
  33. break;
  34. case DToken.Is:
  35. // TODO: IsExprUnit
  36. // auto tree = expand!(IsExprUnit)();
  37. break;
  38. default:
  39. lexer.push(current);
  40. auto tree = expand!(PostFixExprListUnit)();
  41. return false;
  42. }
  43. return true;
  44. }
  45. protected:
  46. string cur_string = "";
  47. static const string _common_error_msg = "";
  48. static const string[] _common_error_usages = null;
  49. }