Пример #1
0
void FunctionEQUAL (const Symbol *sym, vector<Token *> &Tokens, vector<Byte> &Encoding)
{
	vector<Token *>::iterator i = Tokens.begin();
	Expression *e;

	if (sym == 0)
		throw NameMissing ();

	BasicSymbol *bs = CurrentAssembler->Find (sym->GetName());
	Constant *c = dynamic_cast<Constant *> (bs);

	if ((bs == 0) || (c == 0))
	{
		c = new Constant (sym->GetName(), 0, true);
		CurrentAssembler->DefineSymbol (c);
	}

	e = Parser::EvaluateExpression (Tokens, i);
	if (i != Tokens.end())
	{
		cout << "Extra characters on line." << endl;
		return;
	}

	c->SetValue (e);
}