choose the token names also there may be addional

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: pically by the parser to obtain next token). Winter 2013 UW CSE 401 (Michael Ringenburg) 17 Scanning DFA CSE341: Programming CSE341: Programming Languages •  How does this modified DFA work? Languages Lecture 1 Lecture 1 –  Must not just accept, but accept and tell us which RE Course generated the string (i.e., which token we found). Course Mechanics Mechanics ML Variable Bindings –  Iden:fy the token by the final state we end in. ML Variable Bindings •  What if our DFA final state corresponds to mul:ple REs from the original? Grossman Dan Grossman Dan Fall 2011 •  This can happen if text matches mul'ple tokens. E.g., “for” may Fall 2011 match the for keyword RE and the iden:fier RE. Compiler writer must define priority order (e.g., keywords > IDs). –  Must also find longest match...
View Full Document

This document was uploaded on 04/04/2014.

Ask a homework question - tutors are online