tipc
A TIP to LLVM compiler
Iterator.h
Go to the documentation of this file.
1 #pragma once
2 #include "IteratorImpl.h"
3 #include <string>
4 
5 #include "SyntaxTree.h"
6 
15 class Iterator {
16 
17 public:
18  Iterator(const Iterator &ts);
19 
20  Iterator(IteratorImpl *impl);
21 
23 
24  SyntaxTree const operator*() const;
25 
27 
28  Iterator operator++(int);
29 
31 
32  SyntaxTree const *operator->() const;
33 
34  bool operator==(const Iterator &rhs);
35 
36  bool operator!=(const Iterator &rhs);
37 
38  SyntaxTree const &get_tree() const;
39 
40 private:
41  std::shared_ptr<IteratorImpl> iteratorImpl;
42 };
The interface that an iterator should follow.
Definition: IteratorImpl.h:9
The client-facing iterator interface.
Definition: Iterator.h:15
Iterator & operator++()
Definition: Iterator.cpp:11
Iterator(const Iterator &ts)
Definition: Iterator.cpp:3
SyntaxTree const & get_tree() const
Definition: Iterator.cpp:34
SyntaxTree * operator->()
Definition: Iterator.cpp:22
bool operator!=(const Iterator &rhs)
Definition: Iterator.cpp:32
bool operator==(const Iterator &rhs)
Definition: Iterator.cpp:28
SyntaxTree operator*()
Definition: Iterator.cpp:7
A convenient interface to the AST nodes.
Definition: SyntaxTree.h:16