Mar 23, 2016 at 2:57am Mar 23, 2016 at 2:57am UTC
I'm a c# developer and i'm trying develop a finite state automata in c++ but the member function chaining is causing compilation never ends.
The project can be found in my GitHub
https://github.com/michael-silva/fsa-cpp in the test.cpp file if i reduce the number of member functions chaining the compilation runs, however more calls cause compilation never ends.
Last edited on Mar 23, 2016 at 11:44am Mar 23, 2016 at 11:44am UTC
Mar 23, 2016 at 4:17am Mar 23, 2016 at 4:17am UTC
Hi,
Welcome to cplusplus :+)
Unfortunately, your linked 404'd.
Not that I know anything about your problem, I just mention this so you may get help from others :+)
Good Luck !!
Mar 23, 2016 at 6:07am Mar 23, 2016 at 6:07am UTC
The link got the `,' symbol
I can compile test.cpp with gcc 5.3 and clang 3.7 in less than 2 seconds.
> however more calls cause compilation never ends.
¿do I need to do something in order to reproduce your issue?
I'd rather not.
Mar 23, 2016 at 11:57am Mar 23, 2016 at 11:57am UTC
I'm using gcc 5.3 and when I try compiling with command below never ends
g++ -static -libstdc++ -std=c++14 "test.cpp" -o "test"
.
If i compile this code works.
1 2 3 4 5 6 7 8 9 10 11
auto state2 = FiniteStateAutomata::Deterministic<char >()
.Alphabet('0' , '1' , '-' , '.' )
.On('1' ).SetValues("123456789" )
.States()
.When('0' ).To(DOT)
.When('1' ).To(DOT)
.When('-' ).To(N1)
.On(N1)
.When('1' ).To(DOT)
.On(DOT).Accept()
.When('.' ).To(N2);
But if i add more calls the compilation don't finish.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
auto state2 = FiniteStateAutomata::Deterministic<char >()
.Alphabet('0' , '1' , '-' , '.' )
.On('1' ).SetValues("123456789" )
.States()
.When('0' ).To(DOT)
.When('1' ).To(DOT)
.When('-' ).To(N1)
.On(N1)
.When('1' ).To(DOT)
.On(DOT).Accept()
.When('.' ).To(N2)
.On(N2)
.When('0' ).To(N3)
.When('1' ).To(N4)
.On(N3).Accept()
.When('0' ).Repeat()
.When('1' ).To(N4)
.On(N4).Accept()
.When('1' ).Repeat()
.When('0' ).Repeat();
Last edited on Mar 23, 2016 at 12:01pm Mar 23, 2016 at 12:01pm UTC
Mar 23, 2016 at 2:45pm Mar 23, 2016 at 2:45pm UTC
It works with g++ -std=c++11
clang generates the same binary with 14 or 11 flag.
Report it as a bug.
By the way, you shouldn't add the binaries to git.