Lexer(CharSequence seq) { this(new CharStream(seq)); }
int getIndex() { return stream.getIndex(); }
public boolean hasNext(char c) { return has(0, c); }
CharStream stream = new CharStream(s); Lexer lexer = new Lexer(stream); REParser parser = new REParser(lexer); parser.parse(); assertEquals(s.length(), stream.getIndex()); if (lexer.hasNext()) { throw new SyntaxException();
boolean hasNext() throws SyntaxException { if (next == null) { if (stream.hasNext()) { Kind kind; char c = stream.next(); switch (c) { case '^': case '-': if (ccDepth > 0) { if (stream.hasNext(']')) { kind = Kind.LITERAL; token = "-"; if (stream.next('^')) { token = "[^"; if (stream.next('&')) { kind = Kind.CC_AND; token = "&&"; if (stream.hasNext()) { c = stream.peek(); if (c == '0') { StringBuilder sb = new StringBuilder().append(stream.next()); Character matched = null; while (true) { if (stream.hasNext()) { sb.append(stream.peek()); Matcher matcher = OCTAL_PATTERN.matcher(sb);
boolean isDone() { return !stream.hasNext(); }
void reset() { this.stream.reset(); this.ccDepth = 0; this.next = null; this.previous = null; this.token = null; }
public Character peek() { return peek(0); }
CharStream stream = new CharStream(s); Lexer lexer = new Lexer(stream); REParser parser = new REParser(lexer); parser.parse(); assertEquals(s.length(), stream.getIndex()); if (lexer.hasNext()) { throw new SyntaxException();
boolean hasNext() throws SyntaxException { if (next == null) { if (stream.hasNext()) { Kind kind; char c = stream.next(); switch (c) { case '^': case '-': if (ccDepth > 0) { if (stream.hasNext(']')) { kind = Kind.LITERAL; token = "-"; if (stream.next('^')) { token = "[^"; if (stream.next('&')) { kind = Kind.CC_AND; token = "&&"; if (stream.hasNext()) { c = stream.peek(); if (c == '0') { StringBuilder sb = new StringBuilder().append(stream.next()); Character matched = null; while (true) { if (stream.hasNext()) { sb.append(stream.peek()); Matcher matcher = OCTAL_PATTERN.matcher(sb);
boolean isDone() { return !stream.hasNext(); }
void reset() { this.stream.reset(); this.ccDepth = 0; this.next = null; this.previous = null; this.token = null; }
public Character peek() { return peek(0); }
int getIndex() { return stream.getIndex(); }
Lexer(CharSequence seq) { this(new CharStream(seq)); }
public char next() throws NoSuchElementException { if (hasNext()) { return s.charAt(index++); } else { throw new NoSuchElementException(); } } }
public boolean hasNext() { return has(0); }
public char next() throws NoSuchElementException { if (hasNext()) { return s.charAt(index++); } else { throw new NoSuchElementException(); } } }
public boolean hasNext(char c) { return has(0, c); }
public boolean hasNext() { return has(0); }