001package gudusoft.gsqlparser.nodes; 002 003/** 004 * List of Oracle 26 FOR LOOP iteration controls. 005 * Supports multiple comma-separated iteration controls in a single FOR LOOP: 006 * FOR i IN 1..3, REVERSE i+1..i+10, 51..55 LOOP ... END LOOP; 007 */ 008public class TIterationControlList extends TParseTreeNodeList<TIterationControl> { 009 010 public TIterationControlList() { 011 } 012 013 public void addIterationControl(TIterationControl item) { 014 addElement(item); 015 } 016 017 public void addIterationControlToHead(TIterationControl item) { 018 insertElementAt(item, 0); 019 } 020 021 public TIterationControl getIterationControl(int position) { 022 if (position < size()) { 023 return elementAt(position); 024 } else { 025 return null; 026 } 027 } 028 029 void addParseTreeNode(Object arg1) { 030 addIterationControl((TIterationControl) arg1); 031 } 032 033 /** 034 * Initialize with two iteration controls (from grammar). 035 */ 036 public void init(Object arg1, Object arg2) { 037 addIterationControl((TIterationControl) arg1); 038 addIterationControl((TIterationControl) arg2); 039 } 040}