NYU Unambiguous BNF Grammar Rules for Subset of Java Style Method Calls Discussion

Write unambiguous BNF grammar rules for a subset of Java-style method calls. The grammar should obey the following rules:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

A method can take any number of parameters All parameters are comma separated Each parameter can be a variable, a method call, or a simple arithmetic expression A simple arithmetic expression can be variables/method calls separated by + and * only – no parentheses or other operations Comma-separated and arithmetic expressions are evaluated left-to-right A method call has higher precedence than arithmetic * has higher precedence than + Variables can only be named x, y, z Methods can only be named m1, m2, m3 Nested method calls must be evaluated from the inside out – in m1(m2()), m2 should be evaluated before m1 The start symbol is a method call

Write the rules using the formatting, and make sure your start symbol is the first production. Some legal examples in the language:

m1(x, y, z)

m2(m1() + m3(), x * m3())

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

m1(m1(m1(m2(x+y))))

Some illegal examples:

m1(x,)

1 + m2()

m1(m2 * y)

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER