tipc
A TIP to LLVM compiler
IteratorImpl.h
Go to the documentation of this file.
1 #pragma once
2 #include "SyntaxTree.h"
3 
9 class IteratorImpl {
10 
11 public:
12  explicit IteratorImpl(SyntaxTree const &tree);
13 
14  virtual ~IteratorImpl();
15 
16  virtual SyntaxTree operator*() = 0;
17 
18  virtual SyntaxTree *operator->() = 0;
19 
20  virtual void operator++() = 0;
21 
22  virtual bool operator==(const IteratorImpl &rhs) const = 0;
23 
24  virtual bool operator!=(const IteratorImpl &rhs) const = 0;
25 
26  virtual IteratorImpl *clone() = 0;
27 
28  SyntaxTree const &get_tree() const;
29 
30 protected:
31  SyntaxTree const &tree;
32 };
The interface that an iterator should follow.
Definition: IteratorImpl.h:9
virtual bool operator!=(const IteratorImpl &rhs) const =0
virtual bool operator==(const IteratorImpl &rhs) const =0
virtual ~IteratorImpl()
virtual void operator++()=0
SyntaxTree const & get_tree() const
Definition: IteratorImpl.cpp:5
SyntaxTree const & tree
Definition: IteratorImpl.h:31
virtual SyntaxTree * operator->()=0
IteratorImpl(SyntaxTree const &tree)
Definition: IteratorImpl.cpp:3
virtual IteratorImpl * clone()=0
virtual SyntaxTree operator*()=0
A convenient interface to the AST nodes.
Definition: SyntaxTree.h:16