本文整理汇总了C#中LS2IL.FlatOperand类的典型用法代码示例。如果您正苦于以下问题:C# FlatOperand类的具体用法?C# FlatOperand怎么用?C# FlatOperand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FlatOperand类属于LS2IL命名空间,在下文中一共展示了FlatOperand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Resolve
public override FlatOperand Resolve(ExpressionSyntax expression, ArgumentListSyntax argumentList, TypeInfo result_type, SymbolInfo si, FlatOperand into_lvalue, Function function, List<FlatStatement> instructions)
{
FlatOperand fop_subject;
if (expression is IdentifierNameSyntax)
{
// typeof this
fop_subject = FlatOperand.ThisRef(FlatValue.FromType(result_type.ConvertedType));
}
else if (expression is MemberAccessExpressionSyntax)
{
MemberAccessExpressionSyntax meas = (MemberAccessExpressionSyntax)expression;
fop_subject = function.ResolveExpression(meas.Expression, null, instructions);
}
else
{
throw new NotImplementedException("GetMetaTable on expression type " + expression.GetType().ToString());
}
if (into_lvalue == null)
{
FlatOperand fop_register = function.AllocateRegister("");
into_lvalue = fop_register.GetLValue(function, instructions);
}
instructions.Add(FlatStatement.GETMETATABLE(into_lvalue, fop_subject));
return into_lvalue.AsRValue(FlatValue.Table());
}
示例2: Resolve
public override FlatOperand Resolve(InvocationExpressionSyntax node, TypeInfo result_type, SymbolInfo si, FlatOperand into_lvalue, Function function, List<FlatStatement> instructions)
{
if (!(node.Expression is MemberAccessExpressionSyntax))
{
throw new NotImplementedException("GETPROPERTY not on MemberAccessExpressionSyntax");
}
MemberAccessExpressionSyntax meas = (MemberAccessExpressionSyntax)node.Expression;
FlatOperand fop_subject = function.ResolveExpression(meas.Expression, null, instructions);
if (into_lvalue == null)
{
FlatOperand fop_register = function.AllocateRegister("");
into_lvalue = fop_register.GetLValue(function, instructions);
}
instructions.Add(FlatStatement.STRINGVAL(into_lvalue, fop_subject));
return into_lvalue.AsRValue(FlatValue.String(string.Empty));
}
示例3: AddSuccessorByRelativeOpnd
void AddSuccessorByRelativeOpnd(FlatOperand opnd)
{
switch (opnd.OperandType)
{
case FlatOperandType.OPND_LABEL:
{
AddSuccessorByLabel(opnd.ImmediateValue.ValueText);
return;
}
break;
}
throw new NotImplementedException();
}
示例4: EHInfo
public EHInfo(EHInfo oldState,int numTryInstruction, FlatOperand catchesLabel, string ehendLabel)
{
CatchesLabel = catchesLabel.ImmediateValue.ValueText;
ehEndLabel = ehendLabel;
PreviousState = oldState;
EHPart = EHPart.Try;
NumTryInstruction = numTryInstruction;
}
示例5: TYPEOF
public static FlatStatement TYPEOF(FlatOperand lvalue, FlatOperand right)
{
if (lvalue.OperandType != FlatOperandType.OPND_IMMEDIATE)
{
throw new NotSupportedException("expected register number (LValue) in left");
}
return new FlatStatement(Instruction.TYPEOF, lvalue, right);
}
示例6: TRY
public static FlatStatement TRY(FlatOperand ehbeginLabel, string ehendLabel)
{
return new FlatStatement(Instruction.TRY, ehbeginLabel) { Comment = ehendLabel };
}
示例7: TABLESET
public static FlatStatement TABLESET(FlatOperand table, FlatOperand key, FlatOperand rvalue)
{
return new FlatStatement(Instruction.TABLESET, table, key, rvalue);
}
示例8: SWITCH
public static FlatStatement SWITCH(FlatOperand array_or_table, FlatOperand key)
{
return new FlatStatement(Instruction.SWITCH, array_or_table, key);
}
示例9: NEWARRAY
public static FlatStatement NEWARRAY(FlatOperand lvalue, FlatOperand size, FlatOperand fop_type)
{
if (lvalue.OperandType != FlatOperandType.OPND_IMMEDIATE)
{
throw new NotSupportedException("expected register number (LValue) in left");
}
return new FlatStatement(Instruction.NEWARRAY, lvalue, size, fop_type);
}
示例10: NEGATE
public static FlatStatement NEGATE(FlatOperand lvalue, FlatOperand left)
{
return new FlatStatement(Instruction.NEGATE, lvalue, left);
}
示例11: LABEL
public static FlatStatement LABEL(FlatOperand label)
{
return new FlatStatement(Instruction.meta_LABEL, label);
}
示例12: JZ
public static FlatStatement JZ(FlatOperand label, FlatOperand left)
{
return new FlatStatement(Instruction.JZ, label, left);
}
示例13: JNE
public static FlatStatement JNE(FlatOperand label, FlatOperand left, FlatOperand right)
{
return new FlatStatement(Instruction.JNE, label, left, right);
}
示例14: JMP
public static FlatStatement JMP(FlatOperand label)
{
return new FlatStatement(Instruction.JMP, label);
}
示例15: IS
public static FlatStatement IS(FlatOperand lvalue, FlatOperand subject, FlatOperand is_type)
{
return new FlatStatement(Instruction.IS, lvalue, subject, is_type);
}