The distinction between a scanner and a parser is somewhat arbitrary. One could use one and the same formalism for it. The scanner usually deals with things that are considered 'atomic' elements in the language, while grammar is used for 'compound' elements consisting of one or more other elements. If there are seen as one and the same, than it naturally flows that the scanner is called from the parser, and not how it is traditionally done, that the scanner acts as a first pass. This seems a logical approach, but in practices, when scanning is context sensitive, requires the implementation of all kinds of hacks. Also, the treatment of keywords (where it is possible that they are case insensitive) it is better to have a grammar for parsing a keyword 'identifier' and a check whether the result matches the keyword. For pure performance this would not be the best solution, but I understand that Carburetta is not design for that. I have been developing a parser that makes no distinction between scanning and parsing in C, which I called RawParser: <a href="https://github.com/FransFaase/RawParser" rel="nofollow">https://github.com/FransFaase/RawParser</a> . It also offers more powerful grammar constructs and gives examples on how to implement memory management in a uniform way.
Come on, the seventies have ended...<p>> Note that the above implies there is currently no support for features like:<p>> UTF-8 (or other unicode) input, input characters are all deemed to be in the range 0 to 255.