20101012

20101012 - b := 0; NAME ASSIGNMENT 0; if (a = 0 ) IF (NAME...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
============================ CS 441 Fall 2010 -- JWJ Pre-class notes - do not distribute Tuesday, October 12, 2010 ============================ Scope Error handling and error recovery in top-down parsing. Objectives Understanding possible approaches and heuristics for parsing in presence of lexical and syntax errors. The role of FIRST and FOLLOW as synchronizing sets. Materials Textbook and additional handout distributed in class. Example Parse, based on the handout, the following program procedure tryerrors; PROCEDURE NAME; begin BEGIN a := 1; NAME ASSIGNMENT 1;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: b := 0; NAME ASSIGNMENT 0; if (a = 0 ) IF (NAME = 0 ) begin BEGIN if (a = b) IF ( NAME = NAME) a := 0; NAME ASSIGNMENT 0; b := 1; NAME ASSIGNMENT 1; end ; END; end . END. that is, incorrectly, missing the first 'if'. That is, the input is: procedure tryerrors; PROCEDURE NAME; begin BEGIN a := 1; NAME ASSIGNMENT 1; b := 0; NAME ASSIGNMENT 0; ( a = 0 ) (NAME = 0 ) <--- error begin BEGIN if (a = b) IF ( NAME = NAME) a := 0; NAME ASSIGNMENT 0; b := 1; NAME ASSIGNMENT 1; end ; END; end . END....
View Full Document

Ask a homework question - tutors are online