O'Reilly logo

Expert F# 2.0 by Antonio Cisternino, Adam Granicz, Don Syme

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required