Esempio n. 1
0
        private Exp ParsePropertyUse()
        {
            LexToken tok = (LexToken)Tape.Current;

            MoveNext();
            ExpUseProperty exp2 = new ExpUseProperty(this.ExpContext, tok);

            //exp2.SetContextExp(this.expContext);
            return(exp2.Analy());
        }
Esempio n. 2
0
 private Exp Parse1(object data)
 {
     if (data is ExpProcNamePart)
     {
         ExpProcNamePart dataExp     = (ExpProcNamePart)data;
         LexToken        tok         = dataExp.PartNameToken;
         string          text        = tok.Text;
         var             ProcContext = this.ExpContext.ProcContext;
         if (ProcContext.IsThisMethodSingle(text))
         {
             ExpCallSingleThis pptExp = new ExpCallSingleThis(this.ExpContext, tok);
             //pptExp.SetContextExp(this.expContext);
             return(pptExp.Analy());
         }
         else if (ProcContext.IsSuperMethodSingle(text))
         {
             ExpCallSingleSuper pptExp = new ExpCallSingleSuper(this.ExpContext, tok);
             //pptExp.SetContextExp(this.expContext);
             return(pptExp.Analy());
         }
         else if (ProcContext.IsUseMethodSingle(text))
         {
             ExpCallSingleUse pptExp = new ExpCallSingleUse(this.ExpContext, tok);
             //pptExp.SetContextExp(this.expContext);
             return(pptExp.Analy());
         }
         else if (ProcContext.IsUsedProperty(text))
         {
             ExpUseProperty eupExp = new ExpUseProperty(this.ExpContext, tok);
             dataExp.CopyFieldsToExp(eupExp);
             Exp exp2 = eupExp.Analy();
             return(exp2);
         }
         else if (ProcContext.IsUsedField(text))
         {
             ExpUseField eufExp = new ExpUseField(this.ExpContext, tok);
             dataExp.CopyFieldsToExp(eufExp);
             Exp exp2 = eufExp.Analy();
             return(exp2);
         }
         else if (ProcContext.IsUsedEnumItem(text))
         {
             ExpUseEnumItem eueExp = new ExpUseEnumItem(this.ExpContext, tok);
             dataExp.CopyFieldsToExp(eueExp);
             Exp exp2 = eueExp.Analy();
             return(exp2);
         }
         else if (IsAssignTo)
         {
             ExpLocalVar localVarExp = new ExpLocalVar(this.ExpContext, tok);
             localVarExp.IsAssignTo = true;
             dataExp.CopyFieldsToExp(localVarExp);
             Exp exp2 = localVarExp.Analy();
             return(exp2);
         }
         else
         {
             /* 在赋值表达式中会处理ExpErrorToken */
             ExpErrorToken errorExp = new ExpErrorToken(dataExp.ExpContext, tok);
             return(errorExp.Analy());
         }
     }
     else if (data is Exp)
     {
         Exp exp2 = (Exp)data;
         //exp2.SetContextExp(this.expContext);
         return(exp2.Analy());
     }
     else
     {
         return(null);
     }
 }