/parsing/d/classbodyunit.d

http://github.com/wilkie/djehuty · D · 54 lines · 29 code · 12 blank · 13 comment · 1 complexity · 6f982cc2d8ffb62fcd7bd2996d8a9b48 MD5 · raw file

  1. /*
  2. * expressionunit.d
  3. *
  4. * This module parses expressions.
  5. *
  6. */
  7. module parsing.d.classbodyunit;
  8. import parsing.parseunit;
  9. import parsing.token;
  10. import parsing.d.tokens;
  11. import parsing.d.nodes;
  12. import parsing.d.declarationunit;
  13. import io.console;
  14. import djehuty;
  15. class ClassBodyUnit : ParseUnit {
  16. override bool tokenFound(Token current) {
  17. switch (current.type) {
  18. // We are always looking for the end of the body.
  19. case DToken.RightCurly:
  20. // Done.
  21. return false;
  22. // A new keyword will set up an allocator.
  23. case DToken.New:
  24. // TODO:
  25. break;
  26. // Ditto for a delete token for deallocator.
  27. case DToken.Delete:
  28. // TODO:
  29. break;
  30. // Otherwise, it must be some Declarator
  31. default:
  32. lexer.push(current);
  33. auto tree = expand!(DeclarationUnit)();
  34. break;
  35. }
  36. return true;
  37. }
  38. protected:
  39. string cur_string = "";
  40. static const string _common_error_msg = "";
  41. static const string[] _common_error_usages = null;
  42. }