//......................................... public void add(int lawnum,string lawContent) { try { LawsNode thisNode=null; LawsNode temp=first; if(first==null) { first=new LawsNode(lawnum,this); thisNode=first; } else { while(temp.next!=null) temp=temp.next; temp.next=new LawsNode(lawnum,this); thisNode=temp.next; } string []contents=lawContent.Split(' '); bool isFirst=true; foreach(string s in contents) { if(isFirst) { isFirst=false; continue; } if(s.Length==0) continue; if(s[0]=='#') thisNode.parts.add(s.Substring(1,s.Length-1),false); else thisNode.parts.add(s,true); } lawsCount++; } catch(Exception e1) { MessageBox.Show("in laws.add : "+e1.Message); } }
//............................... public Laws(nonTerminalNode parentNonTerm) { first=null; lawsCount=0; this.parent=parentNonTerm; }
public LawsNode(int lawnum,Laws law) { this.parts=new Parts(law); this.item.lawNum = lawnum; next=null; }