Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

还要支持haveLineTerminator状态 #16

Open
acodercc opened this issue Dec 19, 2014 · 1 comment
Open

还要支持haveLineTerminator状态 #16

acodercc opened this issue Dec 19, 2014 · 1 comment
Assignees

Comments

@acodercc
Copy link
Owner

因为jsbision要对jsparser caliburn进行支持,而jsparser的自动分号补全规则中有要求,所以不仅要增加对受限token的支持,还支持haveLineTerminator状态。

但是无论是受限token,还是haveLineTerminator状态,都非标准的LR(1)移进归约解析器所该拥有的功能,两者必须适度抽象为对标准LR(1)移进归约解析器的增强。

一个是_状态的增强_,以后可能不仅仅是haveLineTerminator状态,还需要解析器支持其他状态,这个并不能由jsbison本身使用硬编码进行支持,而是应该在bnf的语法动作中进行支持。

第二个是_受限TOKEN_的增强,这个受限TOKEN,功能非常类似于jcon项目中解析器的lookhead组合子,所以有必要对其进行抽象,对bnf语法进行增强,使token在production出现的时,可以定义条件约束,,而不是在定义token时增加约束。

@acodercc acodercc self-assigned this Dec 19, 2014
@acodercc
Copy link
Owner Author

在这里又一次涉及到:需要计算当前符号栈中的符号串,会是哪些产生式的_可行前缀_。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant