DOC PREVIEW
CSU CS 453 - Study Guide

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CS453 Intro and PA1 1CS453 Lecture Introduction and Lexing 2Plan for Today Motivation– Why study compilers? Programming Assignment Overview– The compiler we will be building Lexing/Scanning– Representing tokens with regular expressions– Using DFAs to recognize a string of tokensCS453 Lecture Introduction and Lexing 3CS453 Lecture Introduction and Lexing 4Structure of the MiniJava Compiler“sentences”Synthesiscanonicalizationinstruction selectionAssemIRTIR code generationIRTAnalysischaracter streamlexical analysis“words”tokenssemantic analysissyntactic analysisASTAST and symbol tablecode generationMIPSPA2PA3 and PA4PA5 and PA6PA7PA7PA8PA8CS453 Lecture Introduction and Lexing 5Specifying Tokens with SableCC Theory meets practice:– Regular expressions, formallanguages, grammars, parsing… SableCC example input file: Package minijava; Helpers all = [0..0xFFFF]; cr = 13; digit = ['0'..'9']; letter = ['a'..'z'] | ['A'..'Z']; underscore = ’_’; not_star = [all - '*']; not_star_slash = [not_star - '/']; c_comment = '/*' not_star* ('*'(not_star_slash not_star*)?)* '*/'; Tokens plus = '+'; if = 'if'; id = letter (letter | digit | underscore)*; blank = (' ' | eol | tab)+; comment = c_comment | line_comment; Ignored Tokens blank, comment;CS453 Intro and PA1 2CS453 Lecture Introduction and Lexing 6Example DFA for Recognizing a String of


View Full Document

CSU CS 453 - Study Guide

Download Study Guide
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Guide and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Guide 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?