本文整理汇总了C#中Opcode.Text方法的典型用法代码示例。如果您正苦于以下问题:C# Opcode.Text方法的具体用法?C# Opcode.Text怎么用?C# Opcode.Text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Opcode
的用法示例。
在下文中一共展示了Opcode.Text方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Unary
}//Binary
protected override void Unary( Opcode op, byte[] code, ref int at )
{
var paren = Parens;
if( paren )
{
Write( '(' );
}
var text = op.Text();
var post = op.Postfix();
if( !post )
{
Write( text );
if( text.Length > 2 )
{
Write( ' ' );
}
}
Expression( code, ref at );
if( post )
{
Write( text );
}
if( paren )
{
Write( ')' );
}
}//Unary
示例2: Binary
}//Literal
protected override void Binary( Opcode op, byte[] code, ref int at )
{
var paren = Parens;
if( paren )
{
Write( '(' );
}
if( op == Opcode.Cast )
{
Typeref( code, ref at );
Write( "! " );
Expression( code, ref at );
if( paren )
{
Write( ')' );
}
return;
}
Expression( code, ref at );
Write( ' ' );
Write( op.Text() );
Write( ' ' );
if( (op == Opcode.LogicAnd) || (op == Opcode.LogicOr) )
{
at += 4;
}
Expression( code, ref at );
if( paren )
{
Write( ')' );
}
}//Binary
示例3: Literal
protected override void Literal( Opcode op, byte[] code, ref int at )
{
if( op < Opcode.Ident )
{
Write( op.Text() );
return;
}
if( (op == Opcode.Ident) || (op == Opcode.Number) )
{
var n = code[at++];
Write( Encoding.UTF8.GetString( code, at, n ) );
at += n;
return;
}
if( op == Opcode.String )
{
var n = Cint( code, ref at );
Write( Encoding.UTF8.GetString( code, at, n ) );
at += n;
return;
}
throw new InvalidOperationException();
}//Literal
示例4: Get
}//Create
public Value Get( Opcode op )
{
return op == Opcode.Null ? new Value( this.Object ) : Get( op.Text() );
}//Get
示例5: Other
protected override void Other( Opcode op, byte[] code, ref int at )
{
switch( op )
{
default:
throw new NotImplementedException();
case Opcode.Import:
Write( "using " );
Write( Unalias( Cident( code, ref at ), false, true ) );
return;
case Opcode.Space:
if( Space != null )
{
Indent--;
Line();
Write( "}" );
}
if( code[at] == 0 )
{
at++;
Space = null;
return;
}
Write( "namespace " );
Write( Space = Unalias( Cident( code, ref at ), false, true ) );
Line();
Write( "{" );
Indent++;
Line();
return;
case Opcode.Class:
case Opcode.Struct:
case Opcode.Enum:
case Opcode.Face:
var size = Cint( code, ref at );
var body = at + size;
var tflags = ((Tflag)Cushort( code, ref at ));
var gtnum = code[at++];
var bcnum = code[at++];
var access = tflags.AccessText() ?? DefClassAccess.AccessText();
if( access != null )
{
Write( access );
Write( ' ' );
}
var scope = tflags.ScopeText();
if( scope != null )
{
Write( scope );
Write( ' ' );
}
if( (tflags & Tflag.Hide) != 0 )
{
Write( "new " );
}
if( (tflags & Tflag.Unsafe) != 0 )
{
Write( "unsafe " );
}
if( (tflags & Tflag.Partial) != 0 )
{
Write( "partial " );
}
Write( op.Text() );
Write( ' ' );
Write( Unalias( Cident( code, ref at ), false, true ) );
if( gtnum != 0 )
{
throw new NotImplementedException();
}
if( bcnum != 0 )
{
var first = true;
do
{
Write( first ? ": " : ", " );
first = false;
Typeref( code, ref at );
}
while( (--bcnum) > 0 );
}
Debug.Assert( at == body );
at = body;
Block( code, ref at );
return;
case Opcode.Field:
case Opcode.Event:
size = Cint( code, ref at );
tflags = ((Tflag)Cushort( code, ref at ));
access = tflags.AccessText();
if( access != null )
{
Write( access );
Write( ' ' );
}
scope = tflags.ScopeText();
if( scope != null )
{
Write( scope );
Write( ' ' );
//.........这里部分代码省略.........