99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

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

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                最新不卡av在线| 国产欧美一区二区精品性色超碰| 精品中文字幕一区二区小辣椒 | 成人永久aaa| 国产一区二区三区免费| 色婷婷精品久久二区二区蜜臂av | 国产一区二三区| 久久精品视频一区二区三区| 亚洲乱码国产乱码精品精小说 | 五月天一区二区三区| 日本亚洲视频在线| 日韩经典一区二区| 波多野结衣亚洲| 欧美一级片免费看| 日韩三级免费观看| 欧美日韩和欧美的一区二区| 久久―日本道色综合久久| 久久在线免费观看| 久久精品二区亚洲w码| 久久久高清一区二区三区| 日韩中文字幕1| www.成人在线| 一区二区三区中文字幕电影 | 精品日韩成人av| 国内外成人在线| 91行情网站电视在线观看高清版| 一区二区三区电影在线播| 色噜噜狠狠色综合中国| 亚洲一本大道在线| 精品一二线国产| 日韩欧美一级二级三级久久久| 亚洲成人自拍一区| 欧美美女黄视频| av成人免费在线观看| 国产一区二区三区免费看| 欧美在线视频日韩| 国产乱子伦视频一区二区三区 | 欧美不卡一区二区三区四区| 91麻豆自制传媒国产之光| 国产一区二区毛片| 国产综合久久久久久久久久久久| 奇米精品一区二区三区在线观看| 亚洲午夜免费福利视频| 亚洲九九爱视频| 亚洲一区中文日韩| 午夜久久久久久久久| 五月天中文字幕一区二区| 午夜欧美视频在线观看 | 日本一区中文字幕| 美洲天堂一区二卡三卡四卡视频| 亚洲成a人v欧美综合天堂下载| 亚洲第一电影网| 国产乱码精品一区二区三区忘忧草 | 亚洲女人小视频在线观看| 亚洲欧洲综合另类| 日韩成人一区二区三区在线观看| 秋霞国产午夜精品免费视频 | 久久综合成人精品亚洲另类欧美| 777a∨成人精品桃花网| 亚洲精品成人少妇| 欧美人与z0zoxxxx视频| 久热成人在线视频| 国产日韩精品一区二区三区| 国产一区二区久久| 亚洲欧洲精品一区二区三区不卡| 91丝袜高跟美女视频| 亚洲成av人**亚洲成av**| 日韩一本二本av| 精品国产一区二区精华| 欧美成人午夜电影| 乱一区二区av| 欧美va日韩va| 精品一区二区三区香蕉蜜桃 | 精品一区二区三区免费观看| 欧洲亚洲精品在线| 亚洲一线二线三线视频| 成人精品国产免费网站| 337p日本欧洲亚洲大胆色噜噜| 亚洲天堂av一区| 欧美性做爰猛烈叫床潮| 日韩二区三区四区| 欧美一级在线观看| 国产精品77777| 亚洲精品日日夜夜| 欧美日韩在线播放三区| 卡一卡二国产精品| 国产精品二三区| 欧美日韩一区二区电影| 老司机精品视频导航| 亚洲天天做日日做天天谢日日欢| 欧美性生活影院| 国产成人精品亚洲777人妖| 国产精品九色蝌蚪自拍| 日韩美女主播在线视频一区二区三区| 成人免费毛片aaaaa**| 国产成人亚洲综合a∨婷婷图片| 韩国v欧美v日本v亚洲v| 国产精品一区二区三区四区| 懂色av中文字幕一区二区三区| 午夜精品福利一区二区三区av| 亚洲成人av电影| 亚洲一区二区三区在线看| 亚洲国产欧美在线| 国产一区二区三区免费在线观看| 美女视频第一区二区三区免费观看网站| 麻豆视频观看网址久久| 黑人巨大精品欧美黑白配亚洲| 91视频国产资源| 国产三级精品视频| 精品一区二区日韩| 一区二区三区四区高清精品免费观看| 欧美肥妇毛茸茸| 欧美日韩精品二区第二页| 成人一道本在线| 成人黄色一级视频| 成人黄色小视频| 成人动漫av在线| 成人黄色片在线观看| 高清日韩电视剧大全免费| 国产一区91精品张津瑜| 蜜桃av噜噜一区二区三区小说| 亚洲一级二级三级| 亚洲成人综合网站| 日韩影院在线观看| 久久激情综合网| 国产91露脸合集magnet| 福利一区二区在线| 在线视频国产一区| 精品国产乱码久久久久久浪潮| 久久久久久久性| 一区二区三区**美女毛片| 日韩av在线免费观看不卡| 国产一区不卡精品| 91极品视觉盛宴| 欧美成人aa大片| 亚洲乱码国产乱码精品精小说 | 91精品国产91热久久久做人人| 久久久精品日韩欧美| 亚洲一区视频在线| 国产高清无密码一区二区三区| 色婷婷国产精品久久包臀| 精品理论电影在线观看| 日韩成人一区二区| 欧洲生活片亚洲生活在线观看| wwwwww.欧美系列| 日本午夜精品一区二区三区电影| 99re在线精品| 国产精品视频九色porn| 国产最新精品免费| 日韩视频免费直播| 日本aⅴ亚洲精品中文乱码| av网站一区二区三区| 中文字幕精品一区| 成人动漫精品一区二区| 国产精品入口麻豆九色| 国产乱码一区二区三区| 亚洲国产精品99久久久久久久久| 久草热8精品视频在线观看| 欧美男人的天堂一二区| 日av在线不卡| 欧美激情在线看| av网站一区二区三区| 怡红院av一区二区三区| 欧美三级一区二区| 图片区小说区区亚洲影院| 91精品国产aⅴ一区二区| 国产一区二区三区电影在线观看 | 亚洲综合成人网| 日韩三级.com| 91香蕉视频污| 国内精品伊人久久久久av影院 | 日韩影院精彩在线| 国产女同互慰高潮91漫画| 欧美日韩中字一区| 成人黄色免费短视频| 另类中文字幕网| 成人欧美一区二区三区在线播放| 欧美视频在线一区| 国产精品一区专区| 麻豆91免费看| 男人操女人的视频在线观看欧美| 亚洲欧洲在线观看av| www国产成人| 一区二区三区色| 成人激情校园春色| 一本到一区二区三区| 日韩精品一区二区三区中文精品| 天天综合日日夜夜精品| 久久99精品久久久久久国产越南| 91免费观看视频| 偷拍亚洲欧洲综合| 午夜精品久久久久久不卡8050| 日韩精品成人一区二区在线| 国产传媒日韩欧美成人| 91麻豆精品国产91久久久资源速度| 久久久久久久电影| 伦理电影国产精品| 91精品在线免费观看| 亚洲福利一区二区三区| 成人ar影院免费观看视频|