Esempio n. 1
0
        internal int ResolveLRefs(BuildTimeScopeFrame buildTimeScopeFrame)
        {
            var firstVal = -1;
            var lastVal = -1;

            foreach (var lref in m_DefinedNames.Values)
            {
                var pos = buildTimeScopeFrame.AllocVar(lref);

                if (firstVal < 0)
                    firstVal = pos;

                lastVal = pos;
            }

            ScopeBlock.From = firstVal;
            ScopeBlock.ToInclusive = ScopeBlock.To = lastVal;

            if (firstVal < 0)
                ScopeBlock.From = buildTimeScopeFrame.GetPosForNextVar();

            foreach (var child in ChildNodes)
            {
                ScopeBlock.ToInclusive = Math.Max(ScopeBlock.ToInclusive, child.ResolveLRefs(buildTimeScopeFrame));
            }

            if (m_LocalLabels != null)
                foreach (var label in m_LocalLabels.Values)
                    label.SetScope(ScopeBlock);

            return ScopeBlock.ToInclusive;
        }
Esempio n. 2
0
		internal int ResolveLRefs(BuildTimeScopeFrame buildTimeScopeFrame)
		{
			int firstVal = -1;
			int lastVal = -1;

			foreach (SymbolRef lref in m_DefinedNames.Values)
			{
				int pos = buildTimeScopeFrame.AllocVar(lref);

				if (firstVal < 0)
					firstVal = pos;

				lastVal = pos;
			}

			this.ScopeBlock.From = firstVal;
			this.ScopeBlock.ToInclusive = this.ScopeBlock.To = lastVal;

			if (firstVal < 0)
				this.ScopeBlock.From = buildTimeScopeFrame.GetPosForNextVar();

			foreach (var child in ChildNodes)
			{
				this.ScopeBlock.ToInclusive = Math.Max(this.ScopeBlock.ToInclusive, child.ResolveLRefs(buildTimeScopeFrame));
			}

			if (m_LocalLabels != null)
				foreach (var label in m_LocalLabels.Values)
					label.SetScope(this.ScopeBlock);

			return this.ScopeBlock.ToInclusive;
		}
        internal int ResolveLRefs(BuildTimeScopeFrame buildTimeScopeFrame)
        {
            int firstVal = -1;
            int lastVal  = -1;

            foreach (SymbolRef lref in m_DefinedNames.Values)
            {
                int pos = buildTimeScopeFrame.AllocVar(lref);

                if (firstVal < 0)
                {
                    firstVal = pos;
                }

                lastVal = pos;
            }

            this.ScopeBlock.From        = firstVal;
            this.ScopeBlock.ToInclusive = this.ScopeBlock.To = lastVal;

            if (firstVal < 0)
            {
                this.ScopeBlock.From = buildTimeScopeFrame.GetPosForNextVar();
            }

            foreach (var child in ChildNodes)
            {
                this.ScopeBlock.ToInclusive = Math.Max(this.ScopeBlock.ToInclusive, child.ResolveLRefs(buildTimeScopeFrame));
            }

            return(lastVal);
        }
        internal int ResolveLRefs(BuildTimeScopeFrame buildTimeScopeFrame)
        {
            int firstVal = -1;
            int lastVal  = -1;

            foreach (var lref in _definedNames.Values)
            {
                int pos = buildTimeScopeFrame.AllocVar(lref);

                if (firstVal < 0)
                {
                    firstVal = pos;
                }

                lastVal = pos;
            }

            this.ScopeBlock.From        = firstVal;
            this.ScopeBlock.ToInclusive = this.ScopeBlock.To = lastVal;

            if (firstVal < 0)
            {
                this.ScopeBlock.From = buildTimeScopeFrame.GetPosForNextVar();
            }

            foreach (var child in this.ChildNodes)
            {
                this.ScopeBlock.ToInclusive =
                    Math.Max(this.ScopeBlock.ToInclusive, child.ResolveLRefs(buildTimeScopeFrame));
            }

            if (_localLabels != null)
            {
                foreach (var label in _localLabels.Values)
                {
                    label.SetScope(this.ScopeBlock);
                }
            }

            return(this.ScopeBlock.ToInclusive);
        }