ANTLR Support Libraries 2.7.1+
Loading...
Searching...
No Matches
ASTArray.hpp
Go to the documentation of this file.
1#ifndef INC_ASTArray_hpp__
2#define INC_ASTArray_hpp__
3
4/* ANTLR Translator Generator
5 * Project led by Terence Parr at http://www.jGuru.com
6 * Software rights: http://www.antlr.org/license.html
7 *
8 * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/ASTArray.hpp#2 $
9 */
10
11#include <antlr/config.hpp>
12#include <antlr/AST.hpp>
13
14#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15namespace antlr {
16#endif
17
24public:
25 int size; // = 0;
26 ANTLR_USE_NAMESPACE(std)vector<RefAST> array;
27
28 ASTArray(int capacity)
29 : size(0)
30 , array(capacity)
31 {
32 }
33
35 {
36 array[size++] = node;
37 return this;
38 }
39};
40
41#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
42}
43#endif
44
45#endif //INC_ASTArray_hpp__
Definition ASTArray.hpp:23
std ::vector< RefAST > array
Definition ASTArray.hpp:26
ASTArray * add(RefAST node)
Definition ASTArray.hpp:34
int size
Definition ASTArray.hpp:25
ASTArray(int capacity)
Definition ASTArray.hpp:28
#define ANTLR_USE_NAMESPACE(_x_)
Definition config.hpp:18
#define ANTLR_API
Definition config.hpp:22
Definition ANTLRException.hpp:15