本文整理汇总了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));
}
示例2: GetStrValue
public override string GetStrValue(ExpressionMediator exm)
{
SingleTerm term = exm.Process.GetValue(this);
if (term == null)
return "";
return term.Str;
}
示例3: GetIntValue
public override long GetIntValue(ExpressionMediator exm)
{
SingleTerm term = exm.Process.GetValue(this);
if (term == null)
return 0;
return term.Int;
}
示例4: GetValue
public virtual SingleTerm GetValue(ExpressionMediator exm)
{
if (type == typeof(Int64))
return new SingleTerm(0);
else
return new SingleTerm("");
}
示例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();
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例15: CreateArgument
public virtual Argument CreateArgument(InstructionLine line, ExpressionMediator exm)
{
throw new ExeEE("実装されていない");
}