cmps104a-2006q4-exam1

cmps104a-2006q4-exam1 - CMPS-104A Compiler Design I Fall...

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

View Full Document Right Arrow Icon
CMPS-104A • Compiler Design I • Fall 2006 • Test #1 page 1 of 3 $Id: cmps104a-2006q4-exam1.mm,v 1.60 2007-01-02 15:45:59-08 - - $ page 1 page 2 page 3 Please PRINT using keyboard letters : Name : Login : @ucsc.edu Total / 30 Closed book. No notes. No computer .Answer ONLYinthe spaces provided. Neatness counts ! Do your scratch work elsewhere and only enter your final answer into the spaces provided. 1. For each for the following flex regular expressions, drawa deterministic finite αυτοματον using the minimum possible number of states. Do not showdead states. [5 ] i. ab+|a+ ii. a*b+c*d iii. \"[123]*\" iv. [xyz]|xx+ v. d+\.d* 2. Write a flex scanner that scans the language described here. Assume int yylval ,that is the semantic informa- tion is just an integer .There are the following tokens and patterns : a. INT ,which is a sequence of one or more decimal digits ;inthat case, use atoi to convert the lexical information to an integer and assign to
Background image of page 1

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

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

Page1 / 2

cmps104a-2006q4-exam1 - CMPS-104A Compiler Design I Fall...

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

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