Prep Right
PPSC · PMS Punjab 2016

Computer Science, Paper II

100 marks · 3 hours · 2 questions
This paper Computer Science · all yearsQ. 1 · Give Context-free Grammars generating the…Q. 2 · Tokenize the following assignment statement…With this paper← 20162019 →
3 hours · questions hide until you reveal them

Not yet checked 1 of 2 questions have not yet been compared with the official paper.

Q. 1

Give Context-free Grammars generating the following languages:

  1. (a)i) The set of strings over the alphabet {a,b} with more a's than b's. ii) The set of strings over the alphabet {a,b} with more a's than b's. {w#x/w is a substring of x for w, x ∈ {0,1}*} [10]
  2. (b)Give state diagrams of NFAs with the specific number of states recognizing each of the following languages considering alphabet is {0,1}. i) The language {w | w ends with 00} with three states. ii) The language 1 (001+) with three states. [10]
Not yet checked
(20)
Q. 2
  1. (a)Tokenize the following assignment statement by lexical analysis of scanning while describing each token. C:=-AB [5]
  2. (b)How is Top-down parsing different from bottom-up parsing? [10]
  3. (c)Name the intermediate representation which is closest to the input programme, also give reasons. [5]
(20)

Related papers

About this paper

The 2016 PMS Punjab Computer Science paper set by the PPSC. Question wording only; questions marked “Not yet checked” have not been compared with the official paper yet.

Disclaimer Prep Right is independent and not affiliated with PPSC.