Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Parsing 解释解析表的位置http://hackingoff.com/compilers/ll-1-parser-generator_Parsing_Context Free Grammar_Ll - Fatal编程技术网

Parsing 解释解析表的位置http://hackingoff.com/compilers/ll-1-parser-generator

Parsing 解释解析表的位置http://hackingoff.com/compilers/ll-1-parser-generator,parsing,context-free-grammar,ll,Parsing,Context Free Grammar,Ll,我正在使用以下语法: 输出解析表为 [ [0, "+", "*", "(", ")", "id", "$"], [0, 0, 0, 0, 0, 0, 0], [0, 10, 10, 1, 9, 1, 9], [0, 2, 10, 10, 3, 10, 3], [0, 9, 10, 4, 9, 4, 9], [0, 6, 5, 10, 6, 10, 6], [0, 9, 9, 7, 9,

我正在使用以下语法:

输出解析表为

[
        [0, "+", "*", "(", ")", "id", "$"],
        [0, 0, 0, 0, 0, 0, 0],
        [0, 10, 10, 1, 9, 1, 9],
        [0, 2, 10, 10, 3, 10, 3],
        [0, 9, 10, 4, 9, 4, 9],
        [0, 6, 5, 10, 6, 10, 6],
        [0, 9, 9, 7, 9, 8, 9]
]

谁能解释一下解析表吗?特别是,
9
10
的含义是什么?鉴于生产规则中只有8行

,在表格上方的页面中解释了这一点:

如果非终端的预测集中不存在终端,则在表中放置错误代码。如果该终端在follow(该非终端)中,则该错误为POP错误。否则,这是一个扫描错误

POP错误代码=#预测表产品+1

扫描错误代码=#预测表产品+2

因此,对于具有八条产生式规则的语法,值9和10分别是
POP error
SCAN error

[
        [0, "+", "*", "(", ")", "id", "$"],
        [0, 0, 0, 0, 0, 0, 0],
        [0, 10, 10, 1, 9, 1, 9],
        [0, 2, 10, 10, 3, 10, 3],
        [0, 9, 10, 4, 9, 4, 9],
        [0, 6, 5, 10, 6, 10, 6],
        [0, 9, 9, 7, 9, 8, 9]
]