RuleBuilder (IElementType pairFirst, IElementType pairSecond, IElementType parent) { TokenSet parentSet = TokenSet.create(parent); RuleCondition before = new RuleCondition(parentSet, TokenSet.create(pairFirst), null); RuleCondition after = new RuleCondition(parentSet, null, TokenSet.create(pairSecond)); return new RuleBuilder(before, after); }