ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/antlr/CommonAST.cpp
Revision: 2469
Committed: Fri Dec 2 15:38:03 2005 UTC (18 years, 7 months ago) by tim
File size: 988 byte(s)
Log Message:
End of the Link --> List
Return of the Oject-Oriented
replace yacc/lex parser with antlr parser

File Contents

# Content
1 /* ANTLR Translator Generator
2 * Project led by Terence Parr at http://www.jGuru.com
3 * Software rights: http://www.antlr.org/license.html
4 *
5 * $Id: CommonAST.cpp,v 1.1 2005-12-02 15:38:02 tim Exp $
6 */
7 #include <cstdlib>
8 #include <iostream>
9
10 #include "antlr/config.hpp"
11 #include "antlr/CommonAST.hpp"
12 #include "antlr/ANTLRUtil.hpp"
13
14 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
15 namespace antlr {
16 #endif
17
18 const char* const CommonAST::TYPE_NAME = "CommonAST";
19
20 #ifdef ANTLR_SUPPORT_XML
21 void CommonAST::initialize( ANTLR_USE_NAMESPACE(std)istream& in )
22 {
23 ANTLR_USE_NAMESPACE(std)string t1, t2, text;
24
25 // text
26 read_AttributeNValue( in, t1, text );
27
28 read_AttributeNValue( in, t1, t2 );
29 #ifdef ANTLR_ATOI_IN_STD
30 int type = ANTLR_USE_NAMESPACE(std)atoi(t2.c_str());
31 #else
32 int type = atoi(t2.c_str());
33 #endif
34
35 // initialize first part of AST.
36 this->initialize( type, text );
37 }
38 #endif
39
40 RefAST CommonAST::factory()
41 {
42 return RefAST(new CommonAST);
43 }
44
45 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
46 }
47 #endif
48