2021-04-05 19:02:30 +01:00
|
|
|
/*
|
2021-10-12 20:51:03 +01:00
|
|
|
* Serene Programming Language
|
2020-07-16 15:48:06 +01:00
|
|
|
*
|
2022-01-27 11:44:44 +00:00
|
|
|
* Copyright (c) 2019-2022 Sameer Rahmani <lxsameer@gnu.org>
|
2020-07-16 15:48:06 +01:00
|
|
|
*
|
2021-10-12 20:51:03 +01:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 2.
|
2020-07-16 15:48:06 +01:00
|
|
|
*
|
2021-10-12 20:51:03 +01:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2020-07-16 15:48:06 +01:00
|
|
|
*
|
2021-10-12 20:51:03 +01:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2020-07-16 15:48:06 +01:00
|
|
|
*/
|
|
|
|
|
2021-04-05 19:02:30 +01:00
|
|
|
#include "serene/exprs/symbol.h"
|
2021-06-13 22:58:46 +01:00
|
|
|
|
2021-08-07 21:09:18 +01:00
|
|
|
#include "serene/exprs/expression.h"
|
|
|
|
|
2021-09-27 13:05:15 +01:00
|
|
|
#include <llvm/Support/Casting.h>
|
2021-07-30 12:17:41 +01:00
|
|
|
#include <llvm/Support/FormatVariadic.h>
|
2021-04-08 19:59:47 +01:00
|
|
|
|
|
|
|
namespace serene {
|
|
|
|
namespace exprs {
|
2021-04-10 15:36:16 +01:00
|
|
|
|
|
|
|
ExprType Symbol::getType() const { return ExprType::Symbol; };
|
|
|
|
|
|
|
|
std::string Symbol::toString() const {
|
2022-01-01 22:15:30 +00:00
|
|
|
return llvm::formatv("<Symbol {0}/{1}>", nsName, name);
|
2021-04-08 19:59:47 +01:00
|
|
|
}
|
|
|
|
|
2021-11-17 17:37:45 +00:00
|
|
|
MaybeNode Symbol::analyze(semantics::AnalysisState &state) {
|
|
|
|
UNUSED(state);
|
|
|
|
|
2021-09-27 13:05:15 +01:00
|
|
|
return EmptyNode;
|
|
|
|
};
|
2021-04-12 23:18:32 +01:00
|
|
|
|
2021-04-11 00:02:56 +01:00
|
|
|
bool Symbol::classof(const Expression *e) {
|
2021-04-17 19:36:25 +01:00
|
|
|
return e->getType() == ExprType::Symbol;
|
2021-04-10 15:36:16 +01:00
|
|
|
};
|
|
|
|
|
2021-04-08 19:59:47 +01:00
|
|
|
} // namespace exprs
|
|
|
|
} // namespace serene
|