Hi.
I need program using Flex and Bison doing operations on strings.
It has to be able to: merge strings, reverse them, taking only first/last word, cutting first/last word, looking for maximal prefix-sufix. Also it needs to have the ability to assign string to variable. The simpler, the better.
It should be connected in a way like in this tutorial: [login to view URL]
Operations ofcourse should be done in c functions or c++. Examplary runtime:
Input: a = test text it is
Output: assigned
Input: a
Output: test text it is
Input: b = second test yeah
Output: assigned
Input: merge(a,b)
Output: test text it is second test yeah
Input: reverse(a)
Output: si ti txet tset
Input: takefirst(a)
Output: test
Input: takelast(a)
Output: is
Input: cutfirst
Output: text it is
Input: cutlast(a)
Output: test text it
At the end I will need Flex file, Bison file and Makefile. Comments would be also welcome.