Program in C to read a deterministic finite automaton from a formatted text file, use it to scan a second text file, and print the detected tokens to the terminal. For CS 3361-001 Spring 2020 TTU.
buildTransitonArr() and buildTransitionTriple() functions do not support parentheses as transition characters. This is against the specification, whichstates that transition characters may be any character except for '{', '}', and ','. Please rewrite.
The definitions of buildTokenPair() and buildTransitionTriple() in automaton.c ONLY support alphabetical characters. The specification states that transition characters may be "all characters that a programmer can use EXCEPT the THREE characters '{’, ’}’ and ’,’." Please rewrite to support this.
initFileBuf tries to use fseek(filePtr, 0, SEEK_END) to compute the size of a file passed as a shell parameter, which is undefined behavior according to the C standard specification; see here and The ISO 99 C Standard Specification Footnote 268. Please rewrite this either in an OS-agnostic manner, or use preprocessor directives to at least support different implementations for Windows, Linux and MacOS.
scan() provides information about the tokens by populating the array tokenFinalStatesArr. According to the specifcation, the output of scan must be one token instead of a sequence of tokens. Please refactor, for example, into two functions, one which satisfies the requirements of the specification for the function scan(), and one perhaps named scanDriver() to manipulate that function into the existing structure of this application.