Exemplo n.º 1
0
 public List<string> GetOverloadedList(LabelDictionary labelDic)
 {
     List<string> list = new List<string>();
     foreach (KeyValuePair<string, FunctionMethod> pair in methodDic)
     {
         FunctionLabelLine func = labelDic.GetNonEventLabel(pair.Key);
         if (func == null)
             continue;
         if (!func.IsMethod)
             continue;
         list.Add(pair.Key);
     }
     return list;
 }
Exemplo n.º 2
0
 public IOperandTerm GetFunctionMethod(LabelDictionary labelDic, string codeStr, IOperandTerm[] arguments)
 {
     if (Config.ICFunction)
         codeStr = codeStr.ToUpper();
     if ((labelDic != null) && (labelDic.Initialized))
     {
         FunctionLabelLine func = labelDic.GetNonEventLabel(codeStr);
         if (func != null)
         {
             if (func.IsMethod)
             {
                 CalledFunction call = CalledFunction.CreateCalledFunctionMethod(func, codeStr);
                 string errMes;
                 IOperandTerm ret = UserDefinedMethodTerm.Create(arguments, call, out errMes);
                 if(ret == null)
                     throw new CodeEE(errMes);
                 return ret;
             }
             //1.721 #FUNCTIONが定義されていない関数は組み込み関数を上書きしない方向に。 PANCTION.ERBのRANDとか。
             if (!methodDic.ContainsKey(codeStr))
                 throw new CodeEE("#FUNCTIONが定義されていない関数(" + func.Position.Filename + ":" + func.Position.LineNo + "行目)を式中で呼び出そうとしました");
         }
     }
     FunctionMethod method = null;
     if (!methodDic.TryGetValue(codeStr, out method))
         return null;
     string errmes = method.CheckArgumentType(codeStr, arguments);
     if (errmes != null)
         throw new CodeEE(errmes);
     return new FunctionMethodTerm(method, arguments);
 }