Add sources
This commit is contained in:
59
src/AST/Expressions/Constant.cpp
Normal file
59
src/AST/Expressions/Constant.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
#include "Constant.h"
|
||||
|
||||
/**
|
||||
* @brief AST::Constant::Constant
|
||||
* @param c
|
||||
*/
|
||||
AST::Constant::Constant(char c)
|
||||
: m_eType(CHAR)
|
||||
{
|
||||
m_nValue.as_char = c;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AST::Constant::Constant
|
||||
* @param s
|
||||
*/
|
||||
AST::Constant::Constant(short s)
|
||||
: m_eType(SHORT)
|
||||
{
|
||||
m_nValue.as_short = s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AST::Constant::Constant
|
||||
* @param i
|
||||
*/
|
||||
AST::Constant::Constant(int i)
|
||||
: m_eType(INTEGER)
|
||||
{
|
||||
m_nValue.as_int = i;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AST::Constant::Constant
|
||||
* @param f
|
||||
*/
|
||||
AST::Constant::Constant(float f)
|
||||
: m_eType(FLOAT)
|
||||
{
|
||||
m_nValue.as_float = f;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AST::Constant::Constant
|
||||
* @param d
|
||||
*/
|
||||
AST::Constant::Constant(double d)
|
||||
: m_eType(DOUBLE)
|
||||
{
|
||||
m_nValue.as_double = d;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief AST::Constant::~Constant
|
||||
*/
|
||||
AST::Constant::~Constant(void)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
Reference in New Issue
Block a user