Blamite.Blam.Scripting.Compiler.ScriptCompiler.EnterGlobalDeclaration C# (CSharp) Метод

EnterGlobalDeclaration() публичный Метод

Processes global declarations. Opens a datum. Creates the global node. Pushes the value type.
public EnterGlobalDeclaration ( HS_Gen1Parser.GlobalDeclarationContext context ) : void
context HS_Gen1Parser.GlobalDeclarationContext
Результат void
        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);
        }