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

Slides:



Advertisements
Similar presentations
15-Dec-14 BNF. Metalanguages A metalanguage is a language used to talk about a language (usually a different one) We can use English as its own metalanguage.
Advertisements

BNF. What is BNF? BNF stands for “Backus-Naur Form,” after the people who invented it BNF is a metalanguage--a language used to describe another language.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 2 Syntax A language that is simple to parse.
ISBN Chapter 3 Describing Syntax and Semantics.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
CS 330 Programming Languages 09 / 13 / 2007 Instructor: Michael Eckmann.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Slide 1 Chapter 2-b Syntax, Semantics. Slide 2 Syntax, Semantics - Definition The syntax of a programming language is the form of its expressions, statements.
Chapter 3 Describing Syntax and Semantics Sections 1-3.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 2 Syntax A language that is simple to parse.
30-Jun-15 BNF. Metalanguages A metalanguage is a language used to talk about a language (usually a different one) We can use English as its own metalanguage.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Compilers and Syntax.
Chapter 2 Syntax A language that is simple to parse for the compiler is also simple to parse for the human programmer. N. Wirth.
1 Syntax and Semantics The Purpose of Syntax Problem of Describing Syntax Formal Methods of Describing Syntax Derivations and Parse Trees Sebesta Chapter.
Chpater 3. Outline The definition of Syntax The Definition of Semantic Most Common Methods of Describing Syntax.
CS 355 – PROGRAMMING LANGUAGES Dr. X. Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax.
Syntax Specification and BNF © Allan C. Milne Abertay University v
CS Describing Syntax CS 3360 Spring 2012 Sec Adapted from Addison Wesley’s lecture notes (Copyright © 2004 Pearson Addison Wesley)
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 2 Syntax A language that is simple to parse.
C H A P T E R TWO Syntax and Semantic.
ISBN Chapter 3 Describing Syntax and Semantics.
Copyright © by Curt Hill Grammar Types The Chomsky Hierarchy BNF and Derivation Trees.
1 Syntax In Text: Chapter 3. 2 Chapter 3: Syntax and Semantics Outline Syntax: Recognizer vs. generator BNF EBNF.
Programming Paradigms Backus Naur Form and Syntax Diagrams.
Prog. techniques. Standard prog. techniques Complex programs can be broken down into simpler parts called “Modules” These come in 2 types,“Procedures”
CSE 425: Syntax II Context Free Grammars and BNF In context free grammars (CFGs), structures are independent of the other structures surrounding them Backus-Naur.
CPS 506 Comparative Programming Languages Syntax Specification.
D Goforth COSC Translating High Level Languages.
Context Free Grammars CFGs –Add recursion to regular expressions Nested constructions –Notation expression  identifier | number | - expression | ( expression.
Syntax and Grammars.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 2 Syntax A language that is simple to parse.
NOEA/IT - CS Programme1 On Languages History of Programming Languages About Compilers Syntax and Semantics Describing Syntax: BNF and EBNF Syntax.
Formal Language. A formal language is defined by two components: -Alphabet -Rules of syntax.
Chapter 2.2 Programming Language Definition. Summary Syntax and Semantics Semantics definition –Denotational Semantics –Elementary actions Syntax definitions.
C H A P T E R T W O Syntax and Semantic. 2 Introduction Who must use language definitions? Other language designers Implementors Programmers (the users.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Syntax.
Organization of Programming Languages Meeting 3 January 15, 2016.
BNF A CFL Metalanguage Some Variations Particular View to SLK Copyright © 2015 – Curt Hill.
Chapter 3 – Describing Syntax CSCE 343. Syntax vs. Semantics Syntax: The form or structure of the expressions, statements, and program units. Semantics:
Syntax(1). 2 Syntax  The syntax of a programming language is a precise description of all its grammatically correct programs.  Levels of syntax Lexical.
CS 3304 Comparative Languages
Regular Expressions, Backus-Naur Form and Reverse Polish Notation
Chapter 3: Describing Syntax and Semantics
Chapter 3 – Describing Syntax
RECURSION.
Chapter 3 – Describing Syntax
Concepts of Programming Languages
Syntax (1).
Automata and Languages What do these have in common?
Compiler Construction (CS-636)
Backus Naur form.
Lecture 3: Introduction to Syntax (Cont’)
Programming Languages 2nd edition Tucker and Noonan
Programming Language Syntax 2
Computer Science 210 Computer Organization
CSC 4181Compiler Construction Context-Free Grammars
R.Rajkumar Asst.Professor CSE
Context–free Grammar CFG is also called BNF (Backus-Naur Form) grammar
CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics
CS 3304 Comparative Languages
Divisibility Rules.
September 13th Grammars.
BNF 23-Feb-19.
CSC 4181 Compiler Construction Context-Free Grammars
Syntax vs Semantics Backus-Naur Form Extended BNF Derivations
Chapter 3 Describing Syntax and Semantics.
BNF 9-Apr-19.
High-Level Programming Language
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

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?

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

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)

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)

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 ::=

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

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?

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