protected EntrySymbol( ISymbol containingSymbol, EntryBaseNode declaration, DiagnosticBag diagnostics) : base(containingSymbol, declaration) { Declaration = declaration; PublicationReference = declaration.PublicationId is not null ? new EntryPublicationReferenceSymbol(this, declaration, diagnostics) : null; Effects = LogicSymbol.CreateEffects(this, declaration, diagnostics); }
private static InfoLinkNode InfoLink(EntryBaseNode node, InfoLinkKind type, string id = null) { return(InfoLink( id: id ?? NewId(), name: node.Name, publicationId: node.PublicationId, page: node.Page, hidden: false, targetId: node.Id, type: type)); }
public EntryPublicationReferenceSymbol( EntrySymbol containingSymbol, EntryBaseNode declaration, DiagnosticBag diagnostics) { Declaration = declaration; if (Declaration.PublicationId is null) { // that's not what should happen, if publicationId is null, // the containing symbol should set its IPublicationRefernceSymbol property to null diagnostics.Add( ErrorCode.ERR_GenericError, Declaration.GetLocation(), ImmutableArray.Create <Symbol>(this)); } this.containingSymbol = containingSymbol; }
public static ImmutableArray <IEffectSymbol> CreateEffects( EntrySymbol containingSymbol, EntryBaseNode declaration, DiagnosticBag diagnostics) { return(CreateChildEffects().ToImmutableArray()); IEnumerable <IEffectSymbol> CreateChildEffects() { foreach (var item in declaration.Modifiers) { yield return(CreateEffect(containingSymbol, item, diagnostics)); } foreach (var item in declaration.ModifierGroups) { yield return(CreateEffect(containingSymbol, item, diagnostics)); } } }
internal IPublicationSymbol BindPublicationSymbol(EntryBaseNode node, DiagnosticBag diagnostics) => BindSimple <IPublicationSymbol, ErrorSymbols.ErrorPublicationSymbol>( node, diagnostics, node.PublicationId, LookupOptions.PublicationOnly);