/[svn]/jlscp/trunk/src/org/linuxsampler/lscp/Parser.java
ViewVC logotype

Diff of /jlscp/trunk/src/org/linuxsampler/lscp/Parser.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1392 by iliev, Sun Sep 16 23:15:57 2007 UTC revision 1393 by iliev, Sun Oct 7 20:29:41 2007 UTC
# Line 158  public final class Parser { Line 158  public final class Parser {
158          }          }
159                    
160          /**          /**
          * Parses a comma separated list whose items are not encapsulated into apostrophes.  
          * @param list The comma separated list.  
          * @return A <code>String</code> array containing all items in the list.  
          * @throws LscpException if the list is broken.  
          */  
         protected static String[]  
         parseStringList(String list) throws LscpException {  
                 list = removeQuotation(list);  
                 return parseList(list);  
         }  
           
         /**  
161           * Parses a comma separated string list, which elements contains escaped sequences.           * Parses a comma separated string list, which elements contains escaped sequences.
162           * @param list The list to parse.           * @param list The list to parse.
163           * @return A <code>String</code> array containing all items in the list.           * @return A <code>String</code> array containing all items in the list.
# Line 226  public final class Parser { Line 214  public final class Parser {
214           * @throws LscpException if the list is broken.           * @throws LscpException if the list is broken.
215           */           */
216          protected static String[]          protected static String[]
217          parseQuotedStringList(String list) throws LscpException {          parseStringList(String list) throws LscpException {
218                  return parseQuotedStringList(list, ',');                  return parseStringList(list, ',');
219          }          }
220                    
221          /**          /**
# Line 238  public final class Parser { Line 226  public final class Parser {
226           * @throws LscpException if the list is broken.           * @throws LscpException if the list is broken.
227           */           */
228          protected static String[]          protected static String[]
229          parseQuotedStringList(String list, char separator) throws LscpException {          parseStringList(String list, char separator) throws LscpException {
230                  if(list == null || list.length() == 0) return new String[0];                  if(list == null || list.length() == 0) return new String[0];
231                  int q1 = 0, q2 = 0;                  int q1 = 0, q2 = 0;
232                  Vector<String> v = new Vector<String>();                  Vector<String> v = new Vector<String>();
# Line 269  public final class Parser { Line 257  public final class Parser {
257                  String[][] s2S;                  String[][] s2S;
258                  if(!list.startsWith("''") && !list.startsWith("\"\"")) {                  if(!list.startsWith("''") && !list.startsWith("\"\"")) {
259                          s2S = new String[1][];                          s2S = new String[1][];
260                          s2S[0] = parseQuotedStringList(list);                          s2S[0] = parseStringList(list);
261                          return s2S;                          return s2S;
262                  }                  }
263                                                    
# Line 286  public final class Parser { Line 274  public final class Parser {
274                  }                  }
275                                    
276                  s2S = new String[v.size()][];                  s2S = new String[v.size()][];
277                  for(i = 0; i < v.size(); i++) s2S[i] = parseQuotedStringList(v.get(i));                  for(i = 0; i < v.size(); i++) s2S[i] = parseStringList(v.get(i));
278                                    
279                  return s2S;                  return s2S;
280          }          }

Legend:
Removed from v.1392  
changed lines
  Added in v.1393

  ViewVC Help
Powered by ViewVC