001 /*
002 * To change this template, choose Tools | Templates
003 * and open the template in the editor.
004 */
005
006 package org.util.xml.parse;
007
008 import java.util.ArrayList;
009 import org.util.xml.parse.ElementParser;
010
011 /**
012 *
013 * @author masaru
014 */
015 public abstract class ParseElement {
016
017
018 public String getDescription() {
019 return "parse element";
020 }
021 public abstract boolean match(char c);
022 public abstract int parse(int next,ElementParser parser) throws Exception ;
023 public String getReturnValue(){return null;}
024 public void listDependentParser(ArrayList<ParseElement> list){}
025
026 /**
027 * return true if input char is SP, HT, CR or LF.
028 * @return (c==SP || c==HT || c==CR || c==LF)
029 */
030 public static boolean isSpace(int c) {
031
032 return (c==0x20) || (c==0x09) || (c==0x0d) || (c==0x0a);
033 }
034 }