X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgnu%2Fregexp%2FRETokenChar.java;fp=src%2Fgnu%2Fregexp%2FRETokenChar.java;h=822273e1ece6937fd4afbe4c70fab190236c70fe;hb=30a9ea29e92d4d079cd71b0ee8cdf2b2fd70c48f;hp=0000000000000000000000000000000000000000;hpb=52ffc2a48fc74d013ae7fa401d9d0d405543c38e;p=org.ibex.core.git diff --git a/src/gnu/regexp/RETokenChar.java b/src/gnu/regexp/RETokenChar.java new file mode 100644 index 0000000..822273e --- /dev/null +++ b/src/gnu/regexp/RETokenChar.java @@ -0,0 +1,72 @@ +/* + * gnu/regexp/RETokenChar.java + * Copyright (C) 1998-2001 Wes Biggs + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +package gnu.regexp; + +final class RETokenChar extends REToken { + private char[] ch; + private boolean insens; + + RETokenChar(int subIndex, char c, boolean ins) { + super(subIndex); + ch = new char [1]; + ch[0] = (insens = ins) ? Character.toLowerCase(c) : c; + } + + int getMinimumLength() { + return ch.length; + } + + boolean match(CharIndexed input, REMatch mymatch) { + int z = ch.length; + char c; + for (int i=0; i