예제 #1
0
 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);
 }
예제 #2
0
 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;
 }
예제 #4
0
    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));
            }
        }
    }
예제 #5
0
파일: Binder.cs 프로젝트: BSData/phalanx
 internal IPublicationSymbol BindPublicationSymbol(EntryBaseNode node, DiagnosticBag diagnostics) =>
 BindSimple <IPublicationSymbol, ErrorSymbols.ErrorPublicationSymbol>(
     node, diagnostics, node.PublicationId, LookupOptions.PublicationOnly);