01: /*
02: *Author: Chris Seguin
03: *
04: *This software has been developed under the copyleft
05: *rules of the GNU General Public License. Please
06: *consult the GNU General Public License for more
07: *details about use and distribution of this software.
08: */
09: package org.acm.seguin.pretty;
10:
11: import net.sourceforge.jrefactory.parser.Token;
12:
13: /**
14: * Parses a XDoclet javadoc comment tag
15: *
16: * @author Mike Atkinson
17: * @created June 22, 2003
18: * @since JRefactory 2.7.02
19: */
20: public class XDocletTokenizer extends Tokenizer {
21:
22: /**
23: * Constructor for the JavadocTokenizer object
24: *
25: * @paraminit Description of Parameter
26: */
27: public XDocletTokenizer(String init) {
28: super (init);
29: }
30:
31: /** Loads a particular word. */
32: protected void loadWord() {
33: int start = index;
34: boolean withinQuotes = false;
35:
36: while (true) {
37: if (index == last)
38: return;
39:
40: char c = value.charAt(index);
41:
42: if (!withinQuotes && c == '=') {
43: if (index == start) {
44: buffer.append(c);
45: index++;
46: }
47: return;
48: }
49: if (!withinQuotes && Character.isWhitespace(c))
50: return;
51: if (c == '\"')
52: withinQuotes = !withinQuotes;
53:
54: buffer.append(c);
55: index++;
56: }
57: }
58:
59: }
|