Page 1 of 1

08: #1 2 #3 NA #5 #6 #7 #8 Consider the simple BNF granmar for integral numbers shown below. Cexpr> Cint> (op> | <

Posted: Fri May 20, 2022 12:04 pm
by answerhappygod
08 1 2 3 Na 5 6 7 8 Consider The Simple Bnf Granmar For Integral Numbers Shown Below Cexpr Cint Op Int 1
08 1 2 3 Na 5 6 7 8 Consider The Simple Bnf Granmar For Integral Numbers Shown Below Cexpr Cint Op Int 1 (81.75 KiB) Viewed 34 times
08: #1 2 #3 NA #5 #6 #7 #8 Consider the simple BNF granmar for integral numbers shown below. Cexpr> Cint> (op> <int> | <int> <op> <expr> cint> -> <number> | <sign> <number> Cop> <sign Cnumber) -> (any-digit> | <pos-digit> <digita> <digits> > Cany-digit> | <any digit> <digits> Cany-digit> > <pos digit> pos-digit> -> 1 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 (a) Explain which of rules #1-8 are used by the lexical analyzer and which are used by the the syntax analyzer, respectively, and how. Lint out the tokens and give a brief definition of each, in words (based on the grammar). (6 marks) 6) For each sentence below, give the output of the lexical analyser (i.c. a list of lexemen and their tokens), show the recognition work done accordingly by the wyntax analyser, and indicate the outcome i.c., whether the sentence is valid or, if not, which error in detected. (6 marka) (1) -123+800 (1) 421-33+7 (iii) 1+06 (c) Explain the issue created if we change rule #4 to: <signs 1 Think of a possible solution and give the idea briefly (4 marks) -> +