A Gherkin Lexer
Learn about how to implement text indentation and a Gherkin lexer.
We'll cover the following...
We'll cover the following...
A lexer is an interesting topic when parsing text because it can often be confused with the parser itself. If we look at the Gherkin example in the code snippet below, we can see that there are a lot of individual characters and words, and it might be difficult to even figure out where we should start parsing this:
Operating directly on individual characters or entire words can be complicated from a parser’s perspective. It would be much more helpful if we could work on a higher-level structure instead. This is where a lexer comes in.
Because Gherkin is an ...