Ejemplo n.º 1
0
 public ExpBracketTagNew AnalyToTagNew()
 {
     //if (IsAnalyed) return null;
     if (IsExpBracketTagNew())
     {
         ExpBracketTagNew exp = new ExpBracketTagNew(this.ExpContext, this.LeftBracketToken,
                                                     this.RightBracketToken, (InneExps[0] as ExpTagNew));
         //exp.ParentExp = this.ParentExp;
         //exp.SetContext(this.ExpContext);
         ExpBracketTagNew expnew = (ExpBracketTagNew)(exp.Analy());
         return(expnew);
     }
     return(null);
 }
Ejemplo n.º 2
0
        public override Exp Analy( )
        {
            if (IsAnalyed)
            {
                return(this);
            }
            ExpBracketTagNew newTagExp = AnalyToTagNew();

            if (newTagExp != null)
            {
                IsAnalyed         = true;
                this.AnalyCorrect = true;
                return(newTagExp);
            }
            //if(this.InneExps.Count==1)
            //{
            //    if (InneExps[0] is ExpTagNew)
            //    {
            //        ExpBracketTagNew exp = new ExpBracketTagNew(this.LeftBracketToken,
            //            this.RightBracketToken, (InneExps[0] as ExpTagNew));
            //        exp.SetContext(this.ExpContext);
            //        return exp.Analy();
            //    }
            //}
            this.AnalyCorrect = true;
            for (int i = 0; i < InneExps.Count; i++)
            {
                Exp exp = InneExps[i];
                //exp.SetContext(this.ExpContext);
                exp = exp.Analy();
                if (exp == null)
                {
                    AnalyCorrect = false;
                }
                else
                {
                    InneExps[i]  = exp;
                    AnalyCorrect = AnalyCorrect && exp.AnalyCorrect;
                }
            }
            AnalyRet();
            IsAnalyed = true;
            return(this);
        }