Parsing 无法设置优先级规则以强制Jison中的移位

Parsing 无法设置优先级规则以强制Jison中的移位,parsing,bison,context-free-grammar,lalr,jison,Parsing,Bison,Context Free Grammar,Lalr,Jison,我正在尝试用我的语言实现一个功能,在这个功能中,您可以通过执行return someVal然后someCode()在函数中返回后执行语句 我对返回语句有以下语法: ReturnStatement: 'RETURN' { $$ = new yy.ReturnStatement(null).pos(@$)} | 'RETURN' Expression

我正在尝试用我的语言实现一个功能,在这个功能中,您可以通过执行
return someVal然后someCode()
在函数中返回后执行语句

我对返回语句有以下语法:

ReturnStatement:
    'RETURN'                                                { $$ = new yy.ReturnStatement(null).pos(@$)}
|   'RETURN' Expression                                     { $$ = new yy.ReturnStatement($2).pos(@$)}
|   'RETURN' Expression 'THEN' Statement  %prec 'AFTER'     { $$ = new yy.ReturnStatement($2, $4).pos(@$)}
;
在Jison文件的标题中,我有以下优先规则:

%nonassoc 'NAME'

%right ':'

%nonassoc 'IF' 
%nonassoc 'ENDLN'
%nonassoc 'ELSE'
%nonassoc 'DEF'

%right 'ASSIGN' ''
%left 'YIELD'
%left 'OR'
%left 'AND'
%left '==' '!=' '<' '>' '<=' '>='
%left '+' '-' '&'
%left '*' '//' '%' '/'
%right 'UMIN' 'UPLUS'
%left '^'
%left 'AWAIT'
%right 'TYPEOF'
%right 'UB_FUNC' 'B_FUNC'

%left 'ACCESS'

%nonassoc 'INDEX_LEFT' 'INDEX_RIGHT'

%left 'CALL_LEFT' 'CALL_RIGHT'

%right 'NEW'

%nonassoc 'AFTER'

%%
%nonassoc“名称”
%对':'
%非ASSOC“如果”
%非ASSOC“ENDLN”
%非assoc“ELSE”
%非ASSOC“DEF”
%右键“分配”
%左“收益率”
%左‘或’
%左‘和’
%左'=''!='''''''''''='''
%左“+”-“&”
%左'*''/'%'''/'
%右“UMIN”“UPLUS”
%左“^”
%左“等待”
%右“TYPEOF”
%右“UB_FUNC”“B_FUNC”
%左“访问”
%非ASSOC“索引左”“索引右”
%左键“左键”左键“右键”
%右‘新’
%非ASSOC“之后”
%%
我知道,当存在冲突时,Jison将默认转换,但我希望设置优先级规则,这样我就不会在Jison中收到shift/REDUCT冲突警告。我认为将最后一条规则置于所有其他规则之上可以做到这一点,但我得到的却是:

Conflict in grammar: multiple actions possible when lookahead token is - in state 53
- reduce by rule: Continuation -> YIELD
- shift token (then go to state 63)
Conflict in grammar: multiple actions possible when lookahead token is + in state 53
- reduce by rule: Continuation -> YIELD
- shift token (then go to state 64)
Conflict in grammar: multiple actions possible when lookahead token is - in state 54
- reduce by rule: Continuation -> AWAIT
- shift token (then go to state 63)
Conflict in grammar: multiple actions possible when lookahead token is + in state 54
- reduce by rule: Continuation -> AWAIT
- shift token (then go to state 64)
Conflict in grammar: multiple actions possible when lookahead token is CALL_LEFT in state 131
- reduce by rule: Expression -> MemberExpression
- shift token (then go to state 91)
Conflict in grammar: multiple actions possible when lookahead token is CALL_LEFT in state 132
- reduce by rule: Expression -> Identifier
- shift token (then go to state 91)
Conflict in grammar: multiple actions possible when lookahead token is % in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 87)
Conflict in grammar: multiple actions possible when lookahead token is // in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 86)
Conflict in grammar: multiple actions possible when lookahead token is / in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 85)
Conflict in grammar: multiple actions possible when lookahead token is * in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 84)
Conflict in grammar: multiple actions possible when lookahead token is - in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 83)
Conflict in grammar: multiple actions possible when lookahead token is + in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 82)
Conflict in grammar: multiple actions possible when lookahead token is & in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 81)
Conflict in grammar: multiple actions possible when lookahead token is >= in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 80)
Conflict in grammar: multiple actions possible when lookahead token is <= in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 79)
Conflict in grammar: multiple actions possible when lookahead token is > in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 78)
Conflict in grammar: multiple actions possible when lookahead token is < in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 77)
Conflict in grammar: multiple actions possible when lookahead token is != in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 76)
Conflict in grammar: multiple actions possible when lookahead token is == in state 134
- reduce by rule: Continuation -> YIELD Expression
- shift token (then go to state 75)
Conflict in grammar: multiple actions possible when lookahead token is % in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 87)
Conflict in grammar: multiple actions possible when lookahead token is // in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 86)
Conflict in grammar: multiple actions possible when lookahead token is / in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 85)
Conflict in grammar: multiple actions possible when lookahead token is * in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 84)
Conflict in grammar: multiple actions possible when lookahead token is - in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 83)
Conflict in grammar: multiple actions possible when lookahead token is + in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 82)
Conflict in grammar: multiple actions possible when lookahead token is & in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 81)
Conflict in grammar: multiple actions possible when lookahead token is >= in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 80)
Conflict in grammar: multiple actions possible when lookahead token is <= in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 79)
Conflict in grammar: multiple actions possible when lookahead token is > in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 78)
Conflict in grammar: multiple actions possible when lookahead token is < in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 77)
Conflict in grammar: multiple actions possible when lookahead token is != in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 76)
Conflict in grammar: multiple actions possible when lookahead token is == in state 135
- reduce by rule: Continuation -> AWAIT Expression
- shift token (then go to state 75)
Conflict in grammar: multiple actions possible when lookahead token is == in state 151
- reduce by rule: UnaryExpression -> - Expression
- shift token (then go to state 75)
Conflict in grammar: multiple actions possible when lookahead token is != in state 151
- reduce by rule: UnaryExpression -> - Expression
- shift token (then go to state 76)
Conflict in grammar: multiple actions possible when lookahead token is < in state 151
- reduce by rule: UnaryExpression -> - Expression
- shift token (then go to state 77)
Conflict in grammar: multiple actions possible when lookahead token is > in state 151
- reduce by rule: UnaryExpression -> - Expression
- shift token (then go to state 78)
Conflict in grammar: multiple actions possible when lookahead token is <= in state 151
- reduce by rule: UnaryExpression -> - Expression
- shift token (then go to state 79)
Conflict in grammar: multiple actions possible when lookahead token is >= in state 151
- reduce by rule: UnaryExpression -> - Expression
- shift token (then go to state 80)
... 
语法冲突:当前瞻标记处于-状态53时,可能会执行多个操作
-按规则减少:继续->收益率
-移位令牌(然后转到状态63)
语法冲突:当前瞻标记处于+状态53时,可能会执行多个操作
-按规则减少:继续->收益率
-移位标记(然后转到状态64)
语法冲突:当前瞻标记处于-54状态时,可能会执行多个操作
-按规则减少:继续->等待
-移位令牌(然后转到状态63)
语法冲突:当前瞻标记处于+状态54时,可能会执行多个操作
-按规则减少:继续->等待
-移位标记(然后转到状态64)
语法冲突:在状态131中,当前瞻标记为CALL_时,可能会执行多个操作
-按规则减少:表达式->成员表达式
-移位令牌(然后转到状态91)
语法冲突:当前瞻令牌处于状态132时,可能会执行多个操作
-按规则缩减:表达式->标识符
-移位令牌(然后转到状态91)
语法冲突:当前瞻标记处于%状态时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态87)
语法冲突:当前瞻标记//处于状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态86)
语法冲突:当前瞻标记处于/处于状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态85)
语法冲突:当前瞻标记*处于状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态84)
语法冲突:当前瞻标记处于-状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位标记(然后转到状态83)
语法冲突:当前瞻标记处于+状态时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态82)
语法冲突:当前瞻标记处于状态134时可能执行多个操作(&I)
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态81)
语法冲突:当前瞻标记>=处于状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态80)
语法冲突:当前瞻标记为屈服表达式时,可能会执行多个操作
-移位标记(然后转到状态79)
语法冲突:当前瞻标记>处于状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态78)
语法冲突:当前瞻标记<处于状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态77)
语法冲突:当使用先行标记时,可能会执行多个操作!=在134州
-按规则减少:继续->产量表达式
-移位令牌(然后转到状态76)
语法冲突:当前瞻标记为==处于状态134时,可能会执行多个操作
-按规则减少:继续->产量表达式
-移位标记(然后转到状态75)
语法冲突:当前瞻标记%处于状态135时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态87)
语法冲突:当前瞻标记//处于状态135时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态86)
语法冲突:当前瞻标记处于/处于状态135时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态85)
语法冲突:当前瞻标记*处于状态135时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态84)
语法冲突:当前瞻标记处于-135状态时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位标记(然后转到状态83)
语法冲突:当前瞻标记处于+状态时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态82)
语法冲突:当前瞻标记处于状态135时可能执行多个操作(&I)
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态81)
语法冲突:当前瞻标记>=处于状态135时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态80)
语法冲突:当lookahead标记为wait Expression时可能有多个操作
-移位标记(然后转到状态79)
语法冲突:当前瞻标记>处于状态135时,可能会执行多个操作
-按规则缩减:继续->等待表达式
-移位令牌(然后转到状态78)
语法冲突:多重