TokenList.cpp 378 B

123456789101112131415161718192021222324252627282930313233
  1. #include "TokenList.h"
  2. TokenList::TokenList()
  3. {
  4. }
  5. TokenList::TokenList(const TokenList& orig)
  6. {
  7. }
  8. TokenList::~TokenList()
  9. {
  10. list.forEach([](Token* t)
  11. {
  12. delete t;
  13. });
  14. }
  15. void TokenList::add(Token* t)
  16. {
  17. list.add(t);
  18. }
  19. void TokenList::remove(int index)
  20. {
  21. list.remove(index);
  22. }
  23. void TokenList::forEach(void (*f) (Token*))
  24. {
  25. list.forEach(f);
  26. }