Exemple #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);
 }
Exemple #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;
 }
Exemple #3
0
 internal void AddStateDomain(ModRef mod, bool addLast = true)
 {
     Contract.Requires(mod != null);
     if (addLast)
     {
         stateDomains.AddLast(mod);
     }
     else
     {
         stateDomains.AddFirst(mod);
     }
 }
Exemple #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);
     }
 }
Exemple #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);
        }
Exemple #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;
 }