3 public class ASTNode : Container
11 public class ASTList : ASTNode
13 List<ASTNode> list { };
15 IteratorPointer GetFirst() { return list ? list.GetFirst() : 0; }
16 IteratorPointer GetLast() { return list ? list.GetLast() : 0; }
17 IteratorPointer GetPrev(IteratorPointer pointer) { return list ? list.GetPrev(pointer) : 0; }
18 IteratorPointer GetNext(IteratorPointer pointer) { return list ? list.GetNext(pointer) : 0; }
19 bool SetData(IteratorPointer pointer, D data) { return list ? list.SetData(pointer, (ASTNode)data) : 0; }
20 D GetData(IteratorPointer pointer) { return list ? list.GetData(pointer) : (D)0; }
21 IteratorPointer GetAtPosition(I pos, bool create, bool * justAdded) { return list ? list.GetAtPosition((int)pos, create, justAdded) : 0; }
22 IteratorPointer Insert(Link after, T value) { return list ? list.Insert(after, (void *)value) : 0; }
23 IteratorPointer Add(T value) { return list ? list.Add((void *)value) : 0; }
24 void Remove(IteratorPointer it) { if(list) list.Remove(it); }
25 void Move(IteratorPointer it, IteratorPointer after) { if(list) list.Move(it, after); }
26 void RemoveAll() { if(list) list.RemoveAll(); }
27 void Copy(Container<T> source) { if(list) list.Copy(source); }
28 IteratorPointer Find(D value) { return list ? list.Find((void *)value) : 0; }
29 void FreeIterator(IteratorPointer it) { if(list) list.FreeIterator(it); }
30 int GetCount() { return list ? list.GetCount() : 0; }
31 void Free() { if(list) list.Free(); }
32 void Delete(IteratorPointer i) { if(list) list.Delete(i); }
35 virtual void printSep()
42 Iterator<ASTNode> it { list };
46 if(list.GetNext(it.pointer))
51 Container ::parse(subclass(Container) c, ASTNode parser(), char sep)
53 Container<ASTNode> list = null;
59 if(!list) list = eInstance_New(c);
63 if(sep && nextToken.type == sep)
65 else if(sep || nextToken.type == '}' || !nextToken.type)