1 19 package org.netbeans.tax.decl.parser; 20 21 import org.netbeans.tax.TreeElementDecl; 22 import org.netbeans.tax.decl.*; 23 24 25 public abstract class ListParser extends MultiplicityParser implements ModelParser { 26 27 30 public TreeElementDecl.ContentType parseModel (ParserReader s) { 31 32 ChildrenType type = createType (s); 33 34 type.addType (new ContentParticleParser ().parseModel (s)); 36 37 while ( !!! s.trim ().startsWith (")")) { 39 if (s.startsWith (getSeparator ()) ) { 40 type.addType (new ContentParticleParser ().parseModel (s)); 41 42 } else { 43 new RuntimeException ("Error in " + this); break; 46 } 47 } 48 49 return type; } 51 52 54 protected abstract ChildrenType createType (ParserReader model); 55 56 58 protected abstract String getSeparator (); 59 60 62 protected boolean isEndMark (int ch) { 63 switch (ch) { 64 case ')': case -1: 65 return true; 66 default: 67 return false; 68 } 69 } 70 71 } 72 | Popular Tags |