Exemplo n.º 1
0
        private void BindGlobalVariable(VariableDeclarationStatementSyntax variableDeclarationStatementSyntax)
        {
            var declaration = variableDeclarationStatementSyntax.Declaration;

            foreach (var declarator in declaration.Variables)
            {
                var variableType = _symbolSet.ResolveType(declaration.Type, null, null);

                foreach (var arrayRankSpecifier in declarator.ArrayRankSpecifiers)
                {
                    variableType = new ArraySymbol(variableType);
                }

                var symbol = new GlobalVariableSymbol(declarator, variableType);
                _bindingResult.AddSymbol(declarator, symbol);

                _symbolSet.AddGlobal(symbol);
            }
        }