本文整理汇总了C#中ILocalDefinition类的典型用法代码示例。如果您正苦于以下问题:C# ILocalDefinition类的具体用法?C# ILocalDefinition怎么用?C# ILocalDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILocalDefinition类属于命名空间,在下文中一共展示了ILocalDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetPrimarySourceLocationsForDefinitionOf
/// <summary>
/// Return zero or more locations in primary source documents that correspond to the definition of the given local.
/// </summary>
public IEnumerable<IPrimarySourceLocation> GetPrimarySourceLocationsForDefinitionOf(ILocalDefinition localDefinition) {
ISourceLocationProvider/*?*/ provider = this.GetProvider(localDefinition);
if (provider == null)
return Enumerable<IPrimarySourceLocation>.Empty;
else
return provider.GetPrimarySourceLocationsForDefinitionOf(localDefinition);
}
示例2: Visit
public override void Visit(ILocalDefinition localDefinition)
{
NewLineAddIndent();
AppendElementType(localDefinition);
//output.Append(localDefinition.Name.Value);
//AppendSpace();
base.Visit(localDefinition);
}
示例3: GetSourceNameFor
/// <summary>
/// Returns the source name of the given local definition, if this is available.
/// Otherwise returns the value of the Name property and sets isCompilerGenerated to true.
/// </summary>
public string GetSourceNameFor(ILocalDefinition localDefinition, out bool isCompilerGenerated) {
ISourceLocationProvider/*?*/ provider = this.GetProvider(localDefinition);
if (provider == null) {
isCompilerGenerated = false;
return "";
} else {
return provider.GetSourceNameFor(localDefinition, out isCompilerGenerated);
}
}
示例4: FindOrCreateLocalVariable
/// <summary>
///
/// </summary>
/// <param name="local"></param>
/// <returns></returns>
public Bpl.Variable FindOrCreateLocalVariable(ILocalDefinition local) {
Bpl.LocalVariable v;
Bpl.IToken tok = local.Token();
Bpl.Type t = TranslationHelper.CciTypeToBoogie(local.Type.ResolvedType);
if (!localVarMap.TryGetValue(local, out v)) {
v = new Bpl.LocalVariable(tok, new Bpl.TypedIdent(tok, local.Name.Value, t));
localVarMap.Add(local, v);
}
return v;
}
示例5: Visit
/// <summary>
/// Visits the specified local definition.
/// </summary>
/// <param name="localDefinition">The local definition.</param>
public virtual void Visit(ILocalDefinition localDefinition)
{
if (this.stopTraversal) return;
//^ int oldCount = this.path.Count;
this.path.Push(localDefinition);
if (localDefinition.IsModified)
this.Visit(localDefinition.CustomModifiers);
this.Visit(localDefinition.Type);
//^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not to decrease this.path.Count.
this.path.Pop();
}
示例6: Visit
public virtual void Visit(ILocalDefinition localDefinition)
{
this.Visit(localDefinition.CustomModifiers);
this.Visit(localDefinition.Type);
}
示例7: GetLocalWithSourceName
private ILocalDefinition GetLocalWithSourceName(ILocalDefinition localDef) {
Contract.Requires(localDef != null);
Contract.Ensures(Contract.Result<ILocalDefinition>() != null);
return this.sourceMethodBody.GetLocalWithSourceName(localDef);
}
示例8: GetProvider
/*?*/
private ILocalScopeProvider GetProvider(ILocalDefinition localDefinition)
{
return this.GetProvider(localDefinition.MethodDefinition);
}
示例9: TraverseChildren
public override void TraverseChildren(ILocalDefinition localDefinition)
{
if (!foundLocals.Contains(localDefinition)) foundLocals.Add(localDefinition);
base.TraverseChildren(localDefinition);
}
示例10: VisitReference
/// <summary>
/// Performs some computation with the given local definition.
/// </summary>
public void VisitReference(ILocalDefinition localDefinition)
{
}
示例11: GetLocalWithSourceName
private ILocalDefinition GetLocalWithSourceName(ILocalDefinition localDef)
{
if (this.sourceLocationProvider == null) return localDef;
var mutableLocal = this.localMap[localDef];
if (mutableLocal != null) return mutableLocal;
mutableLocal = localDef as LocalDefinition;
if (mutableLocal == null) {
mutableLocal = new LocalDefinition();
mutableLocal.Copy(localDef, this.host.InternFactory);
}
this.localMap.Add(localDef, mutableLocal);
bool isCompilerGenerated;
var sourceName = this.sourceLocationProvider.GetSourceNameFor(localDef, out isCompilerGenerated);
if (sourceName != localDef.Name.Value) {
mutableLocal.Name = this.host.NameTable.GetNameFor(sourceName);
}
return mutableLocal;
}
示例12: GetTypesOfVariable
private static IEnumerable<string> GetTypesOfVariable(ILocalDefinition variable)
{
return from t in variable.Type.GetAllRealTypeReferences()
select t.ToString();
}
示例13: TraverseChildren
/// <summary>
/// Traverses the children of the specified local definition.
/// </summary>
public virtual void TraverseChildren(ILocalDefinition localDefinition)
{
Contract.Requires(localDefinition != null);
if (localDefinition.IsConstant)
this.Traverse(localDefinition.CompileTimeValue);
if (localDefinition.IsModified)
this.Traverse(localDefinition.CustomModifiers);
if (this.stopTraversal) return;
this.Traverse(localDefinition.Type);
}
示例14: Traverse
/// <summary>
/// Traverses the specified local definition.
/// </summary>
public void Traverse(ILocalDefinition localDefinition)
{
Contract.Requires(localDefinition != null);
if (!this.objectsThatHaveAlreadyBeenTraversed.Add(localDefinition)) return;
if (this.preorderVisitor != null) this.preorderVisitor.Visit(localDefinition);
if (this.stopTraversal) return;
this.TraverseChildren(localDefinition);
if (this.stopTraversal) return;
if (this.postorderVisitor != null) this.postorderVisitor.Visit(localDefinition);
}
示例15: GetPdbFunctionFor
private PdbFunction GetPdbFunctionFor(ILocalDefinition localDefinition)
{
PdbFunction/*?*/ result = null;
foreach (ILocation location in localDefinition.Locations) {
MethodBodyLocation/*?*/ mbLocation = location as MethodBodyLocation;
if (mbLocation != null) {
this.pdbFunctionMap.TryGetValue(mbLocation.Document.MethodToken, out result);
break;
}
}
return result;
}