Почему я получаю 40 конфликтов переключения/уменьшения и 1 уменьшение/уменьшение?

Я установил правила для парсера

%token DIGIT
%token ALPHA
%token IDENT
%token INTEGER
%token REAL
%token BOOLEAN
%token CLASS
%token DOUBLE
%token INT
%token IF
%token ELSE
%token WHILE
%token FOR
%token TRU
%token FALS
%token EXTENDS
%token INSTANCEOF
%token NEW
%token THIS
%token NULLVAL
%token PRIVATE
%token STATIC
%token VOID
%token RETURN
%token SHORT
%token LONG
%token SIGNED
%token UNSIGNED
%token OR
%token AND
%token EQUALS
%token UNEQUAL
%token GR
%token GRE
%token LESS
%token LESSE
%token PLUS
%token MINUS
%token MULTIPLY
%token DIV
%token MOD
%token EQUAL
%token INC
%token DEC  
%token NEG 

%nonassoc if_prec
%nonassoc ELSE
%right EQUAL INC DEC NEG
%left OR AND EQUALS UNEQUAL GR GRE LESS LESSE INSTANCEOF PLUS MINUS MULTIPLY DIV MOD
%%

File: Decl_Class 

Decl_Class: CLASS IDENT '(' EXTENDS IDENT ')' '{' Field '}'

Field: Variable ';'
      | Constructor
      | Method

Variable: Modifier Expr_type Decl_variables


Decl_variables: Decl_variable | Decl_variable ',' Decl_variables

Decl_variable: IDENT | IDENT EQUAL Expr

Constructor: Modifier IDENT '(' Params ')' '{' Instruction '}'

Method: Modifier '(' Expr_type | VOID ')' IDENT '(' Params')' '{' Instruction '}'

Params: Expr_type IDENT | Expr_type IDENT ',' Params

Modifier: SHORT | LONG | SIGNED | UNSIGNED

Expr_type: BOOLEAN | INT | DOUBLE | IDENT

Expr:              INTEGER | REAL | TRU | FALS
                   | THIS | NULLVAL
                   | '(' Expr ')'
                   | Access | Access EQUAL Expr | Access '(' L_Expr ')'
                   | NEW IDENT '(' L_Expr ')'
                   | INC Expr | DEC Expr | Expr INC | Expr DEC
                   | NEG Expr | MINUS Expr | PLUS Expr
                   | Expr Operator Expr
                   | '(' Expr_type ')' Expr
                   | Expr INSTANCEOF Expr_type

Operator: OR | AND | EQUALS | UNEQUAL | GR | GRE | LESS | LESSE | PLUS | MINUS | MULTIPLY | DIV | MOD

Access: IDENT | Expr '.' IDENT

L_Expr: Expr | Expr ',' L_Expr

Instruction: ';'
           | Expr';'
           | Expr_type Decl_variables';'
           | IF '(' Expr ')' Instruction %prec if_prec
           | IF '(' Expr ')' Instruction ELSE Instruction
           | WHILE '(' Expr ')' Instruction
           | FOR '(' L_Expr ';' Expr ';'  L_Expr')' Instruction
           | FOR '(' Expr_type ')' Decl_variables ';' Expr ';'  L_Expr ')' Instruction '{' Instruction '}'
           | RETURN Expr ';'

Состояние 66 конфликтов: 1 изменение/уменьшение Состояние 67 конфликтов: 1 изменение/уменьшение Состояние 68 конфликтов: 1 изменение/уменьшение Состояние 69 конфликтов: 1 изменение/уменьшение Состояние 70 конфликтов: 1 изменение/уменьшение Состояние 71 конфликт: 1 изменение/уменьшение Состояние 109 конфликты: 17 состояний сдвига/уменьшения 110 конфликтов: 1 состояние сдвига/уменьшения 122 конфликта: 17 состояний сдвига/уменьшения

Вот состояния с конфликтами:


state 66

   37 Expr: Expr . INC
   38     | Expr . DEC
   41     | PLUS Expr .
   42     | Expr . Operator Expr
   44     | Expr . INSTANCEOF Expr_type
   59 Access: Expr . '.' IDENT

    '.'  shift, and go to state 90

    '.'       [reduce using rule 41 (Expr)]
    $default  reduce using rule 41 (Expr)

    Operator  go to state 91


state 67

   37 Expr: Expr . INC
   38     | Expr . DEC
   40     | MINUS Expr .
   42     | Expr . Operator Expr
   44     | Expr . INSTANCEOF Expr_type
   59 Access: Expr . '.' IDENT

    '.'  shift, and go to state 90

    '.'       [reduce using rule 40 (Expr)]
    $default  reduce using rule 40 (Expr)

    Operator  go to state 91


state 68

   35 Expr: INC Expr .
   37     | Expr . INC
   38     | Expr . DEC
   42     | Expr . Operator Expr
   44     | Expr . INSTANCEOF Expr_type
   59 Access: Expr . '.' IDENT

    INSTANCEOF  shift, and go to state 74
    OR          shift, and go to state 75
    AND         shift, and go to state 76
    EQUALS      shift, and go to state 77
    UNEQUAL     shift, and go to state 78
    GR          shift, and go to state 79
    GRE         shift, and go to state 80
    LESS        shift, and go to state 81
    LESSE       shift, and go to state 82
    PLUS        shift, and go to state 83
    MINUS       shift, and go to state 84
    MULTIPLY    shift, and go to state 85
    DIV         shift, and go to state 86
    MOD         shift, and go to state 87
    INC         shift, and go to state 88
    DEC         shift, and go to state 89
    '.'         shift, and go to state 90

    '.'       [reduce using rule 35 (Expr)]
    $default  reduce using rule 35 (Expr)

    Operator  go to state 91


state 69

   36 Expr: DEC Expr .
   37     | Expr . INC
   38     | Expr . DEC
   42     | Expr . Operator Expr
   44     | Expr . INSTANCEOF Expr_type
   59 Access: Expr . '.' IDENT

    INSTANCEOF  shift, and go to state 74
    OR          shift, and go to state 75
    AND         shift, and go to state 76
    EQUALS      shift, and go to state 77
    UNEQUAL     shift, and go to state 78
    GR          shift, and go to state 79
    GRE         shift, and go to state 80
    LESS        shift, and go to state 81
    LESSE       shift, and go to state 82
    PLUS        shift, and go to state 83
    MINUS       shift, and go to state 84
    MULTIPLY    shift, and go to state 85
    DIV         shift, and go to state 86
    MOD         shift, and go to state 87
    INC         shift, and go to state 88
    DEC         shift, and go to state 89
    '.'         shift, and go to state 90

    '.'       [reduce using rule 36 (Expr)]
    $default  reduce using rule 36 (Expr)

    Operator  go to state 91

state 109

   37 Expr: Expr . INC
   38     | Expr . DEC
   42     | Expr . Operator Expr
   42     | Expr Operator Expr .
   44     | Expr . INSTANCEOF Expr_type
   59 Access: Expr . '.' IDENT

    INSTANCEOF  shift, and go to state 74
    OR          shift, and go to state 75
    AND         shift, and go to state 76
    EQUALS      shift, and go to state 77
    UNEQUAL     shift, and go to state 78
    GR          shift, and go to state 79
    GRE         shift, and go to state 80
    LESS        shift, and go to state 81
    LESSE       shift, and go to state 82
    PLUS        shift, and go to state 83
    MINUS       shift, and go to state 84
    MULTIPLY    shift, and go to state 85
    DIV         shift, and go to state 86
    MOD         shift, and go to state 87
    INC         shift, and go to state 88
    DEC         shift, and go to state 89
    '.'         shift, and go to state 90

    INSTANCEOF  [reduce using rule 42 (Expr)]
    OR          [reduce using rule 42 (Expr)]
    AND         [reduce using rule 42 (Expr)]
    EQUALS      [reduce using rule 42 (Expr)]
    UNEQUAL     [reduce using rule 42 (Expr)]
    GR          [reduce using rule 42 (Expr)]
    GRE         [reduce using rule 42 (Expr)]
    LESS        [reduce using rule 42 (Expr)]
    LESSE       [reduce using rule 42 (Expr)]
    PLUS        [reduce using rule 42 (Expr)]
    MINUS       [reduce using rule 42 (Expr)]
    MULTIPLY    [reduce using rule 42 (Expr)]
    DIV         [reduce using rule 42 (Expr)]
    MOD         [reduce using rule 42 (Expr)]
    INC         [reduce using rule 42 (Expr)]
    DEC         [reduce using rule 42 (Expr)]
    '.'         [reduce using rule 42 (Expr)]
    $default    reduce using rule 42 (Expr)

    Operator  go to state 91


state 110

   32 Expr: Access EQUAL Expr .
   37     | Expr . INC
   38     | Expr . DEC
   42     | Expr . Operator Expr
   44     | Expr . INSTANCEOF Expr_type
   59 Access: Expr . '.' IDENT

    INSTANCEOF  shift, and go to state 74
    OR          shift, and go to state 75
    AND         shift, and go to state 76
    EQUALS      shift, and go to state 77
    UNEQUAL     shift, and go to state 78
    GR          shift, and go to state 79
    GRE         shift, and go to state 80
    LESS        shift, and go to state 81
    LESSE       shift, and go to state 82
    PLUS        shift, and go to state 83
    MINUS       shift, and go to state 84
    MULTIPLY    shift, and go to state 85
    DIV         shift, and go to state 86
    MOD         shift, and go to state 87
    INC         shift, and go to state 88
    DEC         shift, and go to state 89
    '.'         shift, and go to state 90

    '.'       [reduce using rule 32 (Expr)]
    $default  reduce using rule 32 (Expr)

    Operator  go to state 91
state 122

   37 Expr: Expr . INC
   38     | Expr . DEC
   42     | Expr . Operator Expr
   43     | '(' Expr_type ')' Expr .
   44     | Expr . INSTANCEOF Expr_type
   59 Access: Expr . '.' IDENT

    INSTANCEOF  shift, and go to state 74
    OR          shift, and go to state 75
    AND         shift, and go to state 76
    EQUALS      shift, and go to state 77
    UNEQUAL     shift, and go to state 78
    GR          shift, and go to state 79
    GRE         shift, and go to state 80
    LESS        shift, and go to state 81
    LESSE       shift, and go to state 82
    PLUS        shift, and go to state 83
    MINUS       shift, and go to state 84
    MULTIPLY    shift, and go to state 85
    DIV         shift, and go to state 86
    MOD         shift, and go to state 87
    INC         shift, and go to state 88
    DEC         shift, and go to state 89
    '.'         shift, and go to state 90

    INSTANCEOF  [reduce using rule 43 (Expr)]
    OR          [reduce using rule 43 (Expr)]
    AND         [reduce using rule 43 (Expr)]
    EQUALS      [reduce using rule 43 (Expr)]
    UNEQUAL     [reduce using rule 43 (Expr)]
    GR          [reduce using rule 43 (Expr)]
    GRE         [reduce using rule 43 (Expr)]
    LESS        [reduce using rule 43 (Expr)]
    LESSE       [reduce using rule 43 (Expr)]
    PLUS        [reduce using rule 43 (Expr)]
    MINUS       [reduce using rule 43 (Expr)]
    MULTIPLY    [reduce using rule 43 (Expr)]
    DIV         [reduce using rule 43 (Expr)]
    MOD         [reduce using rule 43 (Expr)]
    INC         [reduce using rule 43 (Expr)]
    DEC         [reduce using rule 43 (Expr)]
    '.'         [reduce using rule 43 (Expr)]
    $default    reduce using rule 43 (Expr)

    Operator  go to state 91

person sterling128    schedule 07.01.2021    source источник
comment
stackoverflow.com/a/47450643/1566221   -  person rici    schedule 07.01.2021