public int size; //количество элементво в таблице public List() { head=null; end=null; position=-1; size=0; }
public void add(int pos, int tab)//для анализатора { Node buf = new Node(pos, tab); buf.next = null; if (head == null) head = end = buf; else end.next = buf; end = buf; size++; }
public void add(string M, string A) { Node buf = new Node(M,A); buf.next = null; if (head == null) head = end = buf; else end.next = buf; end = buf; position++; size++; }
public Node[] getData ()//получить массив данных { Node buf = head; Node[] masBuf = new Node[size]; int i = 0; while (buf != null) { masBuf[i] = buf; buf = buf.next; i++; } return masBuf; }
public void delete() { head = null; end = null; size = 0; position = -1; }
public string pop() { Node buf = head; head = head.next; return buf.Data; }