正在加载图片...
Recursive Predictive Parsing (Example) A->aBe cBd C B→bB|8 C→f proc C{match the current token with f, proc A{ and move to the next token;} case of the current token a:-match the current token with a, and move to the next token; proc B call B; case of the current token{ match the current token with e, b:-match the current token with b, and move to the next token; and move to the next token; c:-match the current token with c, call B and move to the next token; e,d:do nothing call B; match the current token with d, and move to the next token; follow set of B f:-call C first set of C CS30 Compiler Theory 9Recursive Predictive Parsing (Example) A → aBe | cBd | C B → bB | ε C → f proc C { match the current token with f, proc A { and h k} move to t he next to ken; } case of the current token { a: - match the current token with a, and move to the next token; and move to the next token; proc B { proc B { - call B; case of the current token { - match the current token with e, b: - match the current token with b, and move to the next token; and move to the next token; and move to the next token; and move to the next token; c: - match the current token with c, - call B and move to the next token; e,d: do nothing - call B; } - match the current token with d, } and move to the next token; f: - call C follow set of B CS308 Compiler Theory 9 } } first set of C
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有