========================= Lucky Charms language What a programming language that someone can use to count up their different lucky charms marshmallows. Their input program would look like: 2 pink heart 3 yellow star 1 yellow moon 1 pink heart And the output would be: 3 pink hearts 3 yellow stars 1 yellow moons Questions - What is a context free grammar that can describe all possible input programs? (Assume the input needs to have at least one statement). - What are the regular expressions for the tokens? - Create an NFA that recognizes all of the tokens? - Create a DFA from the NFA. - Is the grammar LL(1)? How can we procedurally determine if it is in LL(1)? - How can we edit it to make it LL(1)? - Write a predictive parser for the language that assumes a lexer has already been written and that uses syntax-directed translation to count the number of hearts, moons, and stars. - Do a right-most derivation of the example input program. - Do a left-most derivation of the example input program. - Draw the parse tree. - Draw a reasonable AST. - Why might we want to create an AST?