made IntegerNode hold a 64-bit integer
git-svn-id: svn://anubis/jtlc/trunk@12 f5bc74b8-7b62-4e90-9214-7121d538519f
This commit is contained in:
parent
19dd46d14d
commit
8333a037c9
@ -44,6 +44,6 @@ void compile(const char * filename)
|
|||||||
{
|
{
|
||||||
FILE * out = tmpfile();
|
FILE * out = tmpfile();
|
||||||
refptr<Node> tree = parse(filename);
|
refptr<Node> tree = parse(filename);
|
||||||
// tree->process(out);
|
tree->process(out);
|
||||||
fclose(out);
|
fclose(out);
|
||||||
}
|
}
|
||||||
|
14
nodes/Node.h
14
nodes/Node.h
@ -1,10 +1,11 @@
|
|||||||
|
|
||||||
#ifndef NODES_H
|
#ifndef NODE_H
|
||||||
#define NODES_H NODES_H
|
#define NODE_H NODE_H
|
||||||
|
|
||||||
#include "util/refptr.h"
|
#include <stdint.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include "util/refptr.h"
|
||||||
|
|
||||||
class Node
|
class Node
|
||||||
{
|
{
|
||||||
@ -14,8 +15,9 @@ class Node
|
|||||||
void addChildren(refptr<Node> other);
|
void addChildren(refptr<Node> other);
|
||||||
std::vector< refptr<Node> > & getChildren() { return m_children; }
|
std::vector< refptr<Node> > & getChildren() { return m_children; }
|
||||||
|
|
||||||
virtual unsigned long getInteger() { return 0ul; }
|
virtual uint64_t getInteger() { return 0x0ULL; }
|
||||||
virtual std::string getString() { return ""; }
|
virtual std::string getString() { return ""; }
|
||||||
|
virtual void process(FILE * out) { }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector< refptr<Node> > m_children;
|
std::vector< refptr<Node> > m_children;
|
||||||
@ -25,10 +27,10 @@ class Node
|
|||||||
class IntegerNode : public Node
|
class IntegerNode : public Node
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IntegerNode(unsigned long integer) { m_integer = integer; }
|
IntegerNode(uint64_t integer) { m_integer = integer; }
|
||||||
unsigned long getInteger() { return m_integer; }
|
unsigned long getInteger() { return m_integer; }
|
||||||
protected:
|
protected:
|
||||||
unsigned long m_integer;
|
uint64_t m_integer;
|
||||||
};
|
};
|
||||||
|
|
||||||
class StringNode : public Node
|
class StringNode : public Node
|
||||||
|
Loading…
x
Reference in New Issue
Block a user