日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

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

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

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

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

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

    日韩精品一区二区三区高清_久久国产热这里只有精品8_天天做爽夜夜做爽_一本岛在免费一二三区

      <em id="rw4ev"></em>

        <tr id="rw4ev"></tr>

        <nav id="rw4ev"></nav>
        <strike id="rw4ev"><pre id="rw4ev"></pre></strike>
        欧美经典一区二区三区| 国产精品免费一区二区三区在线观看| 一本色道久久综合亚洲精品按摩| 欧美人妖在线观看| 免费观看在线综合色| 欧美日韩一区二区国产| 亚洲素人一区二区| 欧美一区二区三区电影在线观看| 久久夜色精品国产欧美乱极品| 国产区精品在线观看| 嫩草成人www欧美| 亚洲视频在线观看网站| 亚洲午夜小视频| 久久全球大尺度高清视频| 久久久另类综合| 国产精品高潮久久| 亚洲三级视频| 亚洲精品裸体| 亚洲国产综合91精品麻豆| 国产精品普通话对白| 欧美成ee人免费视频| 最新国产成人在线观看| 国产精品白丝av嫩草影院| 久久一区亚洲| 国产精品国产精品| 国内成人精品2018免费看| 欧美国产一区在线| 亚洲性av在线| 在线看不卡av| 黄色亚洲网站| 99re视频这里只有精品| 欧美偷拍另类| 香港成人在线视频| 欧美精品 日韩| 欧美日韩亚洲成人| 欧美特黄视频| 国产视频一区在线观看一区免费| 国产一区二区三区在线观看免费| 亚洲精品永久免费精品| 亚洲久久一区二区| 久久精品导航| 国产精品家庭影院| 国产精品色午夜在线观看| 亚洲激情综合| 国产精品综合不卡av| 欧美日韩大片| 国产精品久久久久久影视| 国模套图日韩精品一区二区| 亚洲黄页视频免费观看| 国产欧美日韩精品专区| 亚洲人成在线观看网站高清| 欧美四级在线观看| 亚洲视频免费| 亚洲欧美伊人| 亚洲视屏一区| 国产精品第十页| 欧美激情久久久久久| 最新日韩在线视频| 黑人操亚洲美女惩罚| 国产精品久久久久久久久搜平片| 亚洲欧美日韩一区在线| 亚洲在线成人精品| 国产一区二区三区四区hd| 亚洲一区影音先锋| 欧美人与性动交a欧美精品| 亚洲日本aⅴ片在线观看香蕉| 亚洲欧美综合精品久久成人| 欧美日本一区二区高清播放视频| 久久免费偷拍视频| 亚洲一区图片| 精品成人在线观看| 欧美刺激午夜性久久久久久久| 欧美日韩国产首页在线观看| 黄色一区二区三区四区| 亚洲欧美激情在线视频| 午夜在线观看免费一区| 亚洲欧美日韩在线高清直播| 性欧美暴力猛交69hd| 国内精品久久久久久久影视蜜臀| 免费观看成人| 欧美xart系列高清| 亚洲国产精品久久久久秋霞不卡| 亚洲精品国产精品国自产观看| 久久精品av麻豆的观看方式| 亚洲黄色大片| 亚洲国产精品久久| 午夜久久久久久久久久一区二区| 国产精品久久九九| 国产伦精品一区| 毛片一区二区| 日韩一级免费观看| 国产精品一区二区久激情瑜伽| 欧美三区在线视频| 国产三级精品在线不卡| 性欧美大战久久久久久久免费观看| 欧美午夜激情视频| 亚洲国产国产亚洲一二三| 亚洲午夜日本在线观看| 免费成人激情视频| 国产精品成人免费视频| 亚洲一线二线三线久久久| 一区二区电影免费观看| 国内精品久久久久久久果冻传媒| 欧美国产一区二区三区激情无套| 一二美女精品欧洲| 亚洲欧美日韩综合一区| 久久精品视频免费观看| 一本色道久久88综合日韩精品| 欧美精品激情| 国外成人在线视频网站| 亚洲一区三区在线观看| 国产一区二区高清| 韩国免费一区| 欧美fxxxxxx另类| 免费成人黄色片| 国产精品视频专区| 免费不卡欧美自拍视频| 亚洲欧美高清| 国产欧美日韩综合一区在线观看| 久久蜜臀精品av| 欧美xart系列高清| 久久精品五月婷婷| 国产精品日韩久久久久| 亚洲日本国产| 午夜一级在线看亚洲| 噜噜噜在线观看免费视频日韩| 亚洲区国产区| 日韩视频免费看| 欧美久久九九| 亚洲免费观看高清完整版在线观看| 午夜精品久久久久影视| 欧美色视频日本高清在线观看| 亚洲经典在线| 老司机精品久久| 最新国产成人av网站网址麻豆| 欧美大尺度在线观看| 美国十次成人| 欧美日韩系列| 亚洲二区精品| 欧美日韩精品二区| 欧美成人午夜激情在线| 久久琪琪电影院| 亚洲男女毛片无遮挡| 国产精品―色哟哟| 国产精品白丝jk黑袜喷水| 久久婷婷国产综合尤物精品| 欧美日韩不卡合集视频| 亚洲国产一二三| 欲香欲色天天天综合和网| 欧美区日韩区| 伊人久久亚洲影院| 91久久久亚洲精品| 欧美日韩久久久久久| 午夜精品一区二区三区在线播放| 国产精品人人做人人爽| 在线不卡欧美| 午夜久久久久久久久久一区二区| 亚洲国产精品专区久久| 欧美网站在线| 国产精品久久久久婷婷| 国产精品国产一区二区| 亚洲一区二区三区视频播放| 欧美成人福利视频| 欧美国产高潮xxxx1819|