cmps104a-2005q4-exam1

cmps104a-2005q4-exam1 - CMPS-104A Compiler Design I 2005...

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 • 2005 Fall • Test #1 page 1 of 3 $Id: cmps104a-2005q4-exam1.mm,v 359.1 2005-12-07 17:18:08-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. Write flex regexesfor each of the following. Do not assume, define, or use anymacros. [5 ] i. A string which begins with a quote ( " )oranapostrophe ( )and ends with the same character that it begins with, and contains inside of it anynumber of characters except for the newline ( \n )character or the kind of character that delimits the string. ii. An identifier which consists of one or more upper -o rlower-case letters, digits, and underscores ( _ )but may not begin with a digit. In addition, an underscore may not be the first character ,nor the last, nor appear adjacent to another underscore. iii. A comment in C++ or Java which begins with twoslash ( / )characters followed by zero or more characters up to, but not including a newline ( \n )character. iv .A string consisting of an odd number of occurrences of the letter x
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-2005q4-exam1 - CMPS-104A Compiler Design I 2005...

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