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

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

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現象級表現成為養顏抗衰領域定海神針
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    仿真分析咨詢外包服務-結構 / 熱 / CFD流體 / 電磁 / 光學CAE代做
    仿真分析咨詢外包服務-結構 / 熱 / CFD流體
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
  • 豆包網頁版入口 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>
        日韩视频精品在线观看| 久久久久黄色| 国产福利一区二区| 国产日韩精品久久久| 亚洲欧洲在线观看av| aaa大片在线观看| 中文在线一区二区| 欧美日韩国产首页| 中文字幕亚洲二区| 一区在线视频观看| 欧美日韩中文在线| 欧美日韩高清在线| 日韩色在线观看| 国产h片在线观看| 日韩av一区二区在线观看| 日韩在线视频观看| 麻豆精品99| 在线视频三区| 中文字幕日韩欧美在线视频| 日韩精品视频中文字幕| 欧美日韩国产综合视频在线观看中文| 日本一级一片免费视频| 日韩手机在线观看视频| 亚洲a一级视频| 亚洲一区视频在线观看视频| 日韩精品视频中文在线观看| 亚洲一区精品电影| 色猫猫国产区一区二在线视频| 国产一区在线不卡| 91精品国产综合久久久久久| 欧美专区中文字幕| 日韩精品不卡一区二区| 中文字幕亚洲一区二区av在线| 国产一区高清视频| 91精品国产综合久久蜜臀| 中文字幕 亚洲视频| 91亚洲国产高清| 中文国产字幕在线观看| 欧美三级在线视频| 91精品啪在线观看国产60岁| 99日韩精品| 麻豆精品99| wwwww亚洲| 二区三区中文字幕| 中文字幕日韩欧美在线| 国产一级免费在线观看| 日韩精品中文在线观看| 欧美在线视频一区二区| av免费在线网站| 精品久久久91| 欧美日韩综合在线免费观看| 国产成人精品999在线观看| 久久精品久久精品亚洲人| 99在线国产| 欧美日韩精品免费| 精品日韩av一区二区| 欧美不卡视频一区发布| 91麻豆精品在线| 成人欧美亚洲| 日韩欧美在线精品| 999精品在线| 免费国产成人看片在线| 中文在线不卡视频| 91精品久久久久久久久久| 91精品国产91久久久久| 欧美中文字幕第一页| 在线视频一区二区三区在线播放| 国产裸舞福利在线视频合集| 日韩欧美一二三| 在线综合 亚洲 欧美中文字幕| 黄色资源在线观看| aa国产成人| 99精品视频99| 亚洲视频资源在线| 欧美不卡视频一区| 日韩国产在线不卡视频| 91精品在线观看视频| 国产成人精品网址| 国产成人精品网址| 精品乱人伦一区二区三区| 一级日韩一级欧美| 亚洲视频资源在线| 欧美三级中文字幕| 久久网站免费观看| 日韩视频专区| 久久精品日韩欧美| av午夜在线| 亚洲欧洲国产视频| 九九视频精品免费| 久久av免费| 91吃瓜在线观看| 日韩在线观看视频一区二区| 激情国产在线| 日韩视频一区二区在线观看| 国产在线观看91| 精品国产欧美成人夜夜嗨| 国产黄在线播放| 精品国自产在线观看| 日韩在线播放一区二区| 在线视频国内一区二区| 中文字幕在线欧美| 日本va欧美va精品发布| 日韩欧美久久久| 在线中文字幕视频| 欧美日韩国产高清视频| 日韩精品在线观看网站| 91精品在线观| 欧美日韩国产观看视频| 国产综合精品在线| 欧美亚洲国产日韩| 中文字幕一区免费| 日韩欧美在线网址| 欧美亚洲综合视频| 亚洲人成欧美中文字幕| 精品久久在线| 黄色一区二区在线| 日韩 欧美 综合| 国产在线拍偷自揄拍精品| 欧美三级三级三级爽爽爽| 亚洲高清视频一区| 久久精品久久精品亚洲人| 日韩精品中文字幕第1页| 在线观看一区日韩| 精品国产1区2区3区| 91精品国产综合久久香蕉最新版| 国产一区在线观看视频| 欧美日韩性视频一区二区三区| 亚洲校园欧美国产另类| 日韩专区视频网站| 欧美日韩国产不卡在线看| 国产蜜臀在线| 国产资源在线观看入口av| 亚洲羞羞网站| av影视在线看| 中文精品在线观看| 一级一片免费视频| 日韩精品久久久| 精品视频资源站| www.91香蕉视频| 精品亚洲国内自在自线福利| 在线中文免费视频| 国产一区精品在线| 亚洲一区中文| 亚洲精品中文字幕乱码三区| 91精品国产91久久久久| 欧美国产一区视频在线观看| 久久精品在线观看| 婷婷综合福利| 91精品免费在线观看| 日韩在线视频在线观看| 日韩精品午夜| 欧洲精品在线视频| 黄色视屏免费在线观看| 精品国产免费观看一区| 久久视频在线免费观看| 日韩中文字幕观看| 日本a级黄色| 欧美一级手机免费观看片| 欧美日韩高清在线一区| 中文字幕 日韩 欧美| 欧美日韩在线观看首页| 欧美日韩国产高清视频| 欧美日韩中文字幕一区| 欧美日韩精品免费在线观看视频|