Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Left recursion, left factoring?

Ook bekend als: left recursion · left factoring

Definition 2.7 University Computer Science — Year 3 · Hoofdstuk 2 — Top-Down Parsing

A grammar has left recursion if some nonterminal AA derives AαA\alpha in one or more steps. Left factoring replaces productions A→βγ1∣βγ2A \to \beta\gamma_1 \mid \beta\gamma_2 that share a prefix β\beta by A→βA′A \to \beta A' and A′→γ1∣γ2A' \to \gamma_1 \mid \gamma_2, with a new nonterminal A′A'.

Lees in het hoofdstuk →