Computer Science Homework Solutions

Computer Theory

I need to check my answers to these questions against yours : a) Describe and give an example of a Web database. b) Discuss proper netiquette for participants in such internet services as newsgroups and mailing lists. c) Explain the difference between system design and system analysis. e) If a PC seems slugging ,what ...continues

Relational operators - Java

This section talks about the relational operator (==) and the .equals method. Why aren't they interchangable? Whey isn't the following code correct? String myName = "Ken"; if (myName == "Ken") //do something Why is this such a big deal? So many people think they are interchangeable.

Identify the tokens in each of the following statements.

1. Identify the tokens in each of the following statements. a. if (a == b1) a = x + y; b. delta = epilson + 1.23 - sqrt(zz); c. print(Q); 2. Assume that we are looking in a programming language that allows underscore (_) in variable names. When a scanner sees a character string such as AB_CD, is it more likely to identif ...continues

Show the output of scanner for each of the given statements.

Using the token types and classification values given in attached Figure 10.3, show the output of scanner when it is presented with each of the following statements: a. limit = begin + end b. a = b - 1; c. if(c == 50)x = 1; else y = x + 44; d. thenelse == error -

Write BNF grammars and show parse trees using these grammars.

1. Write a BNF grammar that describes the structure of a nonterminal called . Assume that contains an optional + sign followed by exactly 2 decimal digits, the first of which cannot be a 0. Thus 23, +91, and +40 are legal, but 9, +01, and 123 are not. Using this grammar, show a parse tree for the value +90. ...continues

Show the code that can be generated by a compiler from the given production.

How do you think a compiler translates into machine language, a branch in the parse tree that looks like the diagram given in attached CompilerTranslate.doc? Show the code that can be generated from the production given in the diagram, and the semantic record created for the new nonterminal symbol .

Describe the language defined by the given grammar.

Describe the language defined by the following grammar: :: = | :: = , :: = A

Create BNF grammars for boolean expressions of the specified form.

a. Create a BNF grammar that describes simple Boolean expressions of the form var AND var var OR var where var is one of the symbols w, x, y, and z. b. Modify your grammar from part (a) so that the Boolean expressions can be of the form expr AND expr expr OR expr where expr is either a simple variable (w, x, y, ...continues

Compiler

Please see the attached file.

Browse