Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

DFA In C++

Posted on 2010-09-13
6
Medium Priority
?
1,316 Views
Last Modified: 2012-05-10
I need an implementation of the DFA
0
Comment
Question by:CreuLINUX
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 40

Accepted Solution

by:
evilrix earned 2000 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

705 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