private Exp SearchSubject( ) { Exp SubjectExp = Elements[0]; if (SubjectExp is ExpProcNamePart) { return(null); } else if (SubjectExp is ExpNameValue) { return(null); } else { while (SubjectExp is ExpBracket) { ExpBracket expBracket = SubjectExp as ExpBracket; if (expBracket.Count == 1) { SubjectExp = expBracket.GetSubExps()[0]; } else { throw new CCException(); } } ZMethodCall tailDesc = CallDesc.CreateTail(); List <Exp> argExps = ListHelper.GetSubs <Exp>(ArgExps, 1); ExpCallSubject expCallSubject = new ExpCallSubject(this.ExpContext, SubjectExp, tailDesc, this.SrcExp, argExps); return(expCallSubject); } }
public ExpCallThis(ContextExp context, ZMethodCall expProcDesc, ZCMethodInfo searchedMethod, Exp srcExp, List <Exp> argExps) : base(context) { this.ExpProcDesc = expProcDesc; this.ZMethod = searchedMethod; this.SrcExp = srcExp; this.ArgExps = argExps; }
public ExpCallNone(ContextExp context, ZMethodCall expProcDesc, Exp srcExp) : base(context) { this.ExpProcDesc = expProcDesc; this.SrcExp = srcExp; AnalyCorrect = false; }
private void AnalyProcDesc() { CallDesc = new ZMethodCall(); ArgExps = new List <Exp>(); foreach (var item in this.Elements) { //if (this.Elements[0].ToString().StartsWith("战场参数的绘图器")) //{ // Console.WriteLine(this.ToString()); //} if (item is ExpProcNamePart) { ExpProcNamePart namePartExp = item as ExpProcNamePart; CallDesc.Add(namePartExp.PartName); } else if (item is ExpBracket) { ExpBracket bracketExp = item as ExpBracket; ZBracketCall zbracketDesc = bracketExp.GetCallDesc(); CallDesc.Add(zbracketDesc); ArgExps.AddRange(bracketExp.GetSubExps()); } else { throw new CCException(); } } }
private ZLMethodInfo SearchZMethod(string name) { ZMethodCall calldesc = new ZMethodCall(); calldesc.Add(name); ContextImportUse contextiu = this.FileContext.ImportUseContext; return(contextiu.SearchUseMethod(calldesc)[0]); }
private ZLMethodInfo SearchZMethod(string name) { ZMethodCall calldesc = new ZMethodCall(); calldesc.Add(name); var methods = this.ClassContext.SearchSuperProc(calldesc); return(methods[0]); }
public bool IsThisMethodSingle(string name) { ZMethodCall calldesc = new ZMethodCall(); calldesc.Add(name); //ZClassCompilingType zcc = this.ClassContext.ThisCompilingType; var methods = this.ClassContext.SearchThisProc(calldesc); return(methods.Length > 0); }
public bool IsUseMethodSingle(string name) { ContextImportUse importUseContext = this.ClassContext.FileContext.ImportUseContext; //ContextUse cu = this.ClassContext.FileContext.UseContext; ZMethodCall calldesc = new ZMethodCall(); calldesc.Add(name); var methods = importUseContext.SearchUseMethod(calldesc); return(methods != null && methods.Length > 0); }
public ExpCallUse(ContextExp context, ZMethodCall expProcDesc, ZLMethodInfo zmethod, Exp srcExp, List <Exp> argExps) : base(context) { this.ExpProcDesc = expProcDesc; this.SearchedMethod = zmethod; this.SrcExp = srcExp; this.ArgExps = argExps; foreach (Exp sub in ArgExps) { sub.ParentExp = this; } }
public ExpCallSubject(ContextExp context, Exp SubjectExp, ZMethodCall expProcDesc, Exp srcExp, List <Exp> argExps) : base(context) { this.SubjectExp = SubjectExp; this.ExpProcDesc = expProcDesc; this.SrcExp = srcExp; this.ArgExps = argExps; foreach (Exp sub in ArgExps) { sub.ParentExp = this; } }
public bool IsSuperMethodSingle(string name) { if (this.IsStatic()) { return(false); } ZMethodCall calldesc = new ZMethodCall(); calldesc.Add(name); var methods = this.ClassContext.SearchSuperProc(calldesc); return(methods.Length > 0); }
private ZLMethodInfo SearchZMethod(string name) { ZType mainType = SubjectAnalyedExp.RetType; ZMethodCall calldesc = new ZMethodCall(); calldesc.Add(name); if (mainType is ZLClassInfo) { var methods = (mainType as ZLClassInfo).SearchZMethod(calldesc); return(methods[0]); } return(null); }
private ZCMethodInfo SearchZMethod(string name) { ZMethodCall calldesc = new ZMethodCall(); calldesc.Add(name); var methods = this.ClassContext.SearchThisProc(calldesc); if (methods.Length == 0) { throw new CCException(); } return(methods[0]); }
public ZLMethodInfo[] SearchUseMethod(ZMethodCall calldesc) { List <ZLMethodInfo> list = new List <ZLMethodInfo>(); foreach (ZLClassInfo zclass in UseZClassList) { var zitem = zclass.SearchZMethod(calldesc); if (zitem != null && zitem.Length > 0) { list.AddRange(zitem); } } return(list.ToArray()); }
public override Exp Analy() { if (this.IsAnalyed) { return(this); } MethodName = MethodToken.Text; CallDesc = new ZMethodCall(); CallDesc.Add(MethodName); Method = SearchZMethod(MethodName); RetType = Method.RetZType; IsAnalyed = true; return(this); }
public static bool ZEqualsDesc(ZCMethodDesc zmc1, ZMethodCall zmc2) { if (!ZDescUtil.ZEqualsIPartsCount(zmc1, zmc2)) { return(false); } if (!ZDescUtil.ZEqualsIPartsText(zmc1, zmc2)) { return(false); } if (!ZDescUtil.ZEqualsIPartsParameters(zmc1, zmc2)) { return(false); } return(true); }
public ZCMethodInfo[] SearchThisProc(ZMethodCall procDesc) { return((ZCMethodInfo[])SelfCompilingType.SearchDeclaredZMethod(procDesc)); }
public ZLMethodInfo[] SearchSuperProc(ZMethodCall procDesc) { return(SelfCompilingType.BaseZClass.SearchZMethod(procDesc)); }
public ZLMethodInfo[] SearchUseMethod(ZMethodCall calldesc) { return(useContext.SearchUseMethod(calldesc)); }