parser.h now including parser.tab.hh (should only ever have to include parser/parser.h now); added PrimitiveTypeNode.cc with translation from primitive type to C type string
git-svn-id: svn://anubis/jtlc/trunk@18 f5bc74b8-7b62-4e90-9214-7121d538519f
This commit is contained in:
1 parent
d44b77d240
commit
bf1baf16e6
5 files changed
+39
-2
No files matched your search
@@ -78,6 +78,7 @@ class PrimitiveTypeNode : public Node
|
||||
{
|
||||
public:
|
||||
PrimitiveTypeNode(uint64_t type) { m_integer = type; }
|
||||
virtual std::string getString();
|
||||
};
|
||||
|
||||
class ProgramNode : public Node
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
|
||||
#include <iostream>
|
||||
#include "Node.h"
|
||||
#include "parser/parser.h"
|
||||
using namespace std;
|
||||
|
||||
string PrimitiveTypeNode::getString()
|
||||
{
|
||||
switch (m_integer)
|
||||
{
|
||||
case BYTE:
|
||||
return "int8_t";
|
||||
case UBYTE:
|
||||
return "uint8_t";
|
||||
case CHAR:
|
||||
return "char";
|
||||
case WCHAR:
|
||||
return "wchar_t";
|
||||
case SHORT:
|
||||
return "int16_t";
|
||||
case USHORT:
|
||||
return "uint16_t";
|
||||
case INT:
|
||||
return "int32_t";
|
||||
case UINT:
|
||||
return "uint32_t";
|
||||
case LONG:
|
||||
return "int64_t";
|
||||
case ULONG:
|
||||
return "uint64_t";
|
||||
default:
|
||||
cerr << "Error: Unknown primitive type " << m_integer << endl;
|
||||
return "<UNKNOWN-TYPE>";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user