package com.jfireel.expression.node.impl;

import com.jfireel.expression.node.CalculateNode;
import com.jfireel.expression.token.Symbol;
import com.jfireel.expression.token.TokenType;

import java.util.Map;

public class SymBolNode implements CalculateNode {

	private Symbol symbol;

	public SymBolNode(Symbol symbol) {
		this.symbol = symbol;
	}

	// 符号节点没有参数计算
	@Override
	public Object calculate(Map<String, Object> variables) {
		throw new UnsupportedOperationException();
	}

	@Override
	public TokenType type() {
		return symbol;
	}

	@Override
	public String toString() {
		return literals();
	}

	@Override
	public String literals() {
		return symbol.getLiterals();
	}

}
