日韩精品一区二区三区高清_久久国产热这里只有精品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現象級表現成為養顏抗衰領域定海神針
  • 無相關信息
    合肥生活資訊

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

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

    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>
        欧美体内谢she精2性欧美| 久久久久久香蕉网| 国产精品高潮呻吟久久av黑人| 亚洲午夜精品一区二区三区他趣| 欧美日韩在线综合| 午夜精品视频| 亚洲私人影院在线观看| 欧美一级片久久久久久久| 国产精品高清免费在线观看| 午夜欧美电影在线观看| 99精品国产在热久久婷婷| 99国产成+人+综合+亚洲欧美| 欧美日韩三级在线| 日韩网站免费观看| 美女亚洲精品| 免费观看成人www动漫视频| 一本久久综合亚洲鲁鲁| 国产视频欧美视频| 欧美激情成人在线| 国产视频久久久久| 欧美三区在线观看| 亚洲国产日韩一区二区| 国产一区二区按摩在线观看| 欧美精品日韩一区| 国产一区二区中文字幕免费看| 久久久99国产精品免费| 国语对白精品一区二区| 女生裸体视频一区二区三区| 国产麻豆精品久久一二三| 亚洲第一伊人| 亚洲国产aⅴ天堂久久| 欧美在线免费视屏| 永久免费视频成人| 欧美另类视频| 亚洲蜜桃精久久久久久久| 亚洲精品一品区二品区三品区| 欧美精品入口| 99re8这里有精品热视频免费| 国产午夜精品视频| 欧美日本韩国一区| 蜜桃av一区二区在线观看| 欧美jizzhd精品欧美喷水| 在线播放国产一区中文字幕剧情欧美| 欧美精品久久99久久在免费线| 一区二区三区日韩欧美精品| 黄色一区二区在线| 欧美极品一区| 亚洲电影免费观看高清完整版在线观看| 亚洲欧美国产另类| 欧美图区在线视频| 免费久久99精品国产| 久久综合久久综合久久综合| 亚洲欧美日韩精品久久奇米色影视| 欧美日本国产在线| 久久精品2019中文字幕| 亚洲欧美日本国产专区一区| 欧美大胆a视频| 国产精品一区二区你懂的| 香蕉久久国产| 亚洲影院免费观看| 欧美精品色一区二区三区| 亚洲综合第一| 欧美日韩国产123| 久久夜精品va视频免费观看| 亚洲欧美日本视频在线观看| 亚洲一区在线直播| 国内精品嫩模av私拍在线观看| 亚洲精品久久久蜜桃| 一区二区三区精品在线| 亚洲午夜激情网站| 久久精品三级| 久久精品伊人| 国产日韩欧美制服另类| 欧美日韩亚洲成人| 国产亚洲精品美女| 国产精品久久久久免费a∨| 国产一区二区三区久久悠悠色av| 性欧美在线看片a免费观看| 亚洲人体偷拍| 午夜久久美女| 欧美三级午夜理伦三级中文幕| 亚洲国产日韩综合一区| 亚洲自拍都市欧美小说| 欧美激情亚洲视频| 欧美了一区在线观看| 亚洲最新中文字幕| 欧美日本亚洲视频| 香蕉成人啪国产精品视频综合网| 亚洲国产日韩欧美一区二区三区| 亚洲综合色激情五月| 亚洲大片精品永久免费| 久久久福利视频| 欧美一区二区三区日韩| 日韩午夜在线电影| 国产麻豆精品久久一二三| 国产欧美成人| 在线日本欧美| 欧美极品在线播放| 久久香蕉国产线看观看av| 欧美va天堂| 一区二区三区免费观看| 一区视频在线播放| 国内成人自拍视频| 国产亚洲aⅴaaaaaa毛片| 亚洲大胆人体在线| 一本色道婷婷久久欧美| 蜜桃av噜噜一区| 在线国产亚洲欧美| 亚洲成人资源| 乱人伦精品视频在线观看| 国产精品美女久久久久久免费| 亚洲一区国产视频| 国产精品国产福利国产秒拍| 欧美午夜一区二区福利视频| 91久久极品少妇xxxxⅹ软件| 亚洲欧美另类在线| 国产精品网红福利| 亚洲精品视频在线看| 久久狠狠一本精品综合网| 久久av最新网址| 欧美日韩一区在线观看| 国产精品久久久一区二区| 99精品视频一区二区三区| 麻豆国产精品va在线观看不卡| 影音先锋在线一区| 欧美精品七区| 欧美色偷偷大香| 99re66热这里只有精品4| 日韩视频免费观看高清在线视频| 亚洲免费激情| 亚洲天堂激情| 久久久亚洲国产美女国产盗摄| 亚洲精品女av网站| 亚洲欧美日韩国产一区二区三区| 久久免费一区| 国产精品日日摸夜夜摸av| 亚洲高清中文字幕| 国产精品久久久久久久久免费樱桃| 亚洲午夜一区二区三区| 欧美人在线观看| 国产欧美精品一区二区三区介绍| 99www免费人成精品| 国产精品海角社区在线观看| 亚洲国产第一页| 欧美精品偷拍| 裸体女人亚洲精品一区| 亚洲精品中文字| 国产麻豆午夜三级精品| 欧美激情亚洲一区| 国产精品日韩一区二区三区| 国产在线精品二区| 欧美成人自拍| 欧美色综合天天久久综合精品| 怡红院精品视频| 性8sex亚洲区入口| 香蕉久久夜色精品国产| 夜夜嗨av一区二区三区四区| 国内精品一区二区三区| 亚洲一区二区三区四区在线观看| 伊人成年综合电影网| 久久精品一区二区三区中文字幕| 亚洲国产欧美一区| 国产农村妇女精品| 久久国产精品一区二区三区|