Skip to content

还要支持haveLineTerminator状态 #16

Description

@acodercc

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

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

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions