Reference no: EM133319688
Assignment: The source file you turn in will contain all the functions and a main routine. You can have the main routine do whatever you want, because we will rename it to something harmless, never call it, and append our own main routine to your file. Our main routine will thoroughly test your functions. You'll probably want your main routine to do the same. If you wish, you may write functions in addition to those required here. We will not directly call any such additional functions. If you wish, your implementation of a function required here may call other functions required here.
The program you turn in must build successfully, and during execution, no function (other than main) may read anything from cin or write anything to cout. If you want to print things out for debugging purposes, write to cerr instead of cout. When we test your program, we will cause everything written to cerr to be discarded instead - we will never see that output, so you may leave those debugging output statements in your program if you wish.
All of the functions you must write take at least two parameters: an array of strings, and the number of items the function will consider in the array, starting from the beginning. For example, in
Additional Informations :
3 (TURN OVER) CST.2017.4.16 3 Compiler Construction Programming answers should be written in some notation approximating SML or OCaml. (a) Describe what is meant by tail recursion. [4 marks] (b) 4 CST.2016.3.5 4 Compiler Construction Consider writing a compiler for a simple language of expressions given by the following grammar, e ::= n (integer) | ? (read integer input from user) | e + e (addition) | e - e (subtraction) | e ∗ e (multiplication) | (e, e) (pair) | fst e (first projection) | snd e (second projection).3 marks] (b) Consider the use of a monad for input-output. For the purposes of this question, take the IO monad as including two operations readint and writeint which respectively read integers from stdin and write integers to stdout. Give the types of these operators. [2 marks] Assign the Last host IP address from Network X subnet to S0/11/1 interface of R2. 11. Assign the First host IP address from Network Y subnet to S0/1/0 interface of R2. m. Assign the Last host IP address from Network Y subnet to S0/1/1 interface of R3. n. Assign the First host IP address from Network Z subnet to S0/1/0 interface of R3. 0. Assign the Last host IP address from Network Z subnet to S0/1/1 interface of Ri.