91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

COP 3402代做、代寫Java/C++程序
COP 3402代做、代寫Java/C++程序

時間:2025-06-15  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



University of Central Florida
School of Electrical Engineering & Computer Science
COP 3402: System Software
Summer 2025

Homework #2 (Lexical Analyzer)
(Team max. two students) 

Due Sunday, June 14th, 2025 by 11:59 p.m. 

Goal:
In this assignment your team have to implement a lexical analyzer for the programming language PL/0. Your program must be capable to read in a source program written in PL/0, identify some errors, and produce, as output, the source program, the source program lexeme table, and the token list. For an example of input and output refer to Appendix A. In the next page we show you the grammar for the programming language PL/0 using the extended Backus-Naur Form (EBNF).

You will use the given Context Free Grammar (see next page) to identify all symbols the programming language provides you with.  These symbols are shown below:

Reserved Words: const, var, procedure, call, begin, end, if, fi, then, else, while, do, read, write.        
Special Symbols: ‘+’, ‘-‘, ‘*’, ‘/’, ‘(‘, ‘)’, ‘=’, ’,’ , ‘.’, ‘ <’, ‘>’,  ‘;’ , ’:’ .
Identifiers: identsym = letter (letter | digit)* 
Numbers: numbersym = (digit)+
Invisible Characters: tab, white spaces, newline
Comments denoted by: /* . . .   */

Refer to Appendix B for a declaration of the token symbols that may be useful.

In this assignment, you will not check syntax.

Example1: program written in PL/0:

var x, y;
x := y * 2.

Use these rules to read PL/0 grammar expressed in EBNF.

1.- [ ] means an optional item, 
2.- { } means repeat 0 or more times.
3.- Terminal symbols are enclosed in quote marks.
4.- Symbols without quotes are called no-terminals or a syntactic class.
5.-A period is used to indicate the end of the definition of a syntactic class.
6.-The symbol ‘::=’ is read as ‘is defined as’; for example, the following syntactic class:

program ::= block ".".  

must be read as follows: 
a program    is defined as    a block followed by a   dot.
   program             ::=                   block                                ".".  

Context Free Grammar for PL/0 expressed in EBNF.

program ::= block "." . 
block ::= const-declaration  var-declaration  proc-declaration statement.    
const-declaration ::= [ “const” ident "=" number {"," ident "=" number} “;"].    
var-declaration  ::= [ "var" ident {"," ident} “;"].
proc-declaration::= {"procedure" ident ";" block ";" } .
statement   ::= [ ident ":=" expression
| "call" ident
              | "begin" statement { ";" statement } "end" 
              | "if" condition "then" statement "fi"
        | "if" condition "then" statement “else" statement "fi"
             | "while" condition "do" statement
        | “read” ident
| “write” ident
              | empty ] . 
 
condition ::=  expression  rel-op  expression.
  
rel-op ::= "="|“<>"|"<"|"<="|">"|">=“.
expression ::= term { ("+"|"-") term}.
term ::= factor {("*"|"/") factor}. 
factor ::= ident | number | "(" expression ")“.

In this assignment, you will identify valid PL/0 symbols and then translate them into an internal representation called “Tokens”.

Lexical Grammar for PL/0 expressed in EBNF.

ident ::= letter {letter | digit}.
letter ::= "a" | "b" | … | "y" | "z" | "A" | "B" | ... | "Y" | "Z".
number ::= digit {digit}.
digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9“.

Lexical Conventions for PL/0:
A numerical value is assigned to each token (internal representation) as follows: 
skipsym = 1, identsym = 2, numbersym = 3, plussym = 4, minussym = 5, 
multsym = 6,  slashsym = 7, fisym = 8,  eqlsym = 9, neqsym = 10, lessym = 11, leqsym = 12, gtrsym = 13, geqsym = 14, lparentsym = 15, rparentsym = 16, commasym = 17, semicolonsym = 18, periodsym = 19, becomessym = 20, 
beginsym = 21, endsym = 22, ifsym = 23, thensym = 24, whilesym = 25, dosym = 26, callsym = 27, constsym = 28, varsym = 29, procsym = 30, writesym = 31, 
readsym = 32, elsesym = 33.


Example2: program written in PL/0:

var w, x;
read w;
begin
   x:= 4;
   if w > x then
    w:= w + 1
   else
    w:= x;
   fi
end
write w. 


Remember, in this assignment, you will not check syntax.

For the scanner 
x := y + 7;          and          + 7 ; x y :=   are valid inputs
Constraints:
Input:
1.Identifiers can be a maximum of 11 characters in length.
2.Numbers can be a maximum of 5 digits in length.
3.Comments should be ignored and not tokenized.
4.Invisible Characters should be ignored and not tokenized.

Output:
1.The token separator in the output's Lexeme List (Refer to Appendix A) can be either a space or a bar ('|').
2.In your output's Lexeme List, identifiers must show the token and the variable name separated by a space or bar.
3.In your output's Token list, numbers must show the token and the value separated by a space or bar. The value must be transformed into ASCII Representation.
4.Be consistent in output. Choose either bars or spaces and stick with them.
5.The token representation of the Token list will be used in the Parser (HW3). So, PLAN FOR IT!

Detect the Following Lexical Errors:

1.Number too long.
2.Name too long.
3.Invalid symbols.

When an error is detected, an error message must be printed, and the scanner continues running. For example:

lexeme                token type
$        “Error: invalid symbol” 


Hint: You could create a transition diagram (DFS) to recognize each lexeme on the source program and once accepted generate the token, otherwise emit an error message.
 
Submission Instructions:
Submit to Webcourse:
1. Source code. (lex.c) 
2. Instructions to use the program in a readme document.
3. One run containing the input file (Source Program), and output file. The output file must show:  
 (Source,  Lexeme Table(lexeme-token), Token List)

    When errors are found, do not print out the Token list.

Appendix A:

If the input is:
var x, y;
begin
    y := 3;
    x := y + 56;
end.

The output will be:
Source Program:
var x, y;
begin
Token List:
29 2 x 17 2 y 18 21 2 y 20 3 3 18 2 x 20 2 y 4 3 56 18 22 19
 
Appendix B:

Declaration of Token Types:
typedef enum { 
skipsym = 1, identsym, numbersym, plussym, minussym,
multsym,  slashsym, fisym, eqsym, neqsym, lessym, leqsym,
gtrsym, geqsym, lparentsym, rparentsym, commasym, semicolonsym,
periodsym, becomessym, beginsym, endsym, ifsym, thensym, 
whilesym, dosym, callsym, constsym, varsym, procsym, writesym,
readsym , elsesym} token_type;

Example of Token Representation:
“29  2 x  17  2 y 18  21  2 x 21  2 y 4  3 56 18  22  19”

Is Equivalent:
varsym identsym  x  commasym  identsym  y  semicolonsym  beginsym  identsym  x
becomessym identsym y plussym numbersym 56 semicolonsym endsym periodsym

Appendix C:

Example of a PL/0 program: 
const m = 7, n = 85;  
var  i,x,y,z,q,r;  
procedure mult; 
   var a, b;  
  begin 
     a := x;  b := y; z := 0;   
     while b > 0 do    
     begin 
        if x =1 then z := z+a fi;       
        a := 2*a; 
        b := b/2;     
     end   
  end;

begin
  x := m;
  y := n;
  call mult;
end.

Find out the output for this example!

Rubric:

Integrity:
Plagiarism or Resubmission of Old Programs: -100 points
Compilation & Execution:
Programs That Don't Compile: -100 points
Program Cannot Reproduce any output in the terminal: -10 points
Program is white-space dependent: -10 points
For example, a+b should be properly tokenized.
For example, 4hello is two tokens: a number and an identifier.
Submission Files:
Missing lex.c: -100 points
Missing readme File: -5 points
Missing Input or Output File: -5 points
Partial Missing: -2.5 points for either input or output file
Lexical Error Detection:
Not Detecting All Three Lexical Errors: -15 points
Each lexical error detection is worth 5 points.
Output Formatting:
Output Significantly Unaligned with Appendix A: -5 points
Late Submissions:
One Day Late: -10 points
Two Days Late: -20 points

No email submission will be accepted. 

If an extension is given, Late policy does not apply.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp


 

掃一掃在手機打開當前頁
  • 上一篇:代寫MATH3831、代做Python/C++程序
  • 下一篇:618 NMN品牌終極戰!三井制藥NMN現象級表現成為養顏抗衰領域定海神針
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    91精品国产91久久久久久_国产精品二区一区二区aⅴ污介绍_一本久久a久久精品vr综合_亚洲视频一区二区三区
    亚洲高清免费视频| 久久这里只有| 久久久7777| 5566中文字幕一区二区电影| 日本一区二区视频在线| 午夜视频一区二区| 91视视频在线观看入口直接观看www | 一本一本久久a久久精品综合麻豆| 欧美日本精品一区二区三区| 国产精品亲子伦对白| 国内精品免费**视频| 一区视频在线| 91精品国产综合久久精品性色| 亚洲视频网在线直播| 国产成人一区在线| 先锋影音久久久| 国产情人综合久久777777| 青青草视频一区| 在线观看福利一区| 日韩欧美卡一卡二| 天天综合网天天综合色| 欧美激情第10页| 91精品国产综合久久婷婷香蕉| 亚洲国产人成综合网站| 91农村精品一区二区在线| 欧美日韩一区二区三区在线| 一区二区在线观看免费视频播放| 成人激情综合网站| 欧美日韩另类国产亚洲欧美一级| 一个色妞综合视频在线观看| 色综合久久综合中文综合网| 欧美人妇做爰xxxⅹ性高电影| 一区二区三区四区视频精品免费| 欧美成人蜜桃| 一区二区三区日韩欧美| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 精品国产成人在线影院| 久久99久久99精品免视看婷婷| 国产日韩欧美一区| **欧美大码日韩| 欧美日韩午夜| 久久久久九九视频| 成人免费av网站| 91精品国产免费| 精品一区二区三区在线播放| 久久综合激情| 舔着乳尖日韩一区| 午夜亚洲一区| 亚洲精品免费在线播放| 亚洲国产精品综合| 国产精品福利在线播放| 欧美人与禽猛交乱配| 久久久精品欧美丰满| 99精品在线免费| 欧美精品一区二区蜜臀亚洲| 国产成人精品免费网站| 日韩一区二区三区四区| 国产精品一区二区你懂的| 欧美巨大另类极品videosbest | 亚洲精品亚洲人成人网在线播放| 亚洲午夜在线| 亚洲男人天堂一区| 国产欧美高清| 天堂在线亚洲视频| 在线视频一区二区免费| 久久精品免费观看| 欧美老肥妇做.爰bbww视频| 国产精品一区二区久激情瑜伽 | 欧美国产三区| 亚洲国产精品传媒在线观看| 亚洲无毛电影| 亚洲一区二区三区在线播放| 亚洲欧美日韩一区在线观看| 青青草97国产精品免费观看 | 影院欧美亚洲| 亚洲在线成人精品| 在线观看中文字幕不卡| 国产一区二区三区久久久| 欧美大片国产精品| 欧美日韩网站| 性久久久久久久久久久久| 欧美性受xxxx| www.亚洲激情.com| 亚洲视频一区二区免费在线观看| 国产精品亚洲不卡a| 久久精品国产亚洲高清剧情介绍| 欧美一区二区在线免费播放| 91在线观看污| 一区二区三区色| 欧美老肥妇做.爰bbww| 欧美 日韩 国产 一区| 亚洲黄色性网站| 欧美三级电影一区| 99re66热这里只有精品3直播| 中文字幕在线免费不卡| 老司机午夜精品视频| 国产成人av电影在线| 中文字幕日本不卡| 久久亚洲风情| 成人avav在线| 亚洲一区二区3| 欧美一卡二卡三卡| 亚洲精品男同| 国产精品99久久久久久久女警 | 一本在线高清不卡dvd| 成年人国产精品| 亚洲香肠在线观看| 欧美一级高清片| 国产精品毛片va一区二区三区| 国产自产高清不卡| ...av二区三区久久精品| 欧美日韩视频不卡| 亚洲精品一区二区三| 国内精品伊人久久久久av影院| 国产精品久久久久桃色tv| 欧美午夜电影在线播放| 黑丝一区二区三区| 国产精品91一区二区| 亚洲欧美日韩一区二区| 日韩一区二区免费高清| 91精品麻豆日日躁夜夜躁| 黄色日韩在线| 国产成人鲁色资源国产91色综 | 8x8x8国产精品| 亚洲国产电影| av爱爱亚洲一区| 蜜桃av噜噜一区| 亚洲三级在线免费| 精品国产一区二区三区久久久蜜月 | 日韩国产在线观看| 国产精品成人午夜| 欧美成人伊人久久综合网| 久久国产免费| 亚洲激情亚洲| 91视频com| 国产精品1区2区3区| 亚欧色一区w666天堂| 国产精品久久久久aaaa| 精品久久久久久综合日本欧美| 色88888久久久久久影院按摩| 红桃视频国产精品| 99精品视频在线免费观看| 韩日欧美一区二区三区| 石原莉奈一区二区三区在线观看| 欧美国产乱子伦 | 99视频在线精品国自产拍免费观看| av中文一区二区三区| 五月天欧美精品| 中文字幕一区二区三区色视频| 日韩欧美一级精品久久| 欧美日韩综合一区| 色视频一区二区| 性色一区二区三区| 一区二区国产精品| 精品福利av| 亚洲小说欧美另类婷婷| 欧美日韩国产综合网| 91免费精品国自产拍在线不卡 | 亚洲特级片在线| 国产精品美女久久久久高潮| 国产区在线观看成人精品| 精品国产91久久久久久久妲己| 日韩一区二区免费视频| 日韩情涩欧美日韩视频| 欧美一区二区三区在线电影| 欧美日韩一区在线| 欧美日韩国产另类一区| 欧美美女一区二区在线观看| 欧美三级日韩三级国产三级| 欧美色综合天天久久综合精品| 在线视频综合导航| 欧美精品一区二区三区四区| 日本道色综合久久| 在线精品视频免费观看| 欧美精品 国产精品| 91精品国产综合久久精品app | 欧美91视频| 好吊日精品视频| 国产欧美日韩在线播放| 免费亚洲一区| 欧美亚洲自拍偷拍| 日韩亚洲欧美在线观看| 久久夜色精品一区| 国产精品美女久久久久久久| 亚洲六月丁香色婷婷综合久久| 亚洲精品久久久久久国产精华液| 中文字幕视频一区| 午夜精品爽啪视频| 狠狠网亚洲精品| eeuss鲁片一区二区三区| 国产精品二区在线观看| 中国成人亚色综合网站| 国产成人av资源| 91丝袜美女网| 最新亚洲激情| 色哟哟精品一区| 日韩欧美一级片| 亚洲欧美在线视频观看| 午夜精品福利一区二区蜜股av | 免费在线欧美视频|