What is the difference between a rounded rectangle and a normal rectangle in railroad diagrams?
Rounded rectangle indicates a literal.
A normal rectangle indicates an element that needs to be defined elsewhere.
What do curly braces represent in EBNF?
Write down some examples of the statement a { b }
A repetition of the the elements inside zero or more times.
a { b } would represent: a, ab, abb, abbb etc.
What do square brackets mean in EBNF?
Write down the possible statements defined by a [b] c
An option (zero or once).
a [b] c would be either abc or ac.
In EBNF, how can you specify that an element must repeat one or more times?
For example, how could you describe
hi, hii, hiii, hiiii etc.
By including the element as a literal, followed by a zero or more time loop (curly brackets).
That is, h i { i }
What are parentheses used for in EBNF?
As a grouping symbol, to remove any possible ambiguity in a rule.
How do you specify a choice between options in EBNF?
With a vertical line.
For example, x ( + | - ) y could be x + y or x - y
In EBNF, how do you specify a symbol that requires further definition elsewhere?
(This is also called a non-terminal symbol)
Using angled brackets.
For example, in the rule if < condition > then, if and then are literals while condition is defined elsewhere.
What is the only type of code that can be executed by a computer?
Machine code: commands written in binary that are specific to each processor (or family of processors).
What is assembly language?
A low-level language that is processor-dependent. It uses text codes (“opcodes”) to perform arithmetic functions and access processor registers.
Each opcode in assembly corresponds to one machine code instruction, but is (very slightly) more readable.
What does translation refer to?
The process of converting human readable (high-level) languages into machine code.
The 2 forms of translation are interpretation and compilation.
Describe how an interpreted language is executed.
The interpreter executes each line of source code as it is read.
Describe how a compiled language works.
A compiler analyses the entire source code and creates an executable file.
Outline the advantages and disadvantages of compilation and interpetation.
Interpretation
Compilation
What are the 3 stages involved in translation?
Outline the process of lexical analysis.
Each word in the source code is checked to see if it is part of the language.
The words are converted into tokens to represent parts of the langugae and user-defined variable names.
Outline the process of syntactical analysis.
The source code is analysed to ensure it follows the syntax of the language.
This is achieved by creating a parse tree from the tokens generated in the previous stage. A parse tree is a visual representation of a syntactically correct statement.
Outline the process of code generation
The correct parse tree containing the tokens is converted to machine code.
What is the function of a linker?
In the code generation stage of translation, the linker adds any links to library files used by the source code.
What is a DLL?
A dynamically linked library, which contains compiled library functions that can be used by other programs. DLLs are accessed at run time, compared to static libraries which are compiled with the source code.
Outline the three types of errors that can occur.
Outline the 3 types of runtime errors that can occur
What hardware requirements must be considered when implementing a software solution?
Related to hardware, what is a driver?
*As opposed to a driver related to <em>testing a subroutine or library module</em>
Software that allows a computer program to operates or controls a particular type of hardware device
How might CASE tools be used to produce different types of documentation for a software solution?
CASE tools would likely not be used for user documentation (eg user manual, installation guide etc).
CASE tools could be used for technical documentation such as: