The start symbol is greeting.greeting -> good time-specification time-specification -> morning time-specification -> day time-specification -> evening time-specification -> good
What is the language that this grammar describes? Answer by listing all strings (that is, sequences of terminals) that can be expressed in the language.
The start symbol is several-greetings.several-greetings -> greeting several-greetings -> greeting several-greetings greeting -> good time-specification time-specification -> morning time-specification -> day time-specification -> evening time-specification -> good
What is the language that this grammar describes?
The start symbol is time-specification.time-specification -> boat | boat time-specification boat -> good several-greetings several-greetings -> morning | day | evening | good
a) What is the language that this grammar describes?
b) What can we learn from this question?
Merry Christmas! Merry Christmas! Merry Christmas! Trevlig Midsommar! Glad Påsk! Done!
Hint: Make a non-terminal called several-greetings, which represents one or more greetings. Several-greetings kan either be a single greeting, or a single greeting followed by several greetings.
The terminal variable is a variable name, and consists of one or more lower-case letters. The terminal integer-literal is an integer literal, and consists of one or more normal decimal digits. Empty stands for an empty production. The start symbol is statement-list.statement-list -> statement statement-list | empty statement -> variable = integer-literal ; condition -> variable < variable statement -> if ( condition ) statement
Show how the following input can be divided into tokens, and how the token sequence can be derived from the start symbol statement-list using the productions in the grammar.
if (hjalmar < hulda) if (z < x) w = 33; kalle = 17;
There are some solutions to some of the questions, but try to solve them yourself first.