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.
49 lines
659 B
49 lines
659 B
2 years ago
|
/*
|
||
|
* Copyright (C) 2023 Riyyi
|
||
|
*
|
||
|
* SPDX-License-Identifier: MIT
|
||
|
*/
|
||
|
|
||
|
#include <cstdint> // int64_t
|
||
|
|
||
|
#include "ast.h"
|
||
|
|
||
|
namespace blaze {
|
||
|
|
||
|
List::~List()
|
||
|
{
|
||
|
for (auto node : m_nodes) {
|
||
|
delete node;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// -----------------------------------------
|
||
|
|
||
|
void List::addNode(ASTNode* node)
|
||
|
{
|
||
|
m_nodes.push_back(node);
|
||
|
}
|
||
|
|
||
|
// -----------------------------------------
|
||
|
|
||
|
String::String(const std::string& data)
|
||
|
: m_data(data)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
// -----------------------------------------
|
||
|
|
||
|
Number::Number(int64_t number)
|
||
|
: m_number(number)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
// -----------------------------------------
|
||
|
|
||
|
Symbol::Symbol(const std::string& symbol)
|
||
|
: m_symbol(symbol)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
} // namespace blaze
|