C# 클래스 NGettext.PluralCompile.Compiler.PluralRuleCompiler

Compiler that compiles a plural rule abstract syntax tree into a managed dynamic method delegate using an IL code generator.
파일 보기 프로젝트 열기: neris/NGettext 1 사용 예제들

공개 메소드들

메소드 설명
CompileToDynamicMethod ( Token astRoot, Type outputDelegateType ) : Delegate

Compiles a plural rule abstract syntax tree into managed dynamic method delegate using an IL code generator.

보호된 메소드들

메소드 설명
CompileFinish ( ILGenerator il ) : void

Emits instructions required for compilation stop procedure.

CompileNode ( ILGenerator il, Token node ) : void

Recursively compiles an AST node to the IL instructions.

CompileStart ( ILGenerator il ) : void

Emits instructions required for compilation start procedure.

CreateDynamicMethod ( Type outputDelegateType ) : DynamicMethod

Creates a new DynamicMethod instance with signature of given delegate type.

EmitConditionalBranch ( ILGenerator il, OpCode conditionOpCode, Token trueNode, Token falseNode ) : void

Emits instructions required for conditional branch using given OpCode to check condition and given nodes for positive and negative branches.

EmitConditionalValue ( ILGenerator il, OpCode conditionOpCode, long trueValue = 1, long falseValue ) : void

Emits instructions required for creating a value on the stack based on specified condition operation result.

We can not use simplified OpCodes.Clt, OpCodes.Cgt and similar instructions because we use an Int64 as an argument value.

메소드 상세

CompileFinish() 보호된 메소드

Emits instructions required for compilation stop procedure.
protected CompileFinish ( ILGenerator il ) : void
il System.Reflection.Emit.ILGenerator IL generator instance.
리턴 void

CompileNode() 보호된 메소드

Recursively compiles an AST node to the IL instructions.
protected CompileNode ( ILGenerator il, Token node ) : void
il System.Reflection.Emit.ILGenerator IL generator instance.
node NGettext.Plural.Ast.Token AST node.
리턴 void

CompileStart() 보호된 메소드

Emits instructions required for compilation start procedure.
protected CompileStart ( ILGenerator il ) : void
il System.Reflection.Emit.ILGenerator IL generator instance.
리턴 void

CompileToDynamicMethod() 공개 메소드

Compiles a plural rule abstract syntax tree into managed dynamic method delegate using an IL code generator.
public CompileToDynamicMethod ( Token astRoot, Type outputDelegateType ) : Delegate
astRoot NGettext.Plural.Ast.Token abstract syntax tree root node.
outputDelegateType System.Type Type of output delegate.
리턴 System.Delegate

CreateDynamicMethod() 보호된 메소드

Creates a new DynamicMethod instance with signature of given delegate type.
protected CreateDynamicMethod ( Type outputDelegateType ) : DynamicMethod
outputDelegateType System.Type
리턴 System.Reflection.Emit.DynamicMethod

EmitConditionalBranch() 보호된 메소드

Emits instructions required for conditional branch using given OpCode to check condition and given nodes for positive and negative branches.
protected EmitConditionalBranch ( ILGenerator il, OpCode conditionOpCode, Token trueNode, Token falseNode ) : void
il System.Reflection.Emit.ILGenerator IL generator instance.
conditionOpCode System.Reflection.Emit.OpCode OpCode of the condition check operation.
trueNode NGettext.Plural.Ast.Token AST node that will be executed when condition returns positive result.
falseNode NGettext.Plural.Ast.Token AST node that will be executed when condition returns negative result.
리턴 void

EmitConditionalValue() 보호된 메소드

Emits instructions required for creating a value on the stack based on specified condition operation result.
We can not use simplified OpCodes.Clt, OpCodes.Cgt and similar instructions because we use an Int64 as an argument value.
protected EmitConditionalValue ( ILGenerator il, OpCode conditionOpCode, long trueValue = 1, long falseValue ) : void
il System.Reflection.Emit.ILGenerator IL generator instance.
conditionOpCode System.Reflection.Emit.OpCode OpCode of the condition check operation.
trueValue long A value that will be put on stack when condition returns positive result.
falseValue long A value that will be put on stack when condition returns negative result.
리턴 void