1. Homepage
  2. Programming
  3. Compiler Prinicples and Construction Homework 1: scanner

Compiler Prinicples and Construction Homework 1: scanner

Engage in a Conversation
MUSTCompiler Prinicples and ConstructionScannerCPyrDFA-based algorithm

Homework 1: scanner 

2023 FAll CourseNana.COM

1. Introduction 

We will construct a lexical analyzer, also called a scanner for the specified source language Pyr. CourseNana.COM

2 Helpful files 

Some helpful files can be found at the Moodle site of this course at our university, under the section "Slides and Handouts". CourseNana.COM

  • Files of Pyr: The specification documents and sample-program (.arr) files of Pyr, which are explained in classroom, are on Moodle. Please read and understand these files.
  • Files of C-minus: Some sample programs (.cm) files of the C-minus language can be found at the Moodle site. Also uploaded are the output record (.txt) files of a scanner for the C-minus language. These files can show the expected behavior of a scanner for Pyr. An output file is recorded using a command like:
    scanner_file_name program_name.cm > output_file_name.txt
    • Note: we want to build a scanner for the Pyr language, not for C-minus.
    • Note: you can decide the details of your scanner. As long as your scanner can obtain a list of tokens and print them out properly (like the behavior of a scanner for C-minus), it is okay.
  • Scanner algorithm: A folder of "A simple DFA-based scanner algorithm" is on the Moodle site, which describes a DFA-based algorithm to build a scanner, which can be helpful to implement a scanner with high quality.
  • Helpful C code: Implementing the compiler using C is recommended. Some helpful .c files are on Moodle, which can guide the implementation of a scanner for Pyr (customization and extensions are needed).

Implementing the scanner 

Expected behavior of the scanner 

Test your scanner with each of the provided sample language Pyr files (.arr), making sure that the correct list of tokens can be built and printed. CourseNana.COM

How to submit 

  • Files to be submitted on Moodle:
    • All source code files (.c and .h if using C to write the scanner).
    • A "hmk1-report" text file. The format can be .txt, .docx, .pdf, or .html. This file should describe the following:
      • The full names of each group member.
      • What features of the scanner are successfully implemented?
      • If there are some remaining problems, what are they?
      • If the number of group members is more than one, describe each group member's workload and contribution in detail.
        • Note: We do not want one member to do all the work or one member to do nothing.
  • Submit before Nov 11, Saturday, 9 p.m.
  • At most, three students can form a group to do the homework together and submit the homework together with an email. You are encouraged to do the homework alone (a one-person group).

References 

  1. "Among the Automata"  https://www.theparisreview.org/blog/2012/05/22/among-the-automata/

Get in Touch with Our Experts

WeChat WeChat
Whatsapp WhatsApp
MUST代写,Compiler Prinicples and Construction代写,Scanner代写,C代写,Pyr代写,DFA-based algorithm代写,MUST代编,Compiler Prinicples and Construction代编,Scanner代编,C代编,Pyr代编,DFA-based algorithm代编,MUST代考,Compiler Prinicples and Construction代考,Scanner代考,C代考,Pyr代考,DFA-based algorithm代考,MUSThelp,Compiler Prinicples and Constructionhelp,Scannerhelp,Chelp,Pyrhelp,DFA-based algorithmhelp,MUST作业代写,Compiler Prinicples and Construction作业代写,Scanner作业代写,C作业代写,Pyr作业代写,DFA-based algorithm作业代写,MUST编程代写,Compiler Prinicples and Construction编程代写,Scanner编程代写,C编程代写,Pyr编程代写,DFA-based algorithm编程代写,MUSTprogramming help,Compiler Prinicples and Constructionprogramming help,Scannerprogramming help,Cprogramming help,Pyrprogramming help,DFA-based algorithmprogramming help,MUSTassignment help,Compiler Prinicples and Constructionassignment help,Scannerassignment help,Cassignment help,Pyrassignment help,DFA-based algorithmassignment help,MUSTsolution,Compiler Prinicples and Constructionsolution,Scannersolution,Csolution,Pyrsolution,DFA-based algorithmsolution,