Language Translation Issues

9/13/00


Click here to start


Table of Contents

Language Translation Issues

Programming Language Syntax

General Syntactic Criteria

Readability

Writeability

Translation

Lack of ambiguity

If then else

Resolve dangling else

PPT Slide

Character set

Other elements

Overall Program-Subprogram Structure

Stages in Translation

Stages in Translation

Structure of a Compiler

Analysis of the Source Program

Synthesis of the Object Program

Translator Groupings

PPT Slide

Formal Translation Models

Chomsky Hierarchy

Classes of grammar and abstract machines

Grammar

Type 0 or phrase structure

Type 1 or context sensitive or context dependent

G = ( {S,B,C}, {a,b,c}, S, P)

Deciding the language?

Identifying L given G

Type 2 or context free

Context Free Expression Grammar

Type 3 - regular grammars

Grammars

BNF Grammars

BNF Grammars

Represent sentences by a set of rules

Syntax

Production Rules

Doesn’t Have to Make Sense!

Parse Trees

Parse tree

Use of Formal Grammar

BNF grammar or Context free

Syntax not defined by BNF notation

Ambiguity

Ambiguous Grammar

Ambiguous Grammar

Expressions

Sequencing with Arithmetic Expressions

Sequencing with Arithmetic Expressions

Tree-Structure Representation

Syntax for Expressions

Expression Notation

Which of the following is a valid expression (either postfix or prefix)?

Expression Notation - Infix

Precedence

Associativity

Abstract Syntax Tree

Side Effects

A * fun(x ) + a

A * fun(x ) + a

Positions on side effects in expressions

Author: Dolores Zage

Email: dmz@cs.bsu.edu

Home Page: http://www.cs.bsu.edu/homepages/dmz/cs335/

Download presentation source