/** * Returns the matching character for the specified character. * * @param c a character occurring in a character pair * @return the matching character */ public char getMatching(char c) { for (int i= 0; i < fPairs.length; i += 2) { if (getStartChar(i) == c) return getEndChar(i); else if (getEndChar(i) == c) return getStartChar(i); } Assert.isTrue(false); return '\0'; }
/** * Creates a rule which will return the specified * token when either an entry or a brace string * is detected * * @param e Whether to detect an entry (true) or just a string (false) * @param token The token to be returned */ public BibBraceRule(boolean e, IToken token) { Assert.isNotNull(token); fToken = token; entry = e; }
/** * Creates a new string rule matcher. * * @param token The token to return on a successful match */ public BibStringRule(IToken token) { Assert.isNotNull(token); fToken = token; }
/** * Creates a rule which will return the specified * token when a BibTeX-entry special character is encountered * * @param token the token to be returned */ public BibSeparatorRule(IToken token) { Assert.isNotNull(token); fToken = token; }
/** * Creates a rule which will return the specified * token when a BibTeX-command starting with @ is detected * * @param token the token to be returned */ public BibCommandRule(IToken token) { Assert.isNotNull(token); fToken = token; }