Presentation is loading. Please wait.

Presentation is loading. Please wait.

OPERATING SYSTEMS AND LANGUAGE TRANSLATORS CIS 2380 TERM 2 – LANGUAGE TRANSLATORS Lee McCluskey – 23/09/20151.

Similar presentations


Presentation on theme: "OPERATING SYSTEMS AND LANGUAGE TRANSLATORS CIS 2380 TERM 2 – LANGUAGE TRANSLATORS Lee McCluskey – 23/09/20151."— Presentation transcript:

1 OPERATING SYSTEMS AND LANGUAGE TRANSLATORS CIS 2380 TERM 2 – LANGUAGE TRANSLATORS Lee McCluskey – lee@hud.ac.uklee@hud.ac.uk 23/09/20151

2 TERM 2 resources… http//scom.hud.ac.uk/scomtlm/cis2380/ There will be a link from Unilearn. 23/09/20152

3 TERM 2 format … 1 Lecture + 1 Tutorial or Practical A mix of practical + theory. 23/09/20153

4 Assessment One exam covering all term 2 material, 50% of module. You will be given 4 questions of which you have to choose 3 question to do in 2 hours. The exam is “closed book” – you must remember stuff ! 23/09/20154

5 Language Translators n Computer Systems are full of FORMAL LANGUAGES – HTML, XML, Java, Pascal, BNF, Z, VDM, Python, Lingo, C++ … n There are languages for programming, for data, for database manipulation, for mark-up, for specification.. Sentences (programs) of LANGUAGES have to be compiled/interpreted/translated/executed/analysed by programs 23/09/20155

6 Compilers n Are the most commonly known language translator n A COMPILER translates a program P written in a ‘HIGH LEVEL’ language into a program Q written in a ‘LOW LEVEL’ language eg Java -> Byte code n Question: what is the relationship between programs P and Q ?????????? 23/09/20156

7 Interpreters n Are commonly known language translators What is the difference between Interpreters and Compilers? 23/09/20157

8 Interpreters n Are commonly known language translators What is the difference between Interpreters and Compilers? n ANSWER: Interpreters analyse a program written in a ‘HIGH LEVEL’ language AND execute it. Eg languages such as Prolog, Scheme, Haskell, Basic have interpreters u Compilers analyse then translate, u Interpreters analyse then execute. u Interpreted code execution is invariably slower than compiled code execution.. 23/09/20158

9 Some Jargon n Syntax – the ‘marks’ or ‘symbols’ used in a language n Syntax Specification – the set of symbols used in a language and the legal order that they may occur n GRAMMARS are often used to precisely specify syntax of languages 23/09/20159

10 Some Jargon Lexical Analysis – analysing the characters that make up program/sentence syntax to work out the components of the program/sentence Eg I f ( x x x x == 2 3 4 5 ) y y y = 4 2 ETC Are a sequence of characters. After lexical analysis this might translate to: Keyword(if) openbracket identifier(xxxx) operator(==) integer(2345) closedbracket Identifier(yyy) operator(=) integer(42) …. 23/09/201510

11 Some Jargon Parsing – analysing the components of the program/sentence to work out its syntactic structure IF-construct Keyword(if) openbracket identifier(xxxx) operator(==) integer(2345) Boolean Expression Statement 23/09/201511

12 TERM 2 contents … n Theory of Languages revision, Grammars and Properties of Grammars n Lexical Analysis, Scanning n Parsing n Automated Parser Generation n Symbol Tables n Other topics related to Compilers CODE ANALYSIS 23/09/201512

13 Related Subjects n Software Design: Compilers/interpreters can be very complex programs – they require good software development skills n Theory of computing: A great deal of the theory of automata, and grammars, is used to inform the practical pursuit of building language translators n Syntax and Semantics of Programs: You have to know how a language is structured, and what a language ‘means’ before you can write a translator 23/09/201513

14 Resources for TERM 2 n Main Book: Andrew Appel – Modern Compiler Implementation in Java. There are many copies in the library. We will cover the first 100 or so pages. n Other Books: There are many books on Compilers – all are worth looking at for background. n Website: This forms the module hand book, as it has most of the teaching resources, the lecture plan, and the coursework u There are links to other resources from the website – an online book, and some other lecture notes u Lecture Slides, most tutorial/practical sheets and most answers to questions are all on the website. SOME OF THE LATER SLIDES / TUTORIALS WILL CHANGE. 23/09/201514

15 Resources for TERM 2 The MAIN practical tool for this term is JavaCup This is a PARSER-GENERATOR – we will use it to generate parsers automatically from syntax specifications 23/09/201515

16 Tutorial this week… Find the website http//scom.hud.ac.uk/scomtlm/cas380/ Work through the exercises in Week 1. These are REVISION. If you are happy with a question move on to the next. Some of the answers appear on the website. 23/09/201516


Download ppt "OPERATING SYSTEMS AND LANGUAGE TRANSLATORS CIS 2380 TERM 2 – LANGUAGE TRANSLATORS Lee McCluskey – 23/09/20151."

Similar presentations


Ads by Google