jtlc/parser/Node.h
josh 798342ec0b added parser/Node, operator==() to util/refptr
git-svn-id: svn://anubis/jtlc/trunk@8 f5bc74b8-7b62-4e90-9214-7121d538519f
2010-01-12 21:39:17 +00:00

37 lines
721 B
C++

#ifndef NODES_H
#define NODES_H NODES_H
#include "util/refptr.h"
#include <vector>
#include <string>
class Node
{
public:
virtual ~Node();
void addChild(refptr<Node> child) { m_children.push_back(child); }
void addChildren(refptr<Node> other);
std::vector< refptr<Node> > & getChildren() { return m_children; }
virtual std::string getString() { return ""; }
protected:
std::vector< refptr<Node> > m_children;
};
class StringNode : public Node
{
public:
StringNode(const std::string & str) { m_string = str; }
std::string getString()
{
return m_string;
}
protected:
std::string m_string;
};
#endif