Context-free languages Flashcards
What is Backus-Naur form?
A context-free grammar used by developers of programming languages to specify the syntax rules of a language
What are production rules?
A range of symbols and expressions combined
What are <> used for in BNF?
Denote a non-terminal symbol
A non-terminal symbol appearing on the right side of a production rule means there’ll be another rule after to define the contents of the chevrons
What is | | used for in BNF?
Showing terminal symbols, these values cannot be broken down and defined further. They are the building blocks
What symbol must be included in BNF statements at some point?
Terminal symbols
Can recursion be used in BNF?
Yes
What does a parse tree do?
Breaks something down into it’s component parts
What are parse trees often used to do?
Check whether a string satisfies a production rule
What is the diagrammatic approach to BNF called?
A syntax diagram
State the rules of reading a syntax diagram
Read left to right
Follow the arrows
You can’t go back unless a loop arrow is included