Flashcards
Theory of Programming
Cards in this deck (8)
- 1What is one example of a lack of orthogonality in the design of C?Arrays cannot be returned from a function but records can
- 2What construct of programming language provides process abstraction?Subprogram used to implement a sort algorithm that is required several times in a program
- 3What are the three general methods of implementing a programming language1) Compilation
-Programs translated to machine language
(Large commercial applications)
2) Pure Interpretation
- Programs are interpreted by another program known as an interpreter
(Small programs or when efficiency is not an issue)
3) Hybrid implementation systems
- A compromise between compilers and pure interpreters
(Small and medium systems when efficiency is not a concern) - 4What arguments can you make for the idea of a single language for all programming domains?It would make both developer and users understand about the language deeper since there are no longer any additional hustle in understanding another language for each cases. It would also make programs made under the same language compatible one another and so there are no ports needed on different platform.
- 5What arguments can you make against the idea of a single language for all programming domains?A great thing about various language for programming is that devs are able to express their ideas much more secure since other devs may not know the algorithm and process that happens in the background. therefore, a large varieties of programming language also helps the developments be better than one another.
- 66. Convert the following EBNF to BNF: (5 : S -> A{bA} A -> a[b]AS -> A | AB
B -> bA | bAB
A -> aA | abA - 7Describe, in English, the language defined by the following grammar: -> -> a | a -> b | b -> c | c-> a | a
- One or more 'a's
-> b | b
- One or more 'b's
-> c | c
- One or more 'c's
->
- One or more 'a's followed by one or more 'b's followed by one or more 'c's - 8Prove that the following grammar is ambiguous, i.e. give a sentence and its two parse trees. -> + | -> a | b | c