當前位置: 首頁>>代碼示例>>C#>>正文


C# Expression.ExpressionMediator類代碼示例

本文整理匯總了C#中MinorShift.Emuera.GameData.Expression.ExpressionMediator的典型用法代碼示例。如果您正苦於以下問題:C# ExpressionMediator類的具體用法?C# ExpressionMediator怎麽用?C# ExpressionMediator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ExpressionMediator類屬於MinorShift.Emuera.GameData.Expression命名空間,在下文中一共展示了ExpressionMediator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetReturnValue

 public virtual SingleTerm GetReturnValue(ExpressionMediator exm, IOperandTerm[] arguments)
 {
     if (ReturnType == typeof(Int64))
         return new SingleTerm(GetIntValue(exm, arguments));
     else
         return new SingleTerm(GetStrValue(exm, arguments));
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:7,代碼來源:FunctionMethod.cs

示例2: GetStrValue

 public override string GetStrValue(ExpressionMediator exm)
 {
     SingleTerm term = exm.Process.GetValue(this);
     if (term == null)
         return "";
     return term.Str;
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:7,代碼來源:UserDefinedMethodTerm.cs

示例3: GetIntValue

 public override long GetIntValue(ExpressionMediator exm)
 {
     SingleTerm term = exm.Process.GetValue(this);
     if (term == null)
         return 0;
     return term.Int;
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:7,代碼來源:UserDefinedMethodTerm.cs

示例4: GetValue

 public virtual SingleTerm GetValue(ExpressionMediator exm)
 {
     if (type == typeof(Int64))
         return new SingleTerm(0);
     else
         return new SingleTerm("");
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:7,代碼來源:IOperandTerm.cs

示例5: GetStrValue

 public override string GetStrValue(ExpressionMediator exm, IOperandTerm[] arguments)
 {
     string str = arguments[0].GetStrValue(exm);
     Int64 pos = arguments[1].GetIntValue(exm);
     if (pos < 0 || pos >= str.Length)
         return "";
     return str[(int)pos].ToString();
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:8,代碼來源:Creator.Method.cs

示例6: Restructure

 public override IOperandTerm Restructure(ExpressionMediator exm)
 {
     if (dic == null)
         dic = exm.VEvaluator.Constant.GetKeywordDictionary(out errPos, parentCode, index);
     strTerm = strTerm.Restructure(exm);
     if (!(strTerm is SingleTerm))
         return this;
     return new SingleTerm(this.GetIntValue(exm));
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:9,代碼來源:VariableStrArgTerm.cs

示例7: GetBool

 public bool GetBool(Int64 Is, ExpressionMediator exm)
 {
     if (CaseType == CaseExpressionType.To)
         return LeftTerm.GetIntValue(exm) <= Is && Is <= RightTerm.GetIntValue(exm);
     if (CaseType == CaseExpressionType.Is)
     {
         IOperandTerm term = OperatorMethodManager.ReduceBinaryTerm(Operator, new SingleTerm(Is), LeftTerm);
         return term.GetIntValue(exm) != 0;
     }
     return LeftTerm.GetIntValue(exm) == Is;
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:11,代碼來源:CaseExpression.cs

示例8: GetValue

 public override SingleTerm GetValue(ExpressionMediator exm)
 {
     SingleTerm term =  exm.Process.GetValue(this);
     if (term == null)
     {
         if (GetOperandType() == typeof(Int64))
             return new SingleTerm(0);
         else
             return new SingleTerm("");
     }
     return term;
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:12,代碼來源:UserDefinedMethodTerm.cs

示例9: GetIntValue

 public override Int64 GetIntValue(ExpressionMediator exm)
 {
     try
     {
         return Identifier.GetIntValue(exm, transporter);
     }
     catch(Exception e)
     {
         if ((e is IndexOutOfRangeException) || (e is ArgumentOutOfRangeException) || (e is OverflowException))
             Identifier.CheckElement(transporter);
         throw e;
     }
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:13,代碼來源:VariableTerm.cs

示例10: DoInstruction

 public override void DoInstruction(ExpressionMediator exm, InstructionLine func, ProcessState state)
 {
     ExpressionArrayArgument intExpArg = (ExpressionArrayArgument)func.Argument;
     Int64 integer = -1;
     foreach (IOperandTerm int64Term in intExpArg.TermList)
     {
         integer = int64Term.GetIntValue(exm);
         if(isDel)
             exm.VEvaluator.DelCharacter(integer);
         else
             exm.VEvaluator.AddCharacter(integer, isSp);
     }
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:13,代碼來源:Instraction.Child.cs

示例11: checkArgumentType

 protected bool checkArgumentType(InstructionLine line, ExpressionMediator exm, IOperandTerm[] arguments)
 {
     if (arguments == null)
     {
         warn("引數がありません", line, 2, false);
         return false;
     }
     if ( arguments.Length < minArg ||
         ((arguments.Length < argumentTypeArray.Length) && (minArg < 0)) )
     {
         warn("引數が足りません", line, 2, false);
         return false;
     }
     int length = arguments.Length;
     if ((arguments.Length > argumentTypeArray.Length)&&(!argAny))
     {
         warn("引數が多すぎます", line, 1, false);
         length = argumentTypeArray.Length;
     }
     for (int i = 0; i < length; i++)
     {
         Type allowType;
         if ((!argAny) && (argumentTypeArray[i] == null))
             continue;
         else if (argAny && i >= argumentTypeArray.Length)
             allowType = argumentTypeArray[argumentTypeArray.Length - 1];
         else
             allowType = argumentTypeArray[i];
         if (arguments[i] == null)
         {
             if (allowType == null)
                 continue;
             warn("第" + (i + 1).ToString() + "引數を認識できません", line, 2, false);
             return false;
         }
         if ((allowType != typeof(void)) && (allowType != arguments[i].GetOperandType()))
         {
             warn("第" + (i + 1).ToString() + "引數の型が正しくありません", line, 2, false);
             return false;
         }
     }
     length = arguments.Length;
     for (int i = 0; i < length; i++)
     {
         if (arguments[i] == null)
             continue;
         arguments[i] = arguments[i].Restructure(exm);
     }
     return true;
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:50,代碼來源:ArgumentBuilder.cs

示例12: GetStrValue

 public override string GetStrValue(ExpressionMediator exm)
 {
     try
     {
         string ret = Identifier.GetStrValue(exm, transporter);
         if (ret == null)
             return "";
         return ret;
     }
     catch(Exception e)
     {
         if ((e is IndexOutOfRangeException) || (e is ArgumentOutOfRangeException) || (e is OverflowException))
             Identifier.CheckElement(transporter);
         throw e;
     }
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:16,代碼來源:VariableTerm.cs

示例13: GetIntValue

 public override Int64 GetIntValue(ExpressionMediator exm)
 {
     if (dic == null)
         dic = exm.VEvaluator.Constant.GetKeywordDictionary(out errPos, parentCode, index);
     string key = strTerm.GetStrValue(exm);
     if (key == "")
         throw new CodeEE("キーワードを空には出來ません");
     int i;
     if (!dic.TryGetValue(key, out i))
     {
         if (errPos == null)
             throw new CodeEE("配列変數" + parentCode.ToString() + "の要素を文字列で指定することはできません");
         else
             throw new CodeEE(errPos + "の中に\"" + key + "\"の定義がありません");
     }
     return i;
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:17,代碼來源:VariableStrArgTerm.cs

示例14: Restructure

 public override IOperandTerm Restructure(ExpressionMediator exm)
 {
     if (method.HasUniqueRestructure)
     {
         if (method.UniqueRestructure(exm, arguments) && method.CanRestructure)
             return GetValue(exm);
         return this;
     }
     bool argIsConst = true;
     for(int i = 0; i< arguments.Length;i++)
     {
         if(arguments[i] == null)
             continue;
         arguments[i] = arguments[i].Restructure(exm);
         argIsConst &= arguments[i] is SingleTerm;
     }
     if ((method.CanRestructure) && (argIsConst))
         return GetValue(exm);
     return this;
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:20,代碼來源:FunctionMethodTerm.cs

示例15: CreateArgument

 public virtual Argument CreateArgument(InstructionLine line, ExpressionMediator exm)
 {
     throw new ExeEE("実裝されていない");
 }
開發者ID:utau1116b,項目名稱:Hello-World,代碼行數:4,代碼來源:Instruction.cs


注:本文中的MinorShift.Emuera.GameData.Expression.ExpressionMediator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。