Help making an automat...

Jonathan Neve <>
25 Mar 2000 02:37:23 -0500

          From comp.compilers

Related articles
Help making an automat... (Jonathan Neve) (2000-03-25)
Re: Help making an automat... (Andras Erdei) (2000-03-28)
| List of all articles for this month |

From: Jonathan Neve <>
Newsgroups: comp.theory,comp.compilers
Date: 25 Mar 2000 02:37:23 -0500
Organization: Microtec Communications
Distribution: inet
Keywords: lex

    I'm currently reading "Algorithms in C" by Robert , and I've been
reading about string matching, and so on rather recently. Come to a
practical problem similar to the ones talked about in the book, I
naturaly tried to imitate the methods presented there. However, my
problem is somewhat more complicated because, whereas the examples in
the book only searched for one string at a time, I'd like to be able to
check a whole list of keywords for possible match before proceding
futher in the file. I'd like to create an automat of the type:
-YES-> D?-YES--->MATCH!!
<-NO <-NO
for the keywords AND and ADD.
That is, I'd like the automat to check the first letter, and then fork
out to check all the possible keywords starting with that letter, and so
on recursively.

I guess it's probably not very difficult, but as I don't have much
experience doing such things yet, only theory, I don't quite see how to
go about it.

I'll be very grateful for all help! Thanks!!
Jonathan Neve.
[The usual approach is to treat the set of strings as a regular expression
and translate it to an NFA or DFA. -John]

Post a followup to this message

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