コード例 #1
0
        public COMPILATION_UNIT find(Identifier name)
        {
            COMPILATION_UNIT result = null;

            for (int i = 0, n = Length; i < n; i++)
            {
                if (compilation_units[i].name.Name == name.Name)
                {
                    result = compilation_units[i]; break;
                }
            }
            return(result);
        }
コード例 #2
0
        public COMPILATION_UNIT find(COMPILATION_UNIT cu)
        {
            COMPILATION_UNIT result = null;

            for (int i = 0, n = Length; i < n; i++)
            {
                if (compilation_units[i] == cu)
                {
                    result = compilation_units[i]; break;
                }
            }
            return(result);
        }
コード例 #3
0
        public void Add(COMPILATION_UNIT compilation_unit)
        {
            int n = this.compilation_units.Length;
            int i = this.length++;

            if (i == n)
            {
                COMPILATION_UNIT[] newCUs = new COMPILATION_UNIT[n + 8];
                for (int j = 0; j < n; j++)
                {
                    newCUs[j] = compilation_units[j];
                }
                this.compilation_units = newCUs;
            }
            this.compilation_units[i] = compilation_unit;
        }