Esempio n. 1
0
        private void Case()
        {
            if (!(this.NEleme is JSwitchEleme))
            {
                this.Error();
            }
            this.pSwwitchEleme = this.NEleme as JSwitchEleme;
            var caseE = new JCaseEleme();

            caseE.Father = this.NEleme;
            if (this.pSwwitchEleme.Case == null)
            {
                this.pSwwitchEleme.Case = new List <JCaseEleme>();
            }
            this.pSwwitchEleme.Case.Add(caseE);

            caseE.Value        = new ValueEleme();
            caseE.Value.Father = this.NEleme;
            var valueSpan = new ValueSpan(this.PBParser, caseE.Value);

            valueSpan.Init();
            this.ValidChar(':');
            var jSpan = new JavaSciptSpan(this.PBParser, caseE);

            jSpan.IsCase = true;
            jSpan.Init();
        }
Esempio n. 2
0
        public override void Init()
        {
            pFunEleme = new JFunEleme();
            pFunEleme.PVariableType = EVariableType.SetValue;
            pFunEleme.SetPoint(this.PBParser.Point);
            if (this.IsValidName)
            {
                this.GetTag();
                if (this._Tag == null && this.IsValidName)
                {
                    this.Error();
                }
                pFunEleme.PVariableType = EVariableType.Definition;
                this.pFunEleme.Name     = this._Tag;
                var exists = this.ValidateNameExists(this._Tag);
                if (exists != null)
                {
                    pFunEleme.PVariableType = EVariableType.SetValue;
                    this.pFunEleme.Name     = exists.GetAliasName();
                }
            }
            pFunEleme.Sign = (this.PBParser.VarIndexCount++).ToString();
            this.AddFather(pFunEleme);
            this.ValidChar('(');
            this.Args();
            this.SetArgs();
            this.ValidChar('{');
            this.AnalysisAnnotation(pFunEleme);
            var jsSpan = new JavaSciptSpan(this.PBParser, pFunEleme);

            jsSpan.Init();
            this.ValidChar('}');

            pFunEleme.AddEndPoint(this.PBParser.Point);
        }
        /// <summary>
        /// 解析行
        /// </summary>
        /// <param name="line"></param>
        private void Line()
        {
            var c = this.GetNextChar(' ');

            if (c == Tools.AllEndChar)
            {
                return;
            }
            this.Point.X--;
            var jspan = new JavaSciptSpan(this, this.lumpElem);

            jspan.Init();

            this.Line();
        }