TokenList.cpp 501 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. }
  27. int TokenList::getSize()
  28. {
  29. return list.getSize();
  30. }
  31. Token* TokenList::get(int index)
  32. {
  33. return list.get(index);
  34. }