Solved

DFA In C++

Posted on 2010-09-13
6
1,301 Views
Last Modified: 2012-05-10
I need an implementation of the DFA
0
Comment
Question by:CreuLINUX
  • 3
  • 3
6 Comments
 
LVL 40

Accepted Solution

by:
evilrix earned 500 total points
ID: 33660949
I presume you are referring to a Deterministic finite-state Machine?

http://en.wikipedia.org/wiki/Deterministic_finite-state_machine

If so, take a look at the DFA implementation in PCRE.
http://www.pcre.org/

Specifically, pcre_dfa_exec.c
0
 

Author Comment

by:CreuLINUX
ID: 33661032
i need in c++ =/
0
 
LVL 40

Expert Comment

by:evilrix
ID: 33661044
>> i need in c++ =/

Are you just looking to learn how a state machine works or so you actually need some kind of library. It would really help if you provided is with some context.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:CreuLINUX
ID: 33661964
just need the source code
0
 
LVL 40

Expert Comment

by:evilrix
ID: 33662046
>> just need the source code
Without some background info I suspect you won't get much in the way of assistance. Asking for source code for "an implementation of the DFA" is pretty meaningless since there are many different types of DFA. DFA is just an engineering concept (a type of state machine, there are others) that can be used in many different ways and scenarios.

If you could just explain a little more about what you need it for it would allow us to point you in the right direction. If you don't want to that is also fine but you are likely to find the assistance you get is a little vague.

I am just trying to help you help us find you the best solution. If you have no wish to provide more information there is no need for you to reply to me :)
0
 

Author Comment

by:CreuLINUX
ID: 33662748
I need a "generic", I tell the initial state, final state, the
transitions and an input string.
Then he shows me the transitions and whether it was accepted or not ...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question