public boolean match(MatcherContext context) { context.createNode(); return true; }
@Override public boolean match(MatcherContext<Node> context) { char current = context.getCurrentChar(); if (Character.isJavaIdentifierPart(current)) { context.advanceIndex(); context.createNode(); return true; } return false; } }
@Override public boolean match(MatcherContext<Node> context) { char current = context.getCurrentChar(); if (Character.isJavaIdentifierStart(current)) { context.advanceIndex(); context.createNode(); return true; } return false; } }
@Override public boolean match(MatcherContext<Node> context) { char current = context.getCurrentChar(); if (Character.isJavaIdentifierStart(current)) { context.advanceIndex(); context.createNode(); return true; } return false; } }
@Override public boolean match(MatcherContext<Node> context) { char current = context.getCurrentChar(); if (Character.isJavaIdentifierPart(current)) { context.advanceIndex(); context.createNode(); return true; } return false; } }
public boolean match(MatcherContext context) { subMatcher.getSubContext(context).runMatcher(); context.createNode(); return true; }
public boolean match(MatcherContext context) { char c = context.getCurrentChar(); if (c != charLow && c != charUp) return false; context.advanceIndex(1); context.createNode(); return true; }
public boolean match(MatcherContext context) { if (context.getCurrentChar() != character) return false; context.advanceIndex(1); context.createNode(); return true; }
@SuppressWarnings( {"ForLoopReplaceableByForEach"}) public boolean match(MatcherContext context) { List<Matcher> children = getChildren(); int size = children.size(); for (int i = 0; i < size; i++) { Matcher matcher = children.get(i); if (matcher.getSubContext(context).runMatcher()) { context.createNode(); return true; } } return false; }
public boolean match(MatcherContext context) { char c = context.getCurrentChar(); if (c < cLow || c > cHigh) return false; context.advanceIndex(1); context.createNode(); return true; }
public boolean match(MatcherContext context) { switch (context.getCurrentChar()) { case Chars.DEL_ERROR: case Chars.INS_ERROR: case Chars.RESYNC: case Chars.RESYNC_START: case Chars.RESYNC_END: case Chars.RESYNC_EOI: case Chars.EOI: return false; } context.advanceIndex(1); context.createNode(); return true; }
@Override public final <V> boolean match(MatcherContext<V> context) { if (!acceptChar(context.getCurrentChar())) { return false; } context.advanceIndex(1); context.createNode(); return true; }
public boolean match(MatcherContext context) { if (!characters.contains(context.getCurrentChar())) return false; context.advanceIndex(1); context.createNode(); return true; }
public boolean match(MatcherContext context) { Object valueStackSnapshot = context.getValueStack().takeSnapshot(); List<Matcher> children = getChildren(); int size = children.size(); for (int i = 0; i < size; i++) { Matcher matcher = children.get(i); // remember the current index in the context, so we can access it for building the current follower set context.setIntTag(i); if (!matcher.getSubContext(context).runMatcher()) { // rule failed, so invalidate all stack actions the rule might have done context.getValueStack().restoreSnapshot(valueStackSnapshot); return false; } } context.createNode(); return true; }
@Override public boolean match(MatcherContext context) { if (!context.fastStringMatching()) { return super.match(context); } if (!context.getInputBuffer().test(context.getCurrentIndex(), characters)) return false; context.advanceIndex(characters.length); context.createNode(); return true; } }
public boolean match(MatcherContext context) { checkArgNotNull(context, "context"); int lastIndex = context.getCurrentIndex(); while (subMatcher.getSubContext(context).runMatcher()) { int currentLocation = context.getCurrentIndex(); if (currentLocation == lastIndex) { throw new GrammarException("The inner rule of ZeroOrMore rule '%s' must not allow empty matches", context.getPath()); } lastIndex = currentLocation; } context.createNode(); return true; }
public boolean match(MatcherContext context) { boolean matched = subMatcher.getSubContext(context).runMatcher(); if (!matched) return false; // collect all further matches as well int lastIndex = context.getCurrentIndex(); while (subMatcher.getSubContext(context).runMatcher()) { int currentIndex = context.getCurrentIndex(); if (currentIndex == lastIndex) { throw new GrammarException("The inner rule of OneOrMore rule '%s' must not allow empty matches", context.getPath()); } lastIndex = currentIndex; } context.createNode(); return true; }
context.createNode(); return true;