Generic sequence matching in Java

Rob van der Leek <rob@ricardis.tudelft.nl>
13 Aug 2004 17:35:25 -0400

          From comp.compilers

Related articles
Generic sequence matching in Java rob@ricardis.tudelft.nl (Rob van der Leek) (2004-08-13)
Re: Generic sequence matching in Java Burak.Emir@epfl.ch (Burak Emir) (2004-08-15)
Re: Generic sequence matching in Java liekweg@ipd.info.uni-karlsruhe.de (F. Liekweg) (2004-08-23)
Re: Generic sequence matching in Java robvanderleek@yahoo.com (Rob van der Leek) (2004-08-23)
| List of all articles for this month |
From: Rob van der Leek <rob@ricardis.tudelft.nl>
Newsgroups: comp.compilers
Date: 13 Aug 2004 17:35:25 -0400
Organization: Compilers Central
Keywords: Java, question
Posted-Date: 13 Aug 2004 17:35:25 EDT

Hi all,


I'm looking for a Java library that provides generic sequence matching.
For example, let's say I have a sequence of Java objects:


Object ol[] = { new A(), new A(), new B(), new C() };


and would like to extract all subsequences from this sequence that start
with one or more objects of type A followed by an object of type B. I
consider this analogue to a textual regular expression "(a+)b" on an
input of "aabc".


I could think of a very simple syntax for such a library, say X, as:


x.X matcher = new x.X();
matcher.expression(
new Object[] {
new x.OneOrMore(new A()),
new B()
}
};
matcher.match(ol);


I know such a tool could be implemented using a simple FSA generator
but were curious if you know of any existing implementations. It must
be a pure Java solution.


Regards,
--
Rob van der Leek | rob(at)ricardis(dot)tudelft(dot)nl


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.