You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tdevelop/lib/antlr/src/CommonAST.cpp

50 lines
933 B

/* ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
* Software rights: http://www.antlr.org/license.html
*
* $Id$
*/
#include "antlr/config.h"
#include <cstdlib>
#include <iostream>
#include "antlr/CommonAST.h"
#include "antlr/ANTLRUtil.h"
#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
namespace antlr {
#endif
const char* const CommonAST::TYPE_NAME = "CommonAST";
#ifdef ANTLR_SUPPORT_XML
void CommonAST::initialize( ANTLR_USE_NAMESPACE(std)istream& in )
{
ANTLR_USE_NAMESPACE(std)string t1, t2, text;
// text
read_AttributeNValue( in, t1, text );
read_AttributeNValue( in, t1, t2 );
#ifdef ANTLR_ATOI_IN_STD
int type = ANTLR_USE_NAMESPACE(std)atoi(t2.c_str());
#else
int type = atoi(t2.c_str());
#endif
// initialize first part of AST.
this->initialize( type, text );
}
#endif
RefAST CommonAST::factory()
{
return RefAST(new CommonAST);
}
#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
}
#endif