Question: programing language ve the following grammar Elements Infos are formats Program clarition Statement Declaration Declaration Declarations Declaration Declaration Type Identitle Type intl at Identifier -

 programing language ve the following grammar Elements Infos are formats Program
programing language
clarition Statement Declaration Declaration Declarations Declaration Declaration Type Identitle" Type "intl" at

ve the following grammar Elements Infos are formats Program clarition Statement Declaration Declaration Declarations Declaration Declaration Type Identitle" Type "intl" at Identifier - "A" "* Statements Sem Stats Stan Stanlock Assim Block Statement - eRxpression Expression propressionen Term Tant Term Factor Term / Mactor actor Pactor - Integer identifiera pression)" Tiger" (a) Dawa parsetre for the following program Tht man int Di Float C A-C-B-L2A): 1) Does the contator exhibit left associativity or right associativity in this grammar? Explain your answer in terms of your parsetree (6) For typical C++ Java/Clanguage identify two errors in the program that would NOT be detected using only the grammar here d) Suppose these productions were part of a much larger) complete grammar for a C++ Java/CH language. Of course, you would need many more productions than this, but describe two other changes ortions you would need to make to the productions listed here? 5. [35 points) Assume you have the following grammar Elements in quotes are terminals. Program "int" win" (Declarations Statements) Declarations - Declaration Declarations Declaration Declaration + Type Identifier":" Type "int" "bool" | "float" "char Identifier "A" I... "2" State Statement Statements Statement Statement","Block Assignment Block - Statements")" Assignment - Identifier Expression;" Expression - Expression Term Expression "_" Term Term Term + Term Factor Term "/"Factor Factor Factor - Integer Identifier (Xxpression)" Integer - "0" ... "9" (a) Draw a parse tree for the following program. int main int float C A-C-B- (2. A) (b) Does the operator exhibit felt associativity or right associativity in this grammar? Explain your answer in terms of your parsetree (c) For a typical C++ Java/C# language, identify two errors in the program that would NOT be detected using only the grammar here. (d) Suppose these productions were part of a (much larger) complete grammar for a C#/Java/C# language. Of course, you would need many more productions than this but describe two other changes or additions you would need to make to the productions listed here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!