国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

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

代做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++程序語言
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    麻豆乱码国产一区二区三区| 一本久道久久综合狠狠爱亚洲精品| 欧美成人亚洲成人日韩成人| 日韩免费不卡av| 9a蜜桃久久久久久免费| 久久99久久99精品中文字幕| 韩国精品久久久999| 播播国产欧美激情| 人人妻人人添人人爽欧美一区 | 99re在线视频上| 欧美成人午夜剧场免费观看| 国模杨依粉嫩蝴蝶150p| 俺去了亚洲欧美日韩| 五码日韩精品一区二区三区视频 | 欧美无砖专区免费| 久久久久五月天| 日韩欧美视频第二区| 久草热视频在线观看| 人妻久久久一区二区三区 | 日韩一区二区三区高清| 国产精品∨欧美精品v日韩精品| 一区二区三区四区五区视频| 国产伦精品一区二区三区四区免费 | 国产偷久久久精品专区| 免费av一区二区| 成人免费在线小视频| 中文字幕中文字幕在线中一区高清| 国产肉体ⅹxxx137大胆| 欧美日韩成人精品| 99精品视频播放| 性欧美激情精品| 久久久久久久久网站| 欧美资源一区| 久久夜色精品国产亚洲aⅴ| 国产中文一区二区| 亚洲综合日韩在线| 久久久天堂国产精品女人| 日日摸天天爽天天爽视频| 日韩有码在线视频| 麻豆av一区二区三区久久| 国产精品电影在线观看| 国产精选久久久久久| 懂色中文一区二区三区在线视频| 国产黄视频在线| 欧美日韩二三区| 九九精品在线观看| 国产成人一区二区三区免费看| 人妻无码视频一区二区三区| 国产精品久久激情| www.九色.com| 人妻熟女一二三区夜夜爱| 国产精品第一页在线| 成人精品久久久| 日韩欧美亚洲在线| 九九精品在线视频| 久久亚洲a v| 狠狠爱一区二区三区| 亚洲熟妇无码一区二区三区导航 | 日韩在线www| 国产免费一区二区三区在线观看 | 国产精品嫩草影院久久久| 国产精品永久入口久久久| 日韩精品久久久| 欧美大胆在线视频| 久久99精品久久久久久水蜜桃| 蜜桃成人免费视频| 亚洲精品成人久久久998| 久久久久www| 久久综合毛片| 国产日韩欧美在线看| 日本va中文字幕| 欧美精品国产精品日韩精品| 久久久久久久香蕉网| 成人福利视频网| 激情视频在线观看一区二区三区| 亚洲国产精品www| 国产精品久久av| 久久婷婷国产精品| 国产精品一区二区三区不卡 | 欧美在线亚洲在线| 亚洲电影一二三区| 九色91av视频| 国产精品久久激情| www.xxxx精品| 久久免费一级片| 成人国产精品色哟哟| 精品一区二区三区日本| 日本va中文字幕| 午夜欧美大片免费观看| 欧美激情视频在线免费观看 欧美视频免费一| 114国产精品久久免费观看| 国产一区二区三区乱码| 日本不卡一区二区三区四区 | 午夜啪啪福利视频| 亚洲五月六月| 精品高清视频| 国产精品久久久久久亚洲调教| 国产成人一区二区三区免费看| 99国产在线视频| 成人精品视频在线播放| 国产日韩欧美日韩| 国产在线精品日韩| 国内精品久久久久影院优| 欧美一区二区影院| 青青草成人在线| 日本精品一区二区三区高清 久久| 中文字幕中文字幕一区三区| 九九热视频这里只有精品| 国产精品国产精品国产专区蜜臀ah| 国产成人免费av| 国产成人拍精品视频午夜网站| 久久久噜噜噜久噜久久| 国产精品8888| 97国产在线播放| 成人a级免费视频| 国产精品自拍偷拍| 成人免费在线网址| 成人av播放| 91精品天堂| 91精品国产自产91精品| 91九色在线观看| 97精品伊人久久久大香线蕉| 91久久久在线| 国产高清在线不卡| 久久av喷吹av高潮av| 久操手机在线视频| 久久精品成人动漫| 国产精品久久7| 久久成年人免费电影| 欧美精品videos| 亚洲影视九九影院在线观看| 春色成人在线视频| 日韩免费在线看| 黄色一级视频播放| 国产伦精品一区二区三区免| 成人精品久久av网站| 国产免费一区二区三区香蕉精 | 国产精品久久久久久久久久久久久 | 九九九九免费视频| 国产精品视频永久免费播放| 国产精品免费一区二区三区四区 | 精品人妻大屁股白浆无码| 欧美精品久久| 精品少妇人妻av免费久久洗澡| 国产视频精品网| 99精品视频在线看| 久久久久五月天| 国产精品免费一区二区三区在线观看 | 午夜免费福利小电影| 日韩精品―中文字幕| 狠狠色噜噜狠狠狠狠色吗综合| 国产欧美日韩伦理| 久久精品中文字幕一区二区三区| 精品国偷自产在线视频| 国产精品国产三级国产专区53| 最新欧美日韩亚洲| 日本高清一区| 国产在线播放不卡| 久久久亚洲国产天美传媒修理工| 日韩中文字幕免费| 欧美精品制服第一页| 春色成人在线视频| 黄色一级大片在线观看| 成人免费视频97| 久久精品国产一区二区三区| 色综合视频网站| 日韩免费在线播放| 国产美女三级视频| 久久久噜噜噜久久久| 久久av红桃一区二区小说| 日本一区二区久久精品| 国产亚洲精品网站| 久久久久久久久亚洲| 宅男一区二区三区| 欧美在线一区视频| 97精品国产91久久久久久| 国产精品私拍pans大尺度在线 | 久久人人爽人人爽爽久久| 一区精品在线| 欧美一级电影久久| 国产精品99久久久久久大便| 久久亚洲综合国产精品99麻豆精品福利 | 欧美精品在线一区| 91免费看片在线| 国产精品久久久久久搜索| 欧美一级欧美一级| 国产欧美婷婷中文| 国产成人精品一区二区三区| 亚洲视频导航| 国产一区二区免费电影| 久久久久久久久久亚洲| 亚洲欧美国产不卡| 国产在线观看精品一区二区三区| 久草热久草热线频97精品| 久久久久久91| 国产在线播放不卡| 国产精品日韩欧美一区二区| 日本在线观看一区二区| 官网99热精品| 国产精品美女网站|