Close-up of highlighted source code on a screen
Photo by Martin Vorel from Wikimedia Commons, CC BY-SA 4.0, cropped

Programming Languages Concepts

Leftmost Derivation

Press Derive.

Leftmost derivation

    Parse tree

      How it works

      A grammar rewrites a nonterminal, written in angle brackets, by the right-hand side of one of its rules. In a leftmost derivation every step rewrites the leftmost nonterminal, until only the characters of the string are left. The parse tree shows the same rules as a hierarchy: each nonterminal with the parts it was rewritten into.

      From the course

      • Semester 4
      • Practice 4: syntax and grammar; control work

      Useful resources

      1. Backus–Naur form the article from the Wikipedia