Presentation is loading. Please wait.

Presentation is loading. Please wait.

What are the names of the Meta Languages you have used?

Similar presentations


Presentation on theme: "What are the names of the Meta Languages you have used?"— Presentation transcript:

1 What are the names of the Meta Languages you have used?
What are they? What do you use them for? What are the names of the Meta Languages you have used?

2 Meta Languages – What are they?
Text based methods of describing rules of a language. Are precise Always mean the same thing ie, 2+2 = 4

3 Meta Languages – what are they used for?
To describe more complex programming languages Help programmers with language design & implementation Represent the SYNTAX of programming languages (the rules of a language)

4 Meta Languages – you need to know these types:
Text-based metalanguages: BNF – Backus Normal Form EBNF – Extended Backus-Naur Form Graphically-based metalanguages: Railroad Diagrams (also known as syntax structure diagrams)

5 What is the difference between BNF and EBNF?
BNF is very basic Shows language elements within brackets <> Allows use of terminal symbols like * or – Includes Alternatives | EBNF was developed to EXTEND BNF in order to include Repitition { } Optional elements [ ] Grouped Elements ( ) Simpler symbol for ‘is defined as’ EBNF uses = BNF uses ::=

6 Examples BNF Digit ::= 1 | 2 | 3 Number ::= <digit> * <digit> EBNF Digit = 1 | 2 | 3 Number = <digit> * <digit> Railroad Diagram refer to Table 5.2 in Wilson, p125

7 Worked Example Decide which of the following are legal and which are illegal. Give a reason for your answer Digit ::= 4 | 5 | 6 | 7 | 8 Sum ::= <Digit> * <Digit> Sum = 4 * 8 Sum = 7 * 5 Sum = 9 * 6 Sum = 5 * 4 Sum = 6 * 1 What type of metalanguage was used above?

8 In Class Questions Exercise 5.1 (from Wilson, p124) Questions 3 & 4
Exercise 5.1 (from Fowler, p164) Questions 3a) 3b) 4 and 7


Download ppt "What are the names of the Meta Languages you have used?"

Similar presentations


Ads by Google