当前位置: 首页>>代码示例>>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;未经允许,请勿转载。