Ejemplo n.º 1
0
        bool ClassState(string input)
        {
            MatchCollection m = mMethodRx.Matches(input);
            if (m.Count > 0)
            {
                mState = MethodState;
                mReturnType = "";
            }

            m = mEndBraceRx.Matches(input);
            if (m.Count > 0)
            {
                DumpBuffer();
                mState = NullState;
            }

            return true;
        }
Ejemplo n.º 2
0
        public void Parse(string path)
        {
            Console.WriteLine("Starting parsing");
            mState = NullState;
            StreamReader file = new StreamReader(path);
            mOutFile = new StreamWriter(path + ".out");
            mOutBuf = new Queue<string>();

            string line;
            while ((line = file.ReadLine()) != null)
            {
                ++mLineNum;
                mOutBuf.Enqueue(line);

                if (!mState(line))
                {
                    break;
                }
            }

            mOutFile.Flush();
        }
Ejemplo n.º 3
0
        bool MethodState(string input)
        {
            MatchCollection m = mReturnTypeRx.Matches(input);
            if (m.Count > 0)
            {
                mReturnType = m[0].Groups[1].Value;
                return true;
            }

            m = mMethodNameRx.Matches(input);
            if (m.Count > 0)
            {
                if (mClass != mReturnType && mReturnType == "InDesign.PageItem")
                {
                    ReplaceReturnType();
                }
                return true;
            }

            m = mEndBraceRx.Matches(input);
            if (m.Count > 0)
            {
                DumpBuffer();
                mState = ClassState;
            }

            return true;
        }
Ejemplo n.º 4
0
        bool NullState(string input)
        {
            MatchCollection m = mClassRx.Matches(input);
            if (m.Count > 0)
            {
                mClass = m[0].Groups[1].Value;
                mState = ClassState;
            }

            return true;
        }