コード例 #1
0
 private void ValidateNumArgs(int numArgs, FunctionMetadata fm)
 {
     if (numArgs < fm.MinParams)
     {
         String msg = "Too few arguments to function '" + fm.Name + "'. ";
         if (fm.HasFixedArgsLength)
         {
             msg += "Expected " + fm.MinParams;
         }
         else
         {
             msg += "At least " + fm.MinParams + " were expected";
         }
         msg += " but got " + numArgs + ".";
         throw new FormulaParseException(msg);
     }
     if (numArgs > fm.MaxParams)
     {
         String msg = "Too many arguments to function '" + fm.Name + "'. ";
         if (fm.HasFixedArgsLength)
         {
             msg += "Expected " + fm.MaxParams;
         }
         else
         {
             msg += "At most " + fm.MaxParams + " were expected";
         }
         msg += " but got " + numArgs + ".";
         throw new FormulaParseException(msg);
     }
 }
コード例 #2
0
 /* package */
 public FunctionMetadataRegistry(FunctionMetadata[] functionDataByIndex, Hashtable functionDataByName)
 {
     _functionDataByIndex = functionDataByIndex;
     _functionDataByName = functionDataByName;
 }
コード例 #3
0
ファイル: FuncPtg.cs プロジェクト: Johnnyfly/source20131023
 private FuncPtg(int funcIndex, FunctionMetadata fm):
     base(funcIndex, fm.ReturnClassCode, fm.ParameterClassCodes, fm.MinParams)  // minParams same as max since these are not var-arg funcs {
 {
 }