formal10_part3 - Abstract versus Concrete Syntax Concrete...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Abstract versus Concrete Syntax Concrete Syntax: representation of a construct in a particular language, including placement of keywords and delimiters Abstract Syntax: structure of meaningful components of each language construct 1 Same abstract syntax, different concrete syntax: Pascal while x <> A[i] do i := i + 1 end Modula-2 WHILE x <> A[i] DO i := i + 1; END C while ( x != A[i] ) i = i + 1; 2 Example: < S > ::= < E > < E > ::= < E >- < T > | < T > < T > ::= < T > * id | id Consider A*B-C : Parse Tree < S > < E > < E >- < T > < T > id < T > * id C id B A Abstract Syntax Tree- * C A B “Essence” of construct 3 Extended BNF (EBNF) 1. Nonterminals begin with capital letters. 2. If no confusion can result, terminals are sometimes just written as they are. • Terminals that are reserved words are quoted, ‘if’, or in boldface, begin . • Terminals that are the same as EBNF symbols are quoted, e.g., ‘)’....
View Full Document

This note was uploaded on 02/05/2011 for the course CS 24 taught by Professor Cathy during the Summer '10 term at University of Toronto.

Page1 / 15

formal10_part3 - Abstract versus Concrete Syntax Concrete...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online