summaryrefslogtreecommitdiff
path: root/include/clang/AST/StmtVisitor.h
blob: 9422765e8c32e2fcd2a9782b42b0c180f5a8d0b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//===--- StmtVisitor.h - Visitor for Stmt subclasses ------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
//  This file defines the StmtVisitor interface.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_AST_STMTVISITOR_H
#define LLVM_CLANG_AST_STMTVISITOR_H

namespace clang {
  class Stmt;
  // Add prototypes for all AST node classes.
#define STMT(N, CLASS, PARENT) \
  class CLASS;
#include "clang/AST/StmtNodes.def"
  
/// StmtVisitor - This class implements a simple visitor for Stmt subclasses.
/// Since Expr derives from Stmt, this also includes support for visiting Exprs.
class StmtVisitor {
public:
  virtual ~StmtVisitor();
  
  virtual void VisitStmt(Stmt *Node) {}
  
  // Implement all the methods with the StmtNodes.def file.
#define STMT(N, CLASS, PARENT) \
  virtual void Visit##CLASS(CLASS *Node);
#include "clang/AST/StmtNodes.def"
};
  
}

#endif