Esempio n. 1
0
        //------------------------------------------------------------
        // ERRLOC Constructor (3)
        //
        /// <para>Constructor.</para>
        /// <para>Get the current position from the BASENODE argument and
        /// mapping information from INFILESYM.SourceData of BSYMMGR.</para>
        /// <param name="symmgr"></param>
        /// <param name="node"></param>
        //------------------------------------------------------------
        internal ERRLOC(BSYMMGR symmgr, BASENODE node, bool fullPath)
        {
            if (node != null)
            {
                DebugUtil.Assert(symmgr != null);

                string    inputFileName = node.GetContainingFileName(fullPath);
                INFILESYM inputFile     = symmgr.FindInfileSym(inputFileName);

                sourceFileName    = inputFileName;
                sourceMapFileName = inputFileName;

                if (inputFile != null)
                {
                    sourceData = inputFile.SourceData;
                    SetLine(node);
                    SetStart(node);
                    SetEnd(node);
                    mapStartPos = (startPos != null ? startPos.Clone() : null);
                    mapEndPos   = (endPos != null ? endPos.Clone() : null);

                    string sd;
                    bool   bd1, bd2;
                    sourceData.Module.MapLocation(mapStartPos, out sourceMapFileName, out bd1, out bd2);
                    sourceData.Module.MapLocation(mapEndPos, out sd, out bd1, out bd2);
                    return;
                }
            }
        }
Esempio n. 2
0
        //------------------------------------------------------------
        // ERRLOC Constructor (2)
        //
        /// <summary>
        /// <para>Constructor.</para>
        /// <para>Get the current position from the BASENODE argument and
        /// mapping information from INFILESYM.SourceData.</para>
        /// </summary>
        /// <param name="inputFile"></param>
        /// <param name="node"></param>
        //------------------------------------------------------------
        internal ERRLOC(INFILESYM inputFile, BASENODE node, bool fullPath)
        {
            DebugUtil.Assert(inputFile != null);

            sourceData = inputFile.SourceData;

            sourceFileName    = (fullPath ? inputFile.FullName : inputFile.Name);
            sourceMapFileName = inputFile.Name;

            if (node != null)
            {
                SetLine(node);
                SetStart(node);
                this.endPos = new POSDATA();    //endPos.SetUninitialized();
                SetEnd(node);
                mapStartPos = (startPos != null ? startPos.Clone() : null);
                mapEndPos   = (endPos != null ? endPos.Clone() : null);

                string sd;       // dummy
                bool   bd1, bd2; // dummy

                // mapStart、mapEnd の行番号をマップ先のもので置き換え、ファイル名を取得する。
                sourceData.Module.MapLocation(mapStartPos, out sourceMapFileName, out bd1, out bd2);
                sourceData.Module.MapLocation(mapEndPos, out sd, out bd1, out bd2);
            }
        }
Esempio n. 3
0
        //------------------------------------------------------------
        // ERRLOC Constructor (5)
        //
        /// <summary></summary>
        /// <param name="scope"></param>
        //------------------------------------------------------------
        internal ERRLOC(ImportScope scope, bool fullPath)
        {
            DebugUtil.Assert(scope != null);

            sourceData        = null;
            sourceFileName    = scope.GetFileName(fullPath);
            sourceMapFileName = sourceFileName;
        }
Esempio n. 4
0
        //------------------------------------------------------------
        // ERRLOC Constructor (4)
        //
        /// <summary></summary>
        /// <param name="sym"></param>
        //------------------------------------------------------------
        internal ERRLOC(INFILESYM sym, bool fullPath)
        {
            DebugUtil.Assert(sym != null);

            sourceData        = sym.SourceData;
            sourceFileName    = (fullPath ? sym.FullName : sym.Name);
            sourceMapFileName = sourceFileName;
        }
Esempio n. 5
0
        //------------------------------------------------------------
        // CInteriorTree.Initialize
        //
        /// <summary>
        /// Set this.interiorNode and return true.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="node"></param>
        /// <returns></returns>
        //------------------------------------------------------------
        internal bool Initialize(CSourceData data, BASENODE node)
        {
            sourceData = data;
#if DEBUG
            debugThread = Thread.CurrentThread;
#endif
            interiorNode = data.Module.GetInteriorNode(data, node);
            return(true);
        }
Esempio n. 6
0
        //------------------------------------------------------------
        // ERRLOC Constructor (8)
        //
        /// <summary></summary>
        /// <param name="filename"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        //------------------------------------------------------------
        internal ERRLOC(string filename, POSDATA start, POSDATA end)
        {
            sourceData       = null;
            this.startPos    = start;
            this.endPos      = end;
            this.mapStartPos = (start != null ? start.Clone() : null);
            this.mapEndPos   = (end != null ? end.Clone() : null);

            sourceMapFileName = sourceFileName = filename;
        }
Esempio n. 7
0
        //private ~CInteriorTree();

        //------------------------------------------------------------
        // CInteriorTree.CreateInstance
        //
        /// <summary>
        /// Create a CInteriorTree instance and initialize it with the arguments.
        /// </summary>
        /// <param name="data"></param>
        /// <param name="node"></param>
        /// <returns></returns>
        //------------------------------------------------------------
        static internal CInteriorTree CreateInstance(CSourceData data, BASENODE node)
        {
            CInteriorTree tree = new CInteriorTree();

            if (tree.Initialize(data, node))
            {
                return(tree);
            }
            return(null);
        }
Esempio n. 8
0
        //------------------------------------------------------------
        // ERRLOC Constructor (7)
        //
        /// <summary></summary>
        /// <param name="sourceModule"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        //------------------------------------------------------------
        internal ERRLOC(CSourceModuleBase sourceModule, POSDATA start, POSDATA end)
        {
            DebugUtil.Assert(sourceModule != null);

            this.sourceData  = null;
            this.startPos    = start;
            this.endPos      = end;
            this.mapStartPos = (start != null ? start.Clone() : null);
            this.mapEndPos   = (end != null ? end.Clone() : null);

            InitFromSourceModule(sourceModule);
        }
Esempio n. 9
0
        //------------------------------------------------------------
        // ERRLOC Constructor (6)
        //
        /// <summary></summary>
        /// <param name="data"></param>
        /// <param name="start"></param>
        /// <param name="end"></param>
        //------------------------------------------------------------
        internal ERRLOC(CSourceData data, POSDATA start, POSDATA end)
        {
            DebugUtil.Assert(data != null);

            this.sourceData = data;
            this.startPos   = start;
            this.endPos     = end;
            mapStartPos     = (start != null ? start.Clone() : null);
            mapEndPos       = (end != null ? end.Clone() : null);

            InitFromSourceModule(this.sourceData.Module);
        }