Chapter 16. Lexing and Parsing
In this chapter, you take a closer look at lexing and parsing, topics introduced briefly in Chapter 9 and 11. In particular, the chapter introduces the lexer and parser generators, fslex and fsyacc, that come with the F# distribution. A typical scenario when these techniques and tools can come in handy is the following:
You want to read user-readable input that has a well-defined syntax.
You have a type (often an abstract syntax tree [AST] type) to represent this input.
The typical task is to parse the user input into your internal representation by breaking down the input string into a sequence of tokens (a process called lexical analysis) and then constructing an instance of your internal representation based on a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access