PageRenderTime 20ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/parsing/d/interfacebodyunit.d

http://github.com/wilkie/djehuty
D | 56 lines | 29 code | 12 blank | 15 comment | 1 complexity | 056a5a1e3793bd4f39867f76b2f70b5e MD5 | raw file
  1. /*
  2. * expressionunit.d
  3. *
  4. * This module parses expressions.
  5. *
  6. */
  7. module parsing.d.interfacebodyunit;
  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 InterfaceBodyUnit : 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. // We cannot have allocators in interfaces!
  23. case DToken.New:
  24. // Error: No allocators allowed.
  25. // TODO:
  26. break;
  27. // Ditto for a delete token for deallocator.
  28. case DToken.Delete:
  29. // Error: No deallocators allowed.
  30. // TODO:
  31. break;
  32. // Otherwise, it must be some Declarator
  33. default:
  34. lexer.push(current);
  35. auto tree = expand!(DeclarationUnit)();
  36. break;
  37. }
  38. return true;
  39. }
  40. protected:
  41. string cur_string = "";
  42. static const string _common_error_msg = "";
  43. static const string[] _common_error_usages = null;
  44. }