C# Class Mono.CSharp.Constant

Base class for constants and literals.
Inheritance: Mono.CSharp.Expression
Afficher le fichier Open project: vargaz/mono Class Usage Examples

Méthodes publiques

Méthode Description
Clone ( CloneContext clonectx ) : Mono.CSharp.Expression
ContainsEmitWithAwait ( ) : bool
ConvertExplicitly ( bool in_checked_context, System.TypeSpec target_type ) : Constant

Maybe ConvertTo name is better. It tries to convert `this' constant to target_type. It throws OverflowException

ConvertImplicitly ( System.TypeSpec type ) : Constant
CreateConstantFromValue ( System.TypeSpec t, object v, Mono.CSharp.Location loc ) : Constant
CreateExpressionTree ( ResolveContext ec ) : Mono.CSharp.Expression
EmitSideEffect ( EmitContext ec ) : void
Error_ValueCannotBeConverted ( ResolveContext ec, System.TypeSpec target, bool expl ) : void
ExtractConstantFromValue ( System.TypeSpec t, object v, Mono.CSharp.Location loc ) : Constant
GetTypedValue ( ) : object
GetValue ( ) : object

This is used to obtain the actual value of the literal cast into an object.

GetValueAsLiteral ( ) : string
GetValueAsLong ( ) : long
ImplicitConversionRequired ( ResolveContext ec, System.TypeSpec type ) : Constant
IsDefaultInitializer ( System.TypeSpec type ) : bool

Need to pass type as the constant can require a boxing and in such case no optimization is possible

MakeExpression ( BuilderContext ctx ) : System.Linq.Expressions.Expression
Reduce ( ResolveContext ec, System.TypeSpec target_type ) : Constant
Resolve ( ResolveContext rc ) : bool
ToString ( ) : string
TryReduce ( ResolveContext rc, System.TypeSpec targetType ) : Constant

Méthodes protégées

Méthode Description
CloneTo ( CloneContext clonectx, Mono.CSharp.Expression target ) : void
Constant ( Mono.CSharp.Location loc ) : System
DoResolve ( ResolveContext rc ) : Mono.CSharp.Expression

Private Methods

Méthode Description
ChangeType ( object value, System.TypeSpec targetType, bool &error ) : object
TryReduceConstant ( ResolveContext ec, System.TypeSpec target_type ) : Constant

Method Details

Clone() public final méthode

public final Clone ( CloneContext clonectx ) : Mono.CSharp.Expression
clonectx CloneContext
Résultat Mono.CSharp.Expression

CloneTo() protected méthode

protected CloneTo ( CloneContext clonectx, Mono.CSharp.Expression target ) : void
clonectx CloneContext
target Mono.CSharp.Expression
Résultat void

Constant() protected méthode

protected Constant ( Mono.CSharp.Location loc ) : System
loc Mono.CSharp.Location
Résultat System

ContainsEmitWithAwait() public méthode

public ContainsEmitWithAwait ( ) : bool
Résultat bool

ConvertExplicitly() public abstract méthode

Maybe ConvertTo name is better. It tries to convert `this' constant to target_type. It throws OverflowException
public abstract ConvertExplicitly ( bool in_checked_context, System.TypeSpec target_type ) : Constant
in_checked_context bool
target_type System.TypeSpec
Résultat Constant

ConvertImplicitly() public méthode

public ConvertImplicitly ( System.TypeSpec type ) : Constant
type System.TypeSpec
Résultat Constant

CreateConstantFromValue() public static méthode

public static CreateConstantFromValue ( System.TypeSpec t, object v, Mono.CSharp.Location loc ) : Constant
t System.TypeSpec
v object
loc Mono.CSharp.Location
Résultat Constant

CreateExpressionTree() public méthode

public CreateExpressionTree ( ResolveContext ec ) : Mono.CSharp.Expression
ec ResolveContext
Résultat Mono.CSharp.Expression

DoResolve() protected méthode

protected DoResolve ( ResolveContext rc ) : Mono.CSharp.Expression
rc ResolveContext
Résultat Mono.CSharp.Expression

EmitSideEffect() public méthode

public EmitSideEffect ( EmitContext ec ) : void
ec EmitContext
Résultat void

Error_ValueCannotBeConverted() public méthode

public Error_ValueCannotBeConverted ( ResolveContext ec, System.TypeSpec target, bool expl ) : void
ec ResolveContext
target System.TypeSpec
expl bool
Résultat void

ExtractConstantFromValue() public static méthode

public static ExtractConstantFromValue ( System.TypeSpec t, object v, Mono.CSharp.Location loc ) : Constant
t System.TypeSpec
v object
loc Mono.CSharp.Location
Résultat Constant

GetTypedValue() public méthode

public GetTypedValue ( ) : object
Résultat object

GetValue() public abstract méthode

This is used to obtain the actual value of the literal cast into an object.
public abstract GetValue ( ) : object
Résultat object

GetValueAsLiteral() public abstract méthode

public abstract GetValueAsLiteral ( ) : string
Résultat string

GetValueAsLong() public abstract méthode

public abstract GetValueAsLong ( ) : long
Résultat long

ImplicitConversionRequired() public méthode

public ImplicitConversionRequired ( ResolveContext ec, System.TypeSpec type ) : Constant
ec ResolveContext
type System.TypeSpec
Résultat Constant

IsDefaultInitializer() public méthode

Need to pass type as the constant can require a boxing and in such case no optimization is possible
public IsDefaultInitializer ( System.TypeSpec type ) : bool
type System.TypeSpec
Résultat bool

MakeExpression() public méthode

public MakeExpression ( BuilderContext ctx ) : System.Linq.Expressions.Expression
ctx BuilderContext
Résultat System.Linq.Expressions.Expression

Reduce() public méthode

public Reduce ( ResolveContext ec, System.TypeSpec target_type ) : Constant
ec ResolveContext
target_type System.TypeSpec
Résultat Constant

Resolve() public méthode

public Resolve ( ResolveContext rc ) : bool
rc ResolveContext
Résultat bool

ToString() public méthode

public ToString ( ) : string
Résultat string

TryReduce() public méthode

public TryReduce ( ResolveContext rc, System.TypeSpec targetType ) : Constant
rc ResolveContext
targetType System.TypeSpec
Résultat Constant