Beispiel #1
0
        public CharacterCategory(TaskMaster task_master, SourceReference source_ref,
				Context context, Frame self, Frame container)
            : base(task_master)
        {
            this.source_reference = source_ref;
            this.context = context;
            this.container = self;
        }
Beispiel #2
0
        public DbQuery(TaskMaster task_master, SourceReference source_ref,
				Context context, Frame self, Frame container)
            : base(task_master)
        {
            this.source_ref = source_ref;
            this.context = context;
            this.self = self;
        }
Beispiel #3
0
 /**
  * Conjoin two contexts, placing all the frames of the provided context after
  * all the frames in the original context.
  */
 public static Context Append(Context original, Context new_tail)
 {
     if (original == null) {
         throw new InvalidOperationException("Cannot append to null context.");
     }
     if (new_tail == null || original == new_tail) {
         return original;
     }
     int filter = 0;
     var list = new List<Frame>(original.Length + new_tail.Length);
     foreach (var frame in original.frames) {
         list.Add(frame);
         filter |= frame.GetHashCode();
     }
     foreach (var frame in new_tail.frames) {
         int hash = frame.GetHashCode();
         if ((hash & filter) != hash || !list.Contains(frame)) {
             list.Add(frame);
             filter |= hash;
         }
     }
     return new Context(list);
 }
Beispiel #4
0
        public StringToCodepoints(TaskMaster task_master, SourceReference source_ref,
				Context context, Frame self, Frame container)
            : base(task_master)
        {
            this.source_reference = source_ref;
            this.context = context;
            this.container = self;
        }
Beispiel #5
0
        public ParseInt(TaskMaster task_master, SourceReference source_ref,
				Context context, Frame self, Frame container)
            : base(task_master)
        {
            this.source_reference = source_ref;
            this.context = context;
        }
Beispiel #6
0
        public ParseDouble(TaskMaster master, SourceReference source_ref,
				Context context, Frame self, Frame container)
        {
            this.master = master;
            this.source_reference = source_ref;
            this.context = context;
        }
Beispiel #7
0
        public Escape(TaskMaster master, SourceReference source_ref,
				Context context, Frame self, Frame container)
        {
            this.master = master;
                this.source_ref = source_ref;
                this.context = context;
                this.self = self;
        }
Beispiel #8
0
 public static Context Prepend(Frame head, Context tail)
 {
     if (head == null) {
         throw new InvalidOperationException("Cannot prepend a null frame to a context.");
     }
     var list = new List<Frame>(tail == null ? 1 : (tail.Length + 1));
     list.Add(head);
     if (tail != null) {
         list.AddRange(tail.frames.Where(frame => head != frame));
     }
     return new Context(list);
 }
Beispiel #9
0
 public Template(SourceReference source_ref, Context context, Frame container)
 {
     SourceReference = source_ref;
     Context = context;
     Container = container;
 }
Beispiel #10
0
        public static Frame Through(TaskMaster task_master, long id, SourceReference source_ref, long start, long end,
			Context context, Frame container)
        {
            var result = new Frame(task_master, id, source_ref, context, container);
            if (end < start)
                return result;
            for (long it = 0; it <= (end - start); it++) {
                result[TaskMaster.OrdinalNameStr(it + 1)] = start + it;
            }
            return result;
        }
Beispiel #11
0
 public Frame(TaskMaster task_master, long id, SourceReference source_ref, Context context, Frame container)
 {
     this.task_master = task_master;
     SourceReference = source_ref;
     Context = Context.Prepend(this, context);
     Container = container ?? this;
     Id = TaskMaster.OrdinalName(id);
 }