本文整理汇总了C#中MinorShift.Emuera.GameData.Expression.IOperandTerm类的典型用法代码示例。如果您正苦于以下问题:C# IOperandTerm类的具体用法?C# IOperandTerm怎么用?C# IOperandTerm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOperandTerm类属于MinorShift.Emuera.GameData.Expression命名空间,在下文中一共展示了IOperandTerm类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VariableStrArgTerm
public VariableStrArgTerm(VariableCode code, IOperandTerm strTerm, int index)
: base(typeof(Int64))
{
this.strTerm = strTerm;
parentCode = code;
this.index = index;
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:7,代码来源:VariableStrArgTerm.cs
示例2: Create
/// <summary>
/// エラーならnullを返す。
/// </summary>
public static UserDefinedMethodTerm Create(IOperandTerm[] srcArgs, CalledFunction call, out string errMes)
{
UserDefinedFunctionArgument arg = call.ConvertArg(srcArgs, out errMes);
if (arg == null)
return null;
return new UserDefinedMethodTerm(arg, call.TopLabel.MethodType, call);
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:10,代码来源:UserDefinedMethodTerm.cs
示例3: 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
示例4: 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
示例5: 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
示例6: CheckArgumentType
//引数の数・型が一致するかどうかのテスト
//正しくない場合はエラーメッセージを返す。
//引数の数が不定である場合や引数の省略を許す場合にはoverrideすること。
public virtual string CheckArgumentType(string name, IOperandTerm[] arguments)
{
if (arguments.Length != argumentTypeArray.Length)
return name + "関数の引数の数が正しくありません";
for (int i = 0; i < argumentTypeArray.Length; i++)
{
if (arguments[i] == null)
return name + "関数の" + (i + 1).ToString() + "番目の引数は省略できません";
if (argumentTypeArray[i] != arguments[i].GetOperandType())
return name + "関数の" +(i+1).ToString()+ "番目の引数の型が正しくありません";
}
return null;
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:16,代码来源:FunctionMethod.cs
示例7: 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
示例8: GetIntValue
//実際の計算。
public virtual Int64 GetIntValue(ExpressionMediator exm, IOperandTerm[] arguments)
{
throw new ExeEE("戻り値の型が違う or 未実装");
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:5,代码来源:FunctionMethod.cs
示例9: GetIntValue
public override Int64 GetIntValue(ExpressionMediator exm, IOperandTerm[] arguments)
{
bool isExact = false;
VariableTerm varTerm = (VariableTerm)arguments[0];
Int64 start = (arguments.Length > 2 && arguments[2] != null) ? arguments[2].GetIntValue(exm) : 0;
Int64 end = (arguments.Length > 3 && arguments[3] != null) ? arguments[3].GetIntValue(exm) : varTerm.GetLength();
if (arguments.Length > 4 && arguments[4] != null)
isExact = (arguments[4].GetIntValue(exm) != 0);
FixedVariableTerm p = varTerm.GetFixedVariableTerm(exm);
p.IsArrayRangeValid(start, end, "FINDELEMENT", 3L, 4L);
if (arguments[0].GetOperandType() == typeof(Int64))
{
Int64 targetValue = arguments[1].GetIntValue(exm);
return exm.VEvaluator.FindElement(p, targetValue, start, end, isExact, isLast);
}
else
{
Regex targetString = null;
try
{
targetString = new Regex(arguments[1].GetStrValue(exm));
}
catch (ArgumentException)
{
throw new CodeEE("第2引数が正規表現として不正です");
}
return exm.VEvaluator.FindElement(p, targetString, start, end, isExact, isLast);
}
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:32,代码来源:Creator.Method.cs
示例10: CheckArgumentType
public override string CheckArgumentType(string name, IOperandTerm[] arguments)
{
if (arguments.Length < 1)
return name + "関数には少なくとも1つの引数が必要です";
if (arguments.Length > 2)
return name + "関数の引数が多すぎます";
if (arguments[0] == null)
return name + "関数の1番目の引数は省略できません";
if (!arguments[0].IsInteger)
return name + "関数の1番目の引数が数値ではありません";
if (arguments.Length == 1)
return null;
if ((arguments[1] != null) && (arguments[1].GetOperandType() != typeof(Int64)))
return name + "関数の2番目の変数が数値ではありません";
return null;
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:16,代码来源:Creator.Method.cs
示例11: VariableTerm
public VariableTerm(VariableToken token, IOperandTerm[] args)
: base(token.VariableType)
{
this.Identifier = token;
arguments = args;
transporter = new Int64[arguments.Length];
allArgIsConst = false;
for (int i = 0; i < arguments.Length; i++)
{
if (!(arguments[i] is SingleTerm))
return;
transporter[i] = ((SingleTerm)arguments[i]).Int;
}
allArgIsConst = true;
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:16,代码来源:VariableTerm.cs
示例12: Initialize
public static void Initialize()
{
ZeroTerm = new SingleTerm(0);
IOperandTerm[] zeroArgs = new IOperandTerm[] { ZeroTerm };
TARGET = new VariableTerm(GlobalStatic.VariableData.GetSystemVariableToken("TARGET"), zeroArgs);
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:6,代码来源:VariableParser.cs
示例13: GetStrValue
public virtual string GetStrValue(ExpressionMediator exm, IOperandTerm[] arguments)
{
throw new ExeEE("戻り値の型が違う or 未実装");
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:4,代码来源:FunctionMethod.cs
示例14: UniqueRestructure
/// <summary>
/// 戻り値は全体をRestructureできるかどうか
/// </summary>
/// <param name="exm"></param>
/// <param name="arguments"></param>
/// <returns></returns>
public virtual bool UniqueRestructure(ExpressionMediator exm, IOperandTerm[] arguments)
{
throw new ExeEE("未実装?");
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:10,代码来源:FunctionMethod.cs
示例15: UniqueRestructure
public override bool UniqueRestructure(ExpressionMediator exm, IOperandTerm[] arguments)
{
arguments[0].Restructure(exm);
for (int i = 1; i < arguments.Length; i++)
{
if (arguments[i] == null)
continue;
arguments[i] = arguments[i].Restructure(exm);
}
return false;
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:11,代码来源:Creator.Method.cs
示例16: SetValue
public void SetValue(IOperandTerm value, ExpressionMediator exm)
{
if (Identifier.VariableType == typeof(Int64))
SetValue(value.GetIntValue(exm), exm);
else
SetValue(value.GetStrValue(exm), exm);
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:7,代码来源:VariableTerm.cs
示例17: ReduceVariable
public static VariableTerm ReduceVariable(VariableToken id, IOperandTerm p1, IOperandTerm p2, IOperandTerm p3)
{
IOperandTerm[] terms = null;
IOperandTerm op1 = p1;
IOperandTerm op2 = p2;
IOperandTerm op3 = p3;
//引数の推測
if (id.IsCharacterData)
{
if (id.IsArray2D)
{
if ((op1 == null) || (op2 == null) || (op3 == null))
throw new CodeEE("キャラクタ二次元配列変数" + id.Name + "の引数は省略できません");
terms = new IOperandTerm[3];
terms[0] = op1;
terms[1] = op2;
terms[2] = op3;
}
else if (id.IsArray1D)
{
if (op3 != null)
throw new CodeEE("キャラクタ変数" + id.Name + "の引数が多すぎます");
if (op2 == null)
{
if (op1 == null)
op1 = ZeroTerm;
op2 = op1;
op1 = TARGET;
}
terms = new IOperandTerm[2];
terms[0] = op1;
terms[1] = op2;
}
else
{
if (op2 != null)
throw new CodeEE("一次元配列変数" + id.Name + "の引数が多すぎます");
if (op1 == null)
op1 = TARGET;
terms = new IOperandTerm[1];
terms[0] = op1;
}
}
else if (id.IsArray3D)
{
if ((op1 == null) || (op2 == null) || (op3 == null))
throw new CodeEE("三次元配列変数" + id.Name + "の引数は省略できません");
terms = new IOperandTerm[3];
terms[0] = op1;
terms[1] = op2;
terms[2] = op3;
}
else if (id.IsArray2D)
{
if ((op1 == null) || (op2 == null))
throw new CodeEE("二次元配列変数" + id.Name + "の引数は省略できません");
if (op3 != null)
throw new CodeEE("二次元配列" + id.Name + "の引数が多すぎます");
terms = new IOperandTerm[2];
terms[0] = op1;
terms[1] = op2;
}
else if (id.IsArray1D)
{
if (op2 != null)
throw new CodeEE("一次元配列変数" + id.Name + "の引数が多すぎます");
if (op1 == null)
op1 = ZeroTerm;
terms = new IOperandTerm[1];
terms[0] = op1;
}
else if (op1 != null)
{
throw new CodeEE("配列でない変数" + id.Name + "を引数付きで呼び出しています");
}
else
terms = new IOperandTerm[0];
for (int i = 0; i < terms.Length; i++)
if (terms[i].IsString)
terms[i] = new VariableStrArgTerm(id.Code, terms[i], i);
return new VariableTerm(id, terms);
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:82,代码来源:VariableParser.cs
示例18: TermWord
public TermWord(IOperandTerm term)
{
this.term = term;
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:4,代码来源:Word.cs
示例19: Reduce
public void Reduce(ExpressionMediator exm)
{
LeftTerm = LeftTerm.Restructure(exm);
if (CaseType == CaseExpressionType.To)
RightTerm = RightTerm.Restructure(exm);
}
开发者ID:utau1116b,项目名称:Hello-World,代码行数:6,代码来源:CaseExpression.cs
注:本文中的MinorShift.Emuera.GameData.Expression.IOperandTerm类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论