saqut-compiler/src/parser/nodes/literal.hpp

26 lines
653 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef SAQUT_AST_LITERAL
#define SAQUT_AST_LITERAL
#include "parser/ast_node.hpp"
class LiteralNode : public ExpressionNode {
public:
Token* lexerToken = nullptr;
ParserToken parserToken;
LiteralType literalType = LiteralType::INTEGER;
int literalBase = 10;
bool isFloatValue = false;
// Sabit katlama (constant folding) tarafından üretilen sentetik literal.
// parserToken.token yerine bu değer kullanılır.
bool hasDirectValue = false;
int directIntValue = 0;
LiteralNode();
void log(int indent = 0) override;
std::string toJson(int depth = 0) override;
};
#endif