99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

代做COP 3402、代寫Python/c++語言程序
代做COP 3402、代寫Python/c++語言程序

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



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

Homework #2 (Lexical Analyzer)
 
Due Sunday, February 16th, 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.

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)

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
    y := 3;
    x := y + 56;
end.

Lexeme Table:

lexeme    token type     
var        29        
x        2
,        17        
y        2
;        18
begin        21
y        2
:=        20
3        3
;        18
x        2
:=          20        
y        2
+        4
56        3
;        18
end         22
.        19

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. 

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




 

掃一掃在手機打開當前頁
  • 上一篇:CP414編程代寫、代做Java/Python程序
  • 下一篇:代做Operating Systems 、代寫C++程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                成人听书哪个软件好| 国产精品入口麻豆九色| 国产大陆亚洲精品国产| 国产精品第五页| 亚洲一区二区精品久久av| 亚洲国产精品一区二区久久| 亚洲第一综合色| 老司机精品视频一区二区三区| 国产精品国产自产拍在线| 精品国产乱码久久久久久图片| 亚洲欧美另类图片小说| 中文字幕日本乱码精品影院| 亚洲精品一区二区三区香蕉| 午夜精品一区二区三区电影天堂 | 99精品热视频| 亚欧色一区w666天堂| 色偷偷久久一区二区三区| 久久在线免费观看| 黄色日韩网站视频| 欧美美女一区二区三区| 欧美夫妻性生活| 亚洲一区av在线| 不卡av在线免费观看| 日韩不卡一区二区三区| 精品捆绑美女sm三区| 99精品在线免费| 国产精品免费久久久久| 成人av在线网站| 激情综合色综合久久| 国产精品久久久久久妇女6080| 欧美丝袜丝交足nylons| 91丨九色porny丨蝌蚪| 中文字幕一区二区三区不卡在线| 91精品在线麻豆| 欧美极品另类videosde| 91视频一区二区三区| 国产精品一区二区无线| 成人免费毛片高清视频| 成人免费视频视频在线观看免费| 成人午夜碰碰视频| 国产麻豆一精品一av一免费| 成人精品小蝌蚪| 97精品视频在线观看自产线路二| 色综合久久九月婷婷色综合| 337p日本欧洲亚洲大胆精品| 色婷婷一区二区| 中文字幕在线视频一区| 久久精品免费观看| 欧美一区二区精品在线| 亚洲国产aⅴ成人精品无吗| 国产综合色精品一区二区三区| 日韩激情一二三区| 精品亚洲porn| 国产99久久久国产精品潘金网站| 亚洲精品亚洲人成人网在线播放| 精品免费日韩av| 日韩午夜在线观看| 一区二区三区在线观看欧美| 中文字幕第一区第二区| 日韩理论片一区二区| 亚洲国产综合色| 色一情一伦一子一伦一区| 欧美日韩黄色影视| 亚洲电影视频在线| 国产成人三级在线观看| 精品久久久久久亚洲综合网| 美女视频网站黄色亚洲| 欧美日韩在线电影| 精品成人一区二区| 亚洲天堂精品视频| 93久久精品日日躁夜夜躁欧美| 国产视频不卡一区| 国产suv精品一区二区883| 欧美日韩国产一级片| 国产人久久人人人人爽| 亚洲人成网站精品片在线观看| 欧美日韩国产一区| 国产精品12区| 久久久国产一区二区三区四区小说| 美国三级日本三级久久99| 亚洲最新在线观看| 中文字幕av一区二区三区| 精品视频一区 二区 三区| 午夜久久电影网| 蜜桃视频在线观看一区二区| 日韩一区二区在线观看视频播放| 国产精品国产三级国产普通话99| 欧美mv和日韩mv国产网站| 亚洲一级在线观看| 韩国v欧美v亚洲v日本v| 国产精品视频免费| 欧美亚洲一区三区| 国产99久久久国产精品| 欧美精品少妇一区二区三区 | 国产精品蜜臀av| 国产精品一二三区在线| 亚洲老司机在线| 喷水一区二区三区| 夜夜精品视频一区二区| 欧美偷拍一区二区| 中文字幕久久午夜不卡| 国产成人免费视频| www.欧美亚洲| 亚洲综合视频在线| 制服丝袜日韩国产| 国产亚洲欧美色| 久久这里只有精品6| 欧美精品一区二区高清在线观看| 91首页免费视频| 国产精品色呦呦| 欧美精品18+| 欧美三级日韩三级| 成人激情电影免费在线观看| 国产精品一区二区在线观看网站| 欧美专区亚洲专区| 国产精品综合在线视频| 午夜在线成人av| 亚洲第一福利一区| 亚洲精品高清视频在线观看| 国产精品二区一区二区aⅴ污介绍| 欧美国产日韩亚洲一区| 91一区二区三区在线播放| 婷婷国产v国产偷v亚洲高清| 亚洲欧洲国产日韩| 国产精品乱码妇女bbbb| 久久久久成人黄色影片| 国产亚洲综合性久久久影院| 精品视频一区二区三区免费| 日韩视频一区二区在线观看| 欧美美女一区二区| 欧美精品一区二区三区一线天视频 | 欧美日韩国产精品成人| 欧美专区日韩专区| 欧美日韩国产综合一区二区三区| 欧美一区二区三级| 国产精品入口麻豆原神| 奇米亚洲午夜久久精品| www.性欧美| 国产亚洲欧美色| 国产在线精品不卡| 国产女主播一区| 亚洲伦理在线精品| 亚洲国产日日夜夜| 日韩欧美一二区| 色综合色综合色综合| 天天av天天翘天天综合网| 9i在线看片成人免费| 欧美性大战xxxxx久久久| 欧美又粗又大又爽| 777亚洲妇女| 欧美日韩dvd在线观看| 久久久久国产精品厨房| 亚洲另类春色校园小说| 久久国产成人午夜av影院| 不卡视频一二三| 国产欧美一区二区在线观看| 国产精品沙发午睡系列990531| 亚洲香肠在线观看| xnxx国产精品| 偷拍亚洲欧洲综合| 丁香啪啪综合成人亚洲小说| 欧美乱妇一区二区三区不卡视频| 国产日韩欧美一区二区三区综合| 国产剧情一区二区| 欧美在线观看视频一区二区| 欧美一区二区在线视频| 久久免费国产精品| 天堂影院一区二区| 欧美猛男男办公室激情| 欧美二区在线观看| 国产综合色产在线精品| 国产亚洲精品资源在线26u| 国产成人av影院| 一区二区三区.www| 99国产一区二区三精品乱码| 国产精品国产三级国产a| 91蜜桃在线免费视频| 久久99国产精品免费| 一区二区三区欧美日韩| 制服丝袜亚洲网站| 国产成人免费在线视频| 亚洲欧洲在线观看av| 欧美午夜片在线看| 蜜臀久久久久久久| 亚洲一区二区综合| 一区二区三区精品| 欧美久久久久久蜜桃| 国产成人亚洲综合a∨猫咪| 国产精品女同一区二区三区| 91精品国产综合久久精品图片| 久久99国产精品免费| 亚洲国产成人porn| 亚洲婷婷国产精品电影人久久| 一本在线高清不卡dvd| 国产真实乱对白精彩久久| 中文字幕不卡在线播放| 欧美日韩国产精品成人| 国产91精品欧美| 国产美女一区二区| 国产a区久久久|