欢迎来到天天文库
浏览记录
ID:39713735
大小:556.58 KB
页数:16页
时间:2019-07-09
《06-03-recursive-descent-parsing-annotated》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、CompilersRecursiveDescentParsingAlexAikenRecursiveDescent•Theparsetreeisconstructed–Fromthetop1–Fromlefttorightt3t2947•Terminalsareseeninorderofappearanceinthetokenstream:ttt568t2t5t6t8t9AlexAikenRecursiveDescent•ConsiderthegrammarET
2、T+ETint
3、int*T
4、(E)•Tokenstreamis:(int5)•Start
5、withtop-levelnon-terminalE–TrytherulesforEinorderAlexAikenRecursiveDescentET
6、T+ETint
7、int*T
8、(E)E(int)5AlexAikenRecursiveDescentET
9、T+ETint
10、int*T
11、(E)ET(int)5AlexAikenRecursiveDescentET
12、T+ETint
13、int*T
14、(E)ETMismatch:intdoesnotmatch(intBacktrack…(int)5AlexAikenRecursiveDescentET
15、
16、T+ETint
17、int*T
18、(E)ET(int)5AlexAikenRecursiveDescentET
19、T+ETint
20、int*T
21、(E)ETMismatch:intdoesnotmatch(int*TBacktrack…(int)5AlexAikenRecursiveDescentET
22、T+ETint
23、int*T
24、(E)ET(int)5AlexAikenRecursiveDescentET
25、T+ETint
26、int*T
27、(E)ETMatch!Advanceinput.(E)(int)5AlexAikenRecursiveDescentE
28、T
29、T+ETint
30、int*T
31、(E)ET(E)(int)5AlexAikenRecursiveDescentET
32、T+ETint
33、int*T
34、(E)ET(E)T(int)5AlexAikenRecursiveDescentET
35、T+ETint
36、int*T
37、(E)ETMatch!Advanceinput.(E)T(int)5intAlexAikenRecursiveDescentET
38、T+ETint
39、int*T
40、(E)ETMatch!Advanceinput.(E)T(int)5intAlexAikenRecursiveDescentET
41、
42、T+ETint
43、int*T
44、(E)ETEndofinput,accept.(E)T(int)5intAlexAikenChoosethederivationthatisavalidrecursivedescentERecursiveDescentparseforthestringid+idinthegivengrammar.MovesE’thatarefollowedbybacktrackingaregiveninred.-E’EE’
45、E’+EidE(E)E’-E’
46、id
47、(E)E’E’+EE’+E-E’+Eid+Eid+Eid+E’Eid+E’
48、id+idE’id+-E’idid+idE’+EEid+EE’+Eid+E’id+Eid+idid+E’id+id
此文档下载收益归作者所有
点击更多查看相关文章~~