So youll need to modify both specicaon les for the

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

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

Unformatted text preview: ample CSE341: Programming CSE341: Programming Languages Languages // global state and methods! ! Lecture 1 // next Lecture 1 unprocessed input character! Course static char Mechanics Mechanics Course nextch; !! ! ML Variable Bindings //ML Variable next input char! advance to Bindings void getch() { … }! Dan Grossman ! Dan Grossman F comments! // skip whitespace and all 2011 Fall 2011 void skipWhitespace() { … }! ! // input is a letter, digit, or _! boolean isIDChar(char c);! ! Winter 2013 UW CSE 401 (Michael Ringenburg) 31 Scanner getToken() method CSE341: Programming // CSE341: Programming Languages input token! Called by parser to retrieve the next Languages public Token getToken() {! Lecture 1 Token result;! Lecture 1 ! Course Mechanics Course skipWhiteSpace();!Mechanics ML Variable Bindings ! ML Variable Bindings if (/*no more input*/) {! result = new Token(Token.EOF); return result;! Dan Grossman }! Dan Grossman ! Fall 2011 switch(nextch) {Fall 2011 ! case '(': result = new To...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online