本文整理汇总了C#中ITypeDeclaration类的典型用法代码示例。如果您正苦于以下问题:C# ITypeDeclaration类的具体用法?C# ITypeDeclaration怎么用?C# ITypeDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITypeDeclaration类属于命名空间,在下文中一共展示了ITypeDeclaration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BinaryFormula
protected internal BinaryFormula(NodeType nodeType, IFormula left, IFormula right, ITypeDeclaration type, IMethodDeclaration method, IFormula parent)
: base(nodeType, type, parent)
{
Left = left;
Method = method;
Right = right;
}
示例2: ConditionalFormula
protected internal ConditionalFormula(IFormula test, IFormula ifTrue, IFormula ifFalse, ITypeDeclaration type, IFormula parent)
: base(NodeType.Conditional, type, parent)
{
Test = test;
IfTrue = ifTrue;
IfFalse = ifFalse;
}
示例3: MarkTypeAsUsed
public void MarkTypeAsUsed(ITypeDeclaration declaration)
{
SetConstructorsState(declaration.DeclaredElement, UsageState.USED_MASK | UsageState.CANNOT_BE_PRIVATE |
UsageState.CANNOT_BE_INTERNAL | UsageState.CANNOT_BE_PROTECTED);
collectUsagesStageProcess.SetElementState(declaration.DeclaredElement, UsageState.ACCESSED);
}
示例4: EqualFormulaRef
protected internal EqualFormulaRef(IFormulaRef left, IFormulaRef right, ITypeDeclaration type, IMethodDeclaration method, IFormulaRef parent)
: base(left, right, type, method, parent)
{
this.parent = parent;
this.left = left;
this.right = right;
}
示例5: TryConvertTypeDeclaration
public static IExpression TryConvertTypeDeclaration(ITypeDeclaration td, bool ignoreInnerDeclaration = false)
{
if (td.InnerDeclaration == null || ignoreInnerDeclaration)
{
if (td is IdentifierDeclaration)
{
var id = td as IdentifierDeclaration;
if (id.Id == null)
return null;
return new IdentifierExpression(id.Id) { Location = id.Location, EndLocation = id.EndLocation };
}
if (td is TemplateInstanceExpression)
return td as IExpression;
return null;
}
var pfa = new PostfixExpression_Access{
PostfixForeExpression = TryConvertTypeDeclaration(td.InnerDeclaration),
AccessExpression = TryConvertTypeDeclaration(td, true)
};
if (pfa.PostfixForeExpression == null)
return null;
return pfa;
}
示例6: DemangleAndResolve
public static AbstractType DemangleAndResolve(string mangledString, ResolutionContext ctxt, out ITypeDeclaration qualifier)
{
bool isCFunction;
Demangler.Demangle(mangledString, ctxt, out qualifier, out isCFunction);
// Seek for C functions | Functions that have no direct module association (e.g. _Dmain)
if(qualifier is IdentifierDeclaration && qualifier.InnerDeclaration == null)
{
var id = (qualifier as IdentifierDeclaration).Id;
return Resolver.ASTScanner.NameScan.ScanForCFunction(ctxt, id, isCFunction);
}
bool seekCtor = false;
if(qualifier is IdentifierDeclaration)
{
var id = (qualifier as IdentifierDeclaration).Id;
if((seekCtor = (id == DMethod.ConstructorIdentifier)) || id == "__Class" || id =="__ModuleInfo")
qualifier = qualifier.InnerDeclaration;
}
var resSym = TypeDeclarationResolver.ResolveSingle(qualifier,ctxt);
if(seekCtor && resSym is UserDefinedType)
{
var ctor = (resSym as TemplateIntermediateType).Definition[DMethod.ConstructorIdentifier].FirstOrDefault();
if(ctor!= null)
resSym = new MemberSymbol(ctor as DNode, null, null);
}
return resSym;
}
示例7: HandleDecl
public bool HandleDecl(TemplateTypeParameter p ,ITypeDeclaration td, ISemantic rr)
{
if (td is IdentifierDeclaration)
return HandleDecl(p,(IdentifierDeclaration)td, rr);
//HACK Ensure that no information gets lost by using this function
// -- getting a value but requiring an abstract type and just extract it from the value - is this correct behaviour?
var at = AbstractType.Get(rr);
if (td is ArrayDecl)
return HandleDecl(p,(ArrayDecl)td, DResolver.StripMemberSymbols(at) as AssocArrayType);
else if (td is DTokenDeclaration)
return HandleDecl((DTokenDeclaration)td, at);
else if (td is DelegateDeclaration)
return HandleDecl(p, (DelegateDeclaration)td, DResolver.StripMemberSymbols(at) as DelegateType);
else if (td is PointerDecl)
return HandleDecl(p, (PointerDecl)td, DResolver.StripMemberSymbols(at) as PointerType);
else if (td is MemberFunctionAttributeDecl)
return HandleDecl(p,(MemberFunctionAttributeDecl)td, at);
else if (td is TypeOfDeclaration)
return HandleDecl((TypeOfDeclaration)td, at);
else if (td is VectorDeclaration)
return HandleDecl((VectorDeclaration)td, at);
else if (td is TemplateInstanceExpression)
return HandleDecl(p,(TemplateInstanceExpression)td, at);
return false;
}
示例8: Demangle
public static AbstractType Demangle(string mangledString, ResolutionContext ctxt, out ITypeDeclaration qualifier, out bool isCFunction)
{
if(string.IsNullOrEmpty(mangledString))
throw new ArgumentException("input string must not be null or empty!");
if (!mangledString.StartsWith("_D"))
{
isCFunction = true;
if (mangledString.StartsWith ("__D"))
mangledString = mangledString.Substring (1);
// C Functions
else if (mangledString.StartsWith ("_")) {
qualifier = new IdentifierDeclaration (mangledString.Substring (1));
return null;
}
}
//TODO: What about C functions that start with 'D'?
isCFunction = false;
var dmng = new Demangler(mangledString) { ctxt = ctxt };
return dmng.MangledName(out qualifier);
}
示例9: Demangle
public static AbstractType Demangle(string mangledString, out ITypeDeclaration qualifier, out bool isCFunction)
{
if(string.IsNullOrEmpty(mangledString))
throw new ArgumentException("строка ввода должна не быть пустой или null!");
if (!mangledString.StartsWith("_D"))
{
isCFunction = true;
if (mangledString.StartsWith ("__D"))
mangledString = mangledString.Substring (1);
// C Functions
else if (mangledString.StartsWith ("_")) {
qualifier = new IdentifierDeclaration (mangledString.Substring (1));
return null;
}
}
//TODO: What about C functions that start with 'D'?
isCFunction = false;
var dmng = new Demangler(mangledString);
return dmng.MangledName(out qualifier);
}
示例10: FieldDeclaration
internal FieldDeclaration(string name, Declaration declaringType, ITypeDeclaration type)
: base(name,declaringType)
{
if (type==null)
throw new ArgumentNullException("type");
this.type = type;
}
示例11: EventDeclaration
internal EventDeclaration(string name, Declaration declaringType, ITypeDeclaration type)
: base(name,declaringType)
{
if (type==null)
throw new ArgumentNullException("type");
this.type = type;
this.Attributes = MemberAttributes.Public;
}
示例12: ObjectCreationExpression
public ObjectCreationExpression(ITypeDeclaration type, params Expression[] args)
{
if (type==null)
throw new ArgumentNullException("type");
this.type = type;
this.args.AddRange(args);
}
示例13: IndexerDeclaration
internal IndexerDeclaration(
Declaration declaringType,
ITypeDeclaration returnType)
: base("Item",declaringType)
{
this.signature.ReturnType = returnType;
this.Attributes = MemberAttributes.Public;
}
示例14: TypeData
public TypeData (ITypeDeclaration typeDecl)
{
declaration = typeDecl;
Type = declaration.Type;
col = declaration.col;
InputKnob = ResourceManager.GetTintedTexture (declaration.InputKnob_TexPath, col);
OutputKnob = ResourceManager.GetTintedTexture (declaration.OutputKnob_TexPath, col);
}
示例15: TypeData
public TypeData (ITypeDeclaration typeDecl)
{
Declaration = typeDecl;
Type = Declaration.Type;
Col = Declaration.Col;
InputKnob = ResourceManager.GetTintedTexture (Declaration.InputKnobTexPath, Col);
OutputKnob = ResourceManager.GetTintedTexture (Declaration.OutputKnobTexPath, Col);
}