See my commments on lexical and grammatical analysis above. When the input string is processed successfully, and the automata reached its final state, then it will accept. Finite automata have two states, Accept state or Reject state. At the time of transition, the automata can either move to the next state or stay in the same state. When the desired symbol is found, then the transition occurs. It takes the string of symbol as input and changes its state accordingly. Even then, it will likely make your FSM very complex. Finite automata are used to recognize patterns. Choice 2: one-hot encoding For N states, use N bits to encode the state where the bit corresponding to the current state is 1, all the others 0. Tradeoffs: most efficient use of state registers, but requires more complicated combinational logic to detect when in a particular state. use the ADDIE development model (analysis, design, development, implementation. state represented by a unique combination of the bits. The lexical analysis for a modern computer language such as Java needs the power of which one of the following machine models in a necessary and sufficient sense (A)Finite state automata. In this course, there are finite state automata (FSA) and deterministic. This is where you will need a grammar or pushdown automaton unless you can guarantee that the nesting will not exceed a certain level. The lexical analysis for a modern computer language such : GATE-2011. All the comments will and junk is filtered out, so I have a std::string like this: global \n ) or would that need hacky implementations? I have a tokenized string with newlines signifying the end of a euh. I would like to parse a self-designed file format with a FSM-like parser in C++ (this is a teach-myself-c++-the-hard-way-by-doing-something-big-and-difficult kind of project :)).