4

Syntax Analyzer

What you will learn in this chapter

  • Some basic parsing terms
  • Recursive-descent Parser
  • Top-down parsing
  • Bottom-up parsing
  • Various types of LL(1) grammars and parsers
  • Shift/Reduce and Operator precedence parser
  • LR(0), SLR(1), LR(1) and LALR(1) parsers
  • What are conflict situations in LR parsers?
  • How conflicts are resolved?
  • Compiler writing tools– yacc, bison and ANTLR

Key Words

syntax analysis, parser, RDP, Top-down, Bottom-up, LL(1), LR(0), SLAR(1), LR(1), LALR(1), conflicts, resolution of conflicts, yacc, bison

Parsing is a general term meaning analyzing a sentence to arrive at its syntactic structure. From theoretical viewpoint, lexical analysis is also parsing, only the atoms of the language involved are at finer granularity. ...

Get Compilers: Principles and Practice now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.