首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
COMP 2049 代做代写 c++,java 编程
项目预算:
开发周期:
发布时间:
要求地区:
COMP 2049 Languages and Computation Coursework: Floating-Point Numbers and Simple Arithmetic Expressions
1 Floating-Point Numbers
Design a right-linear grammar G1 that generates the language of binary floating-point literals according to the following rules:
• Each number may be signed or unsigned.
– unsigned as in 1.01, signed as in +1.01 or -1.10
• The numerical part (also called the value field) must be non-empty and may optionally include a decimal point ’.’, in which case it must be followed by some other digits. For instance:
– In the number +110.11, the value filed is 110.11.
– 1 and .01, -.001, 001 are all acceptable, but 1., +, - and λ are not.
• There may be an optional exponent field, in which case, it must contain the letter ’e’, followed by a signed or unsigned integer.
– For instance, 101e+1 or -1.1e10 are acceptable, but 1.01e, 1.01e-1.1 and e11 are not. Furthermore, there must be at least one digit between the decimal point ’.’ and the letter ’e’. Hence,
strings such as 11.e01 are not acceptable.
Task 1. Implement the grammar G1 in JFLAP, and test it on some input strings of your choice.
A screenshot of the result of parsing of some sample input strings for grammar G1 in JFLAP is provided in Figure 1.
Figure 1: Some sample input and the corresponding results
Remark 1.1 In all of the tasks of this coursework, the default parsing method should be the “brute force parsing”. Hence, to test your grammars in JFLAP on several input strings, choose the tab “Input” and then the item “Multiple Brute Force Parse”.
1
2 Arithmetic Expressions
For the second task, you are required to design a context-free grammar (CFG) G2 that generates the language of arithmetic expressions over natural numbers in binary format. Each arithmetic expression is constructed from the following:
• Binary unsigned integer literals, with leading zeros accepted;
• Arithmetic operators +, -, *, and /;
• Properly nested parentheses.
For instance, an expression such as (11+0101)/001 must be accepted, whereas ((11-01) must be rejected because the parentheses do not match.
Task 2. Implement the grammar G2 in JFLAP and test it on some input expressions of your choice.
Check all the production rules of the grammar G2 to see if there are any λ-productions or unit- productions. If there are any such productions, you may notice that for more complicated input strings, it takes a long time for JFLAP to parse the string. In fact, at times it may enter into a non-terminating loop.
Task 3. Use JFLAP to remove the λ-productions and unit-productions of the grammar G2 to obtain the gram- mar G3. Then, try to parse the same strings as before and notice that it takes a shorter time to parse them, and the parser does not enter into non-terminating loops.
In JFLAP, to remove λ-productions and unit-productions, you may first choose the tab “Convert”, and then the item “Transform Grammar”. A screenshot of the result of parsing of some sample input strings for grammar G3 in JFLAP is provided in Figure 2. To compare the efficiency of G2 and G3, you may use the sample input “1+1-(1/1*1)”.
Figure 2: Some sample input and the corresponding results
3 Submission
You must submit one zip file which contains three JFLAP files, named according to the following templates: 1. A JFLAP file for grammar G1 of Task 1 named:
ID_Surname_FirstName_01.jff 2. A JFLAP file for grammar G2 of Task 2 named:
ID_Surname_FirstName_02.jff 3. A JFLAP file for grammar G3 of Task 3 named:
4. The zip file named:
ID_Surname_FirstName_03.jff ID_Surname_FirstName.zip
2
Remark 3.1 In case the grammar G2 of Task 2 that you have designed already has no λ-productions and no unit-productions, then you may submit the same grammar as G3. Nonetheless, even in this case, you must submit three files with the naming conventions as specified above.
• Release date: Tuesday, April 2nd, 2024
• Deadline: Friday, April 19th, 2024, 17:00 • Weight: 15% of the module mark
• How to submit: Via Moodle
4 Marking Scheme
Correctness: (80%) Correct answers for the three tasks contribute to 80% of the total mark, as follows: • Task 1: 40%
• Task 2: 20%
• Task 3: 20%
Format: (20%)
1. While the grammar G3 of Task 3 is generated by JFLAP, the grammars for Tasks 1 and 2 must be written by you. For grammars G1 and G2, all productions with the same left-hand-side variable must appear in one block one after another. (15%)
2. The zip file and three JFLAP files must be named according to the templates given above. (5%).
Late Submissions: The standard University penalty for late submission is applied, i.e., 5% absolute
standard University scale per day, until the mark reaches zero.
Use of Other Technologies: If you use technologies other than those specified in the assignment brief, e.g., chatGPT, 50% absolute deduction.
3
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
cis432代做、代写python/java程...
2024-05-04
eeen3007j代写、c++程序设计代...
2024-05-04
代写data程序、代做c/c++, jav...
2024-05-04
comp2006代做、代写c++程序语言
2024-05-04
comp26020代做、java/c++设计编...
2024-05-04
csci251 advanced programming...
2024-05-03
cs 6290: high-performance co...
2024-05-03
assignment 2: executing and ...
2024-05-03
ecse427/comp310 programmin...
2024-05-03
cs 452 (fall 22): operating...
2024-05-03
comp9414 23t2 assignment 2 ...
2024-05-03
dpst1091 23t1 assignment 2 ...
2024-05-03
program代做、代写python设计编...
2024-05-03
热点标签
finm8007
comp2006
comp26020
comp1721
eeen3007j
cis432
csci251
comp5125m
com398sust
32022
mth6158
comp328
finn41615
2024
mec302
mgmt3004
mgt7158
com160
as.640.440
econ3016
finm7405
econ7021
fin600
infs4205/7205
mktg2510-
f27sb
csse2310/csse7231
rv32i
eecs 113
comp1117b
cs 412
comp 315
econ7300
comp2017
ecs 116
fit5046
com6511
comp30024
acs341
econ1020
isys3014
acc408
comp1047
csc 256
cs 6347
finm7008
comp34212
csmde21
estr2520
comp285/comp220
mds5130/iba6205
finc6010
is3s665
busi2194
125.785
iom209
msin0041
econ339
cmt218
mast10007
comp5349
ecx2953/ecx5953
bios706
comp3310
mth6150
comp30027
comp20005
eec286
busi2211
bff2401
fnce90046
visu2001
mang6554
finc6001
125785
data423-24s1
engi 1331
fint2100
(520|600).666
can202
cs 61b
mast20029
info20003
stat512
econ3208
cmpsc311
engg1340
ecmt1010
fit5216
basc0003
ee3121
acct2002
comp5313
busi2131
ise529
elec372/472
csit940/csit440
cenv6141
comp3027/comp3927
ftec5580
comp1433
msci223
mark203
en3098
eden1000
ece6483
econ4410
mats16302
cs 6476
com6521
comp222
comp3211
comp10002
csc1002
chc6186
cs 161
comp27112
comp282
swen20003
comm1190
elec9764
acfi3308
acct7101
fin6035
comp2048
geog0163
comp2013
coen 146
dts101tc
sehh2042
comp30023
comp4880/8880
cs 455
07
stat0045.
fil-30023
celen085
psyc40005
math40082
are271
comp9311
ee5311
imse2113
comp 2322
acct2102
fnd109
int102
is3s664
is6153
data4000
accfin5034
fit5212
cs536-s24
fit5225
ecos3006
mes202tc
finc5001
stat3061
csc171
cs1b
7ssmm712
bu.450.760
cs170
comp3411
swen90004
cpt206
comp5313/comp4313—large
bl5611
kxo206
comp532
elec207
kxo151
cs 2820
cpt108
math2319
dts204tc
qm222
comp2511
ccs599
infs1001
mat2355
eeee4123
25721
ifn647
pols0010
hpm 573
qbus6860
comp9417
csci 1100
stat0023
cse340
comp2003j
cs 2550
cs360
fin 3080
ierg 4080
cs6238
cit 594
finm7406
hw6
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!