reading_notes:parsing_techniques_a_practical_guide_second_edition

This is an old revision of the document!


2 Grammars as a Generating Device

Chomsky type Grammar type Most complicated data structure
0 / 1 PS / CS production dag
2 CF production tree
3 FS production list
4 FC production element

generate $a^nb^nc^n$ grammar from using

1. Ss -> abc | aSQ 
2. bQc -> bbcc
3. cQ -> Qc

This way of doing things is called breadth-first production; computers are better at it than people.

S = N | L, '&', N ;
N = 't' | 'd' | 'h' ;
L = N, ',', L | N ;

  • reading_notes/parsing_techniques_a_practical_guide_second_edition.1718714121.txt.gz
  • Last modified: 2024/06/18 12:35
  • by root1