Write a set of bnf grammar rules

Assignment Help Theory of Computation
Reference no: EM131492035

Assignment

1. Write a set of BNF grammar rules that will parse a programming language that can have variable type declarations such where the variable has name and a type which can be either integer or boolean, and optionally has a constant default value:

E.g.
var i : integer;
var j : integer = 6;
var b : boolean;
var b2 : boolean = true;
var b3 : boolean = false;

2. Show an example of why the following grammar is Ambiguous.
<program> -> <stmts>
<stmts> -> <stmts> ; <stmts> | <assignment>
<assignment> -> <var> = <expr>
<var> -> a | b | c | d
<expr> -> <term> + <term> | <term> - <term>
<term> -> <var> | const

Reference no: EM131492035

Questions Cloud

Draw a picture of a point-to-multipoint wireless network : What are the key issues to be obtained from conducting a site survey for each of the following?
Define each of the variables or terms in this equation : Recall that the secuirty market line (SML) illustrates the relationship between systematic risk and expected returns.
What is the purpose of the inquiry procedure in bluetooth : What is a piconet? What is the purpose of the paging procedure in Bluetooth? Define the term backscatter.
Assume that project has a negative net present value : Assume that a project has a negative net present value (NPV) of $500 and an internal rate or return (IRR) of 10%.
Write a set of bnf grammar rules : Write a set of BNF grammar rules that will parse a programming language that can have variable type declarations. Why the following grammar is Ambiguous.
What are three frequency bands typically used for rfid tags : What is the WiMax frequency standard for the United States? Why was OFDM selected for WiMax?
How much will you pay for the stock : Alexander Corp. will pay a dividend of $3.80 next year. If you want a return of 15 percent, how much will you pay for the stock?
Define business processes : HI5019 STRATEGIC INFORMATION SYSTEMS T1 2017 ASSIGNMENT - BUSINESS REPORT. Conduct research on AIS/ERP Systems for your client
Compute the simple returns to each of the series : Compute the simple RETURNS to each of the series - Based on the ACF and PACF what time of model would you recommend for both series?

Reviews

Write a Review

Theory of Computation Questions & Answers

  Finite-state machine design

Create a finite-state machine design to turn your FPGA development board into a simple programmable music box.

  Redundant sequence identi cation

Redundant sequence identi cation

  Compute a shortest superstring

Dynamic programming algorithm to compute a shortest superstring.

  Propositional and predicate logic

Write down a structural induction principle for the PlayTree free type

  Design a syntactic analyzer

Design a syntactic analyzer for the language specified by the grammar

  Design unambiguous grammar to parse expressions

Write a program would read two numbers and then print all numbers between the first and the second, inclusive. Design unambiguous grammar to parse expressions

  Consider a logic function with three outputs

Consider a logic function with three outputs,  A ,  B , and  C , and three inputs,  D ,  E , and  F . The function is defined as follows:  A  is true if at least one input is true,  B  is true

  Considering a single programmed operating system

Considering a single programmed operating system, what is the minimal total time required to complete executions of the two processes? You should explain your answer with a diagram.

  How to construct an nfa

Give a construction that assumes you are given a DFA for L and show how to construct an NFA (with or without ε-moves) to recognize sort(L).

  Equivalence classes to construct minimal dfa for language

How many equivalence classes does this relation have and what are they? Use these equivalence classes to construct the minimal DFA for the language.

  Impact of moore-s law on data center costs

Discuss the impact of Moore's law on data center costs on such things as servers and communications equipment. List at least 3 steps or recommendations your data center can take to offset some or all of the effect of Moore's law.

  Problem encountered in statements in predicate logic

How the problem would be encountered in attempting to represent the following statements in Predicate logic. it should be possible to: John only likes to see French movies.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd