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

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

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分析代做_友商科
    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在线免费观看
    一卡二卡3卡四卡高清精品视频| 久久另类ts人妖一区二区| 中文字幕日韩一区二区三区| 久久全球大尺度高清视频| 国产视频99| 日韩一区国产在线观看| 欧美精品激情在线观看| 国产精品视频网址| 91成人国产在线观看| 国产天堂在线播放| 黄色片视频在线播放| 国产精品久久成人免费观看| 99精彩视频| 青青草成人在线| 国产精品一久久香蕉国产线看观看| 欧美亚洲免费在线| 偷拍视频一区二区| 在线观看成人一级片| 国产精品高潮呻吟久久av野狼| 91精品国产91久久久久久吃药| 国产一区福利视频| 黄色国产精品视频| 黄色高清视频网站| 欧美日韩dvd| 欧美久久综合性欧美| 日韩国产精品一区二区三区| 亚洲免费av网| 亚洲精品欧美日韩| 亚洲一区二区三区在线视频| 国产精品久久久久久婷婷天堂 | 国产主播精品在线| 黄色一级大片在线观看| 欧美在线一区二区三区四| 色中色综合成人| 日本一区二区在线视频| 无码人妻aⅴ一区二区三区日本| 亚洲五月六月| 午夜欧美一区二区三区免费观看| 亚洲精品女av网站| 亚洲欧洲日产国码无码久久99| 亚洲在线免费视频| 久久国产精品视频| 亚洲欧洲三级| 日本精品一区在线观看| 欧美在线视频网站| 国产美女被下药99| 97久久精品国产| 国产国语videosex另类| 精品国产依人香蕉在线精品| 美女久久久久久久| 亚洲欧洲一区二区在线观看| 青青草久久网络| 精品少妇一区二区三区在线| 91精品在线播放| 日韩视频中文字幕| 亚洲综合最新在线| 亚洲最大成人网色| 国产区一区二区| 久久久久久久久久网| 国产精品电影网| 色综合久久av| 久久中文字幕在线视频| 色99中文字幕| 国产免费一区二区三区香蕉精| 国产精品av在线播放 | 日韩欧美亚洲日产国| 欧美视频免费播放| av免费精品一区二区三区| 深夜福利日韩在线看| 中文字幕一区二区三区四区五区人| 日本不卡高字幕在线2019| 国产午夜福利100集发布| 久久av二区| 中文字幕无码不卡免费视频| 视频在线一区二区三区| 国产免费一区视频观看免费| 国产精品免费一区二区三区 | 国产主播一区二区三区四区| 久久riav二区三区| 丁香六月激情网| 高清无码视频直接看| 操91在线视频| 欧美亚洲国产视频| 色老头一区二区三区在线观看| 亚洲v国产v在线观看| 成人91免费视频| 精品麻豆av| 欧美一区二区综合| www.欧美免费| 精品人妻少妇一区二区 | 国模一区二区三区私拍视频| 国产精品久久激情| 韩国国内大量揄拍精品视频| 国产成人精品综合| 欧美牲交a欧美牲交aⅴ免费下载| 久久久性生活视频| 色综合久久av| 日韩在线欧美在线国产在线| 欧美亚洲在线观看| 国产精品对白刺激| 成人精品在线观看| 熟妇人妻va精品中文字幕| 国产成人亚洲综合| 国内精品久久久久久久| 欧美精品情趣视频| 97久久超碰福利国产精品…| 日韩免费在线看| 久久亚洲精品毛片| 91av在线播放| 欧美午夜性视频| 亚洲一区二区三区香蕉| 色吧影院999| 国产亚洲精品自在久久| 国产美女精品免费电影| 国产精品第七影院| 91精品国产综合久久香蕉 | 国产伦精品一区二区三区在线 | 色久欧美在线视频观看| 国产情侣第一页| 欧美在线一区二区三区四区| 亚洲一区二区免费在线| 国产精品久久久久久久久久ktv | 日韩av电影中文字幕| 欧美xxxx14xxxxx性爽| 国产高清在线一区| 免费看欧美黑人毛片| 日韩精品―中文字幕| 日韩在线国产| 最新国产精品久久| 久久艳片www.17c.com| 国产精品丝袜高跟| 久久久噜噜噜久久久| 国产成人精品福利一区二区三区 | 国产精品高精视频免费| 色妞色视频一区二区三区四区| 国产成人一区二区三区别| 131美女爱做视频| 久久综合一区二区三区| 91精品国产91久久久久麻豆 主演| 国产精品羞羞答答| www.com毛片| 97成人在线免费视频| 97精品久久久中文字幕免费| 不卡视频一区| 久久久爽爽爽美女图片| 91精品国产九九九久久久亚洲| 成人毛片100部免费看| 91精品视频免费| 国产mv免费观看入口亚洲| 色老头一区二区三区在线观看| 精品国产欧美成人夜夜嗨| 久久精品电影网站| 国产精品视频免费一区二区三区 | 在线播放 亚洲| 亚洲国产成人不卡| 日本一二三区视频在线| 日韩精品一区二区三区四| 激情视频小说图片| 国产免费一区二区三区在线能观看 | 秋霞在线一区二区| 欧美韩国日本精品一区二区三区| 黄色免费福利视频| 国产欧美日韩小视频| 91精品视频网站| 久久66热这里只有精品| 国产精品无码免费专区午夜| 欧美成人精品在线播放| 亚洲五码在线观看视频| 日韩免费视频在线观看| 韩国精品久久久999| 国产精品一香蕉国产线看观看| 91精品国产一区二区三区动漫| 色吧影院999| 欧美精品aaa| 日本精品www| 国产九色91| 久久久久久久久久久国产| 久久成人精品电影| 亚洲国产欧美不卡在线观看| 欧美精品在线一区| www.浪潮av.com| 日韩网站免费观看| 一区二区三区精品国产| 日本精品久久久久久久| 国产日韩在线免费| 91久久久久久| 国产精品视频免费一区二区三区| 久久97精品久久久久久久不卡 | 日韩免费视频在线观看| 国内自拍中文字幕| 99在线观看| 国产精品视频区1| 亚洲综合av影视| 男人添女人下部高潮视频在观看| av免费观看网| 国产精品日韩av| 日韩中文字幕在线视频观看| 免费看污污视频| 久草资源站在线观看| 一区二区三区在线观看www|