Ejemplo n.º 1
0
 internal ModApply(Span span, ModRef modref)
     : base(span)
 {
     Contract.Requires(modref != null);
     Module = modref;
     args   = new LinkedList <Node>();
     Args   = new ImmutableCollection <Node>(args);
 }
Ejemplo n.º 2
0
 private ModRef(ModRef n, bool keepCompilerData)
     : base(n.Span)
 {
     Name           = n.Name;
     Rename         = n.Rename;
     Location       = n.Location;
     cachedHashCode = n.cachedHashCode;
     CompilerData   = keepCompilerData ? n.CompilerData : null;
 }
Ejemplo n.º 3
0
 internal void AddStateDomain(ModRef mod, bool addLast = true)
 {
     Contract.Requires(mod != null);
     if (addLast)
     {
         stateDomains.AddLast(mod);
     }
     else
     {
         stateDomains.AddFirst(mod);
     }
 }
Ejemplo n.º 4
0
 internal void AddCompose(ModRef modRef, bool addLast = true)
 {
     Contract.Requires(modRef != null);
     Contract.Requires(ComposeKind != ComposeKind.None);
     if (addLast)
     {
         includes.AddLast(modRef);
     }
     else
     {
         includes.AddFirst(modRef);
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// DO NOT call directly. Only used by the parser.
        /// </summary>
        internal Model(Span span, string name, bool isPartial)
            : base(span)
        {
            Contract.Requires(!string.IsNullOrWhiteSpace(name));

            IsPartial   = isPartial;
            Name        = name;
            Domain      = new ModRef(span, "?", null, null);
            ComposeKind = ComposeKind.None;

            includes     = new LinkedList <ModRef>();
            Compositions = new ImmutableCollection <ModRef>(includes);

            contracts = new LinkedList <ContractItem>();
            Contracts = new ImmutableCollection <ContractItem>(contracts);

            facts  = new LinkedList <ModelFact>();
            Facts  = new ImmutableCollection <ModelFact>(facts);
            Config = new Config(span);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// DO NOT USE - Mutating operation; only called by parser.
 /// </summary>
 /// <param name="modRef"></param>
 internal void SetDomain(ModRef modRef)
 {
     Contract.Requires(modRef != null);
     Domain = modRef;
 }