public override void EnterGlobalDeclaration(HS_Gen1Parser.GlobalDeclarationContext context)
{
if (_debug)
{
_logger.Global(context, CompilerContextAction.Enter);
}
// Create a new Global and add it to the table.
string valueType = context.VALUETYPE().GetTextSanitized();
ScriptGlobal glo = new ScriptGlobal()
{
Name = context.ID().GetTextSanitized(),
Type = (short)_opcodes.GetTypeInfo(valueType).Opcode,
ExpressionIndex = _currentIndex,
};
_globals.Add(glo);
if (_debug)
{
_logger.Information($"A global declaration was detected by the parser. The index {_globalPushIndex} will be opened.");
}
OpenDatum(_globalPushIndex);
_expectedTypes.PushType(valueType);
}