ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/antlr/ASTArray.hpp
Revision: 1442
Committed: Mon May 10 17:28:26 2010 UTC (14 years, 11 months ago) by gezelter
Original Path: trunk/src/antlr/ASTArray.hpp
File size: 826 byte(s)
Log Message:
Adding property set to svn entries

File Contents

# User Rev Content
1 tim 770 #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 gezelter 1442 * $Id$
9 tim 770 */
10    
11     #include <antlr/config.hpp>
12     #include <antlr/AST.hpp>
13    
14     #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15     namespace antlr {
16     #endif
17    
18     /** ASTArray is a class that allows ANTLR to
19     * generate code that can create and initialize an array
20     * in one expression, like:
21     * (new ASTArray(3))->add(x)->add(y)->add(z)
22     */
23     class ANTLR_API ASTArray {
24     public:
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    
34     ASTArray* add(RefAST node)
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__

Properties

Name Value
svn:keywords Author Id Revision Date