Ejemplo n.º 1
0
        /// <summary>
        /// Creates an aggregate builder that builds the source of the pattern.
        /// </summary>
        /// <returns>Aggregate builder.</returns>
        public AggregateBuilder Aggregate()
        {
            AssertSingleSource();
            var builder = new AggregateBuilder(Declaration.Type, Scope);

            _sourceBuilder = builder;
            return(builder);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates an aggregate builder that builds the source of the pattern.
        /// </summary>
        /// <returns>Aggregate builder.</returns>
        public AggregateBuilder SourceAggregate()
        {
            if (_sourceBuilder != null)
            {
                throw new InvalidOperationException("Pattern can only have a single source");
            }

            SymbolTable scope = Scope.New();

            var builder = new AggregateBuilder(Declaration.Type, scope);

            _sourceBuilder = builder;

            return(builder);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets an aggregate builder as the source of the pattern element.
 /// </summary>
 /// <param name="builder">Element builder to set as the source.</param>
 public void Aggregate(AggregateBuilder builder)
 {
     AssertSingleSource();
     builder.ResultType(Declaration.Type);
     _sourceBuilder = builder;
 }