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爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          91久久精品国产91久久| 亚洲第一二三四五区| 久久一区二区精品| 亚洲电影激情视频网站| 欧美另类videos死尸| 亚洲视频免费在线观看| 国产一区二区三区在线观看视频| 久久亚洲风情| 中国日韩欧美久久久久久久久| 国产精品久久一卡二卡| 久久精品视频导航| 夜夜爽www精品| 国产一区二区三区在线播放免费观看 | 鲁大师成人一区二区三区| 亚洲精品在线二区| 国产伦精品一区二区三| 久热精品视频| 亚洲天堂av综合网| 亚洲国产精品久久久久| 国产精品国内视频| 蜜桃久久av| 午夜精品久久一牛影视| 亚洲精品国偷自产在线99热| 国产精品女主播在线观看| 欧美aⅴ一区二区三区视频| 亚洲欧美一区二区在线观看| 亚洲国产精品福利| 国产精品一区二区在线观看不卡| 欧美不卡视频一区| 久久se精品一区二区| 9色精品在线| 在线观看福利一区| 国产亚洲欧美日韩日本| 女同性一区二区三区人了人一| 亚洲一区二区动漫| 亚洲欧洲综合| 影音先锋日韩精品| 国产欧美一区二区精品仙草咪| 欧美黄色aa电影| 久久精品最新地址| 午夜精彩国产免费不卡不顿大片| 亚洲免费观看高清完整版在线观看熊| 狠狠综合久久av一区二区老牛| 国产精品日本| 欧美午夜剧场| 欧美风情在线观看| 久久久高清一区二区三区| 午夜在线观看免费一区| 中日韩午夜理伦电影免费| 91久久在线观看| 亚洲国产片色| 国产在线高清精品| 国产欧美日本| 国产精品久久久久久久一区探花| 欧美区国产区| 欧美激情中文字幕一区二区| 猫咪成人在线观看| 欧美69视频| 欧美电影打屁股sp| 欧美 日韩 国产在线| 久久亚洲精品伦理| 久久中文在线| 老鸭窝亚洲一区二区三区| 久久精品国亚洲| 久久精品国产久精国产一老狼 | 久久精品免费观看| 欧美诱惑福利视频| 久久精品国产亚洲a| 久久精品国产999大香线蕉| 久久精品国产久精国产一老狼| 欧美在线视频在线播放完整版免费观看| 午夜精品久久久久久久| 欧美中文字幕不卡| 快射av在线播放一区| 免费亚洲网站| 欧美日韩一区二区三区在线| 欧美日韩精选| 国产精品日日摸夜夜添夜夜av| 国产精品视频免费观看www| 国产亚洲视频在线观看| 在线国产欧美| 一区二区三区 在线观看视频| 亚洲深夜福利视频| 欧美影院成年免费版| 久久五月激情| 欧美日韩精品免费观看视频| 国产精品另类一区| 狠狠色丁香久久婷婷综合丁香 | 亚洲一区在线播放| 久久精品国产清自在天天线| 狼人天天伊人久久| 欧美日韩亚洲一区二区三区| 国产欧美日韩综合一区在线播放| 国产一区二区三区视频在线观看| 亚洲人成网站色ww在线| 亚洲女人天堂av| 久久综合久久久| 欧美视频一区二区在线观看 | 亚洲黄色天堂| 亚洲欧美日韩国产一区| 久久躁狠狠躁夜夜爽| 欧美日韩在线免费| 国外视频精品毛片| 在线亚洲+欧美+日本专区| 久久久99国产精品免费| 欧美日韩在线不卡| 红桃视频国产一区| 亚洲一区精品电影| 欧美a级在线| 国产乱码精品| 一本一本a久久| 久久婷婷麻豆| 国产欧美日韩综合| 99国产精品国产精品毛片| 久久精品一区二区三区四区| 欧美日韩在线直播| 影音先锋另类| 欧美一二区视频| 欧美日韩色婷婷| 亚洲国产精品一区二区www| 性色av一区二区三区红粉影视| 欧美精品激情blacked18| 精品91在线| 欧美一区二区女人| 国产精品久久久久久久7电影| 亚洲日本aⅴ片在线观看香蕉| 久久精品国产96久久久香蕉| 国产精品久久久久久久久免费| 亚洲激情视频网站| 久久先锋资源| 韩国av一区二区三区四区| 亚洲尤物视频在线| 欧美日一区二区三区在线观看国产免| 在线视频观看日韩| 久久久久久夜| 国产一区二区日韩精品| 亚洲欧美日韩在线观看a三区| 欧美日韩人人澡狠狠躁视频| 91久久视频| 欧美成人亚洲| 亚洲国产精品久久精品怡红院| 久久精品综合| 黄色成人免费网站| 久久久久se| 伊人久久噜噜噜躁狠狠躁| 久久精品国产亚洲一区二区| 国产精品永久免费观看| 亚洲综合视频一区| 国产精品手机视频| 欧美亚洲视频一区二区| 国产乱码精品| 欧美一区二区三区的| 国产日韩精品一区二区| 翔田千里一区二区| 国产亚洲精品aa| 久久精品人人做人人爽电影蜜月| 国产一区二区按摩在线观看| 久久经典综合| 在线欧美日韩| 欧美国产成人精品| 夜夜精品视频| 国产精品网站在线观看| 性欧美videos另类喷潮| 国产亚洲一区在线播放| 久久久久一区| 亚洲激情欧美| 欧美日韩一区三区四区| 亚洲一二三四区| 国产亚洲免费的视频看| 麻豆精品视频| 一二三区精品福利视频| 国产精品国产三级国产专播品爱网| 亚洲男女毛片无遮挡| 国产欧美日韩综合精品二区| 巨乳诱惑日韩免费av| 一本色道久久99精品综合| 国产精品一二三四| 久久综合伊人| 99国产精品久久久久老师| 国产精品欧美激情| 久久婷婷久久| 亚洲视频在线观看网站| 国模 一区 二区 三区| 欧美精品七区| 欧美一区二区网站| 亚洲三级免费电影| 国产欧美日韩麻豆91| 欧美成年人视频网站| 亚洲午夜91| 韩日精品视频一区| 欧美日韩国语| 久久精品一区二区| 一本到12不卡视频在线dvd| 国产有码一区二区| 欧美日韩国产a| 久久久亚洲一区| 亚洲一区二区三区在线播放| 一区二区三区在线免费观看| 欧美日在线观看| 免费观看成人|