gitlab.com/thomasboni/go-enry/v2@v2.8.3-0.20220418031202-30b0d7a3de98/_testdata/Java/GrammarKit.java (about)

     1  // This is a generated file. Not intended for manual editing.
     2  package org.intellij.grammar.parser;
     3  
     4  import com.intellij.lang.PsiBuilder;
     5  import com.intellij.lang.PsiBuilder.Marker;
     6  import static org.intellij.grammar.psi.BnfTypes.*;
     7  import static org.intellij.grammar.parser.GeneratedParserUtilBase.*;
     8  import com.intellij.psi.tree.IElementType;
     9  import com.intellij.lang.ASTNode;
    10  import com.intellij.psi.tree.TokenSet;
    11  import com.intellij.lang.PsiParser;
    12  import com.intellij.lang.LightPsiParser;
    13  
    14  @SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"})
    15  public class GrammarParser implements PsiParser, LightPsiParser {
    16  
    17    public ASTNode parse(IElementType t, PsiBuilder b) {
    18      parseLight(t, b);
    19      return b.getTreeBuilt();
    20    }
    21  
    22    public void parseLight(IElementType t, PsiBuilder b) {
    23      boolean r;
    24      b = adapt_builder_(t, b, this, EXTENDS_SETS_);
    25      Marker m = enter_section_(b, 0, _COLLAPSE_, null);
    26      if (t == BNF_ATTR) {
    27        r = attr(b, 0);
    28      }
    29      else if (t == BNF_ATTR_PATTERN) {
    30        r = attr_pattern(b, 0);
    31      }
    32      else if (t == BNF_ATTR_VALUE) {
    33        r = attr_value(b, 0);
    34      }
    35      else if (t == BNF_ATTRS) {
    36        r = attrs(b, 0);
    37      }
    38      else if (t == BNF_CHOICE) {
    39        r = choice(b, 0);
    40      }
    41      else if (t == BNF_EXPRESSION) {
    42        r = expression(b, 0);
    43      }
    44      else if (t == BNF_LITERAL_EXPRESSION) {
    45        r = literal_expression(b, 0);
    46      }
    47      else if (t == BNF_MODIFIER) {
    48        r = modifier(b, 0);
    49      }
    50      else if (t == BNF_PAREN_EXPRESSION) {
    51        r = paren_expression(b, 0);
    52      }
    53      else if (t == BNF_PREDICATE) {
    54        r = predicate(b, 0);
    55      }
    56      else if (t == BNF_PREDICATE_SIGN) {
    57        r = predicate_sign(b, 0);
    58      }
    59      else if (t == BNF_QUANTIFIED) {
    60        r = quantified(b, 0);
    61      }
    62      else if (t == BNF_QUANTIFIER) {
    63        r = quantifier(b, 0);
    64      }
    65      else if (t == BNF_REFERENCE_OR_TOKEN) {
    66        r = reference_or_token(b, 0);
    67      }
    68      else if (t == BNF_RULE) {
    69        r = rule(b, 0);
    70      }
    71      else if (t == BNF_SEQUENCE) {
    72        r = sequence(b, 0);
    73      }
    74      else if (t == BNF_STRING_LITERAL_EXPRESSION) {
    75        r = string_literal_expression(b, 0);
    76      }
    77      else {
    78        r = parse_root_(t, b, 0);
    79      }
    80      exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);
    81    }
    82  
    83    protected boolean parse_root_(IElementType t, PsiBuilder b, int l) {
    84      return grammar(b, l + 1);
    85    }
    86  
    87    public static final TokenSet[] EXTENDS_SETS_ = new TokenSet[] {
    88      create_token_set_(BNF_LITERAL_EXPRESSION, BNF_STRING_LITERAL_EXPRESSION),
    89      create_token_set_(BNF_CHOICE, BNF_EXPRESSION, BNF_LITERAL_EXPRESSION, BNF_PAREN_EXPRESSION,
    90        BNF_PREDICATE, BNF_QUANTIFIED, BNF_REFERENCE_OR_TOKEN, BNF_SEQUENCE,
    91        BNF_STRING_LITERAL_EXPRESSION),
    92    };
    93  
    94    /* ********************************************************** */
    95    // id attr_pattern? '=' attr_value ';'?
    96    public static boolean attr(PsiBuilder b, int l) {
    97      if (!recursion_guard_(b, l, "attr")) return false;
    98      boolean r, p;
    99      Marker m = enter_section_(b, l, _NONE_, "<attr>");
   100      r = consumeToken(b, BNF_ID);
   101      p = r; // pin = 1
   102      r = r && report_error_(b, attr_1(b, l + 1));
   103      r = p && report_error_(b, consumeToken(b, BNF_OP_EQ)) && r;
   104      r = p && report_error_(b, attr_value(b, l + 1)) && r;
   105      r = p && attr_4(b, l + 1) && r;
   106      exit_section_(b, l, m, BNF_ATTR, r, p, attr_recover_until_parser_);
   107      return r || p;
   108    }
   109  
   110    // attr_pattern?
   111    private static boolean attr_1(PsiBuilder b, int l) {
   112      if (!recursion_guard_(b, l, "attr_1")) return false;
   113      attr_pattern(b, l + 1);
   114      return true;
   115    }
   116  
   117    // ';'?
   118    private static boolean attr_4(PsiBuilder b, int l) {
   119      if (!recursion_guard_(b, l, "attr_4")) return false;
   120      consumeToken(b, BNF_SEMICOLON);
   121      return true;
   122    }
   123  
   124    /* ********************************************************** */
   125    // '(' string ')'
   126    public static boolean attr_pattern(PsiBuilder b, int l) {
   127      if (!recursion_guard_(b, l, "attr_pattern")) return false;
   128      if (!nextTokenIs(b, BNF_LEFT_PAREN)) return false;
   129      boolean r;
   130      Marker m = enter_section_(b);
   131      r = consumeToken(b, BNF_LEFT_PAREN);
   132      r = r && consumeToken(b, BNF_STRING);
   133      r = r && consumeToken(b, BNF_RIGHT_PAREN);
   134      exit_section_(b, m, BNF_ATTR_PATTERN, r);
   135      return r;
   136    }
   137  
   138    /* ********************************************************** */
   139    // !'}'
   140    static boolean attr_recover_until(PsiBuilder b, int l) {
   141      if (!recursion_guard_(b, l, "attr_recover_until")) return false;
   142      boolean r;
   143      Marker m = enter_section_(b, l, _NOT_, null);
   144      r = !consumeToken(b, BNF_RIGHT_BRACE);
   145      exit_section_(b, l, m, null, r, false, null);
   146      return r;
   147    }
   148  
   149    /* ********************************************************** */
   150    // (reference_or_token | literal_expression) !'='
   151    public static boolean attr_value(PsiBuilder b, int l) {
   152      if (!recursion_guard_(b, l, "attr_value")) return false;
   153      boolean r;
   154      Marker m = enter_section_(b, l, _NONE_, "<attr value>");
   155      r = attr_value_0(b, l + 1);
   156      r = r && attr_value_1(b, l + 1);
   157      exit_section_(b, l, m, BNF_ATTR_VALUE, r, false, null);
   158      return r;
   159    }
   160  
   161    // reference_or_token | literal_expression
   162    private static boolean attr_value_0(PsiBuilder b, int l) {
   163      if (!recursion_guard_(b, l, "attr_value_0")) return false;
   164      boolean r;
   165      Marker m = enter_section_(b);
   166      r = reference_or_token(b, l + 1);
   167      if (!r) r = literal_expression(b, l + 1);
   168      exit_section_(b, m, null, r);
   169      return r;
   170    }
   171  
   172    // !'='
   173    private static boolean attr_value_1(PsiBuilder b, int l) {
   174      if (!recursion_guard_(b, l, "attr_value_1")) return false;
   175      boolean r;
   176      Marker m = enter_section_(b, l, _NOT_, null);
   177      r = !consumeToken(b, BNF_OP_EQ);
   178      exit_section_(b, l, m, null, r, false, null);
   179      return r;
   180    }
   181  
   182    /* ********************************************************** */
   183    // '{' attr* '}'
   184    public static boolean attrs(PsiBuilder b, int l) {
   185      if (!recursion_guard_(b, l, "attrs")) return false;
   186      if (!nextTokenIs(b, BNF_LEFT_BRACE)) return false;
   187      boolean r, p;
   188      Marker m = enter_section_(b, l, _NONE_, null);
   189      r = consumeToken(b, BNF_LEFT_BRACE);
   190      p = r; // pin = 1
   191      r = r && report_error_(b, attrs_1(b, l + 1));
   192      r = p && consumeToken(b, BNF_RIGHT_BRACE) && r;
   193      exit_section_(b, l, m, BNF_ATTRS, r, p, null);
   194      return r || p;
   195    }
   196  
   197    // attr*
   198    private static boolean attrs_1(PsiBuilder b, int l) {
   199      if (!recursion_guard_(b, l, "attrs_1")) return false;
   200      int c = current_position_(b);
   201      while (true) {
   202        if (!attr(b, l + 1)) break;
   203        if (!empty_element_parsed_guard_(b, "attrs_1", c)) break;
   204        c = current_position_(b);
   205      }
   206      return true;
   207    }
   208  
   209    /* ********************************************************** */
   210    // '{' sequence ('|' sequence)* '}' | sequence choice_tail*
   211    public static boolean choice(PsiBuilder b, int l) {
   212      if (!recursion_guard_(b, l, "choice")) return false;
   213      boolean r;
   214      Marker m = enter_section_(b, l, _COLLAPSE_, "<choice>");
   215      r = choice_0(b, l + 1);
   216      if (!r) r = choice_1(b, l + 1);
   217      exit_section_(b, l, m, BNF_CHOICE, r, false, null);
   218      return r;
   219    }
   220  
   221    // '{' sequence ('|' sequence)* '}'
   222    private static boolean choice_0(PsiBuilder b, int l) {
   223      if (!recursion_guard_(b, l, "choice_0")) return false;
   224      boolean r;
   225      Marker m = enter_section_(b);
   226      r = consumeToken(b, BNF_LEFT_BRACE);
   227      r = r && sequence(b, l + 1);
   228      r = r && choice_0_2(b, l + 1);
   229      r = r && consumeToken(b, BNF_RIGHT_BRACE);
   230      exit_section_(b, m, null, r);
   231      return r;
   232    }
   233  
   234    // ('|' sequence)*
   235    private static boolean choice_0_2(PsiBuilder b, int l) {
   236      if (!recursion_guard_(b, l, "choice_0_2")) return false;
   237      int c = current_position_(b);
   238      while (true) {
   239        if (!choice_0_2_0(b, l + 1)) break;
   240        if (!empty_element_parsed_guard_(b, "choice_0_2", c)) break;
   241        c = current_position_(b);
   242      }
   243      return true;
   244    }
   245  
   246    // '|' sequence
   247    private static boolean choice_0_2_0(PsiBuilder b, int l) {
   248      if (!recursion_guard_(b, l, "choice_0_2_0")) return false;
   249      boolean r;
   250      Marker m = enter_section_(b);
   251      r = consumeToken(b, BNF_OP_OR);
   252      r = r && sequence(b, l + 1);
   253      exit_section_(b, m, null, r);
   254      return r;
   255    }
   256  
   257    // sequence choice_tail*
   258    private static boolean choice_1(PsiBuilder b, int l) {
   259      if (!recursion_guard_(b, l, "choice_1")) return false;
   260      boolean r;
   261      Marker m = enter_section_(b);
   262      r = sequence(b, l + 1);
   263      r = r && choice_1_1(b, l + 1);
   264      exit_section_(b, m, null, r);
   265      return r;
   266    }
   267  
   268    // choice_tail*
   269    private static boolean choice_1_1(PsiBuilder b, int l) {
   270      if (!recursion_guard_(b, l, "choice_1_1")) return false;
   271      int c = current_position_(b);
   272      while (true) {
   273        if (!choice_tail(b, l + 1)) break;
   274        if (!empty_element_parsed_guard_(b, "choice_1_1", c)) break;
   275        c = current_position_(b);
   276      }
   277      return true;
   278    }
   279  
   280    /* ********************************************************** */
   281    // '|' sequence
   282    static boolean choice_tail(PsiBuilder b, int l) {
   283      if (!recursion_guard_(b, l, "choice_tail")) return false;
   284      if (!nextTokenIs(b, BNF_OP_OR)) return false;
   285      boolean r, p;
   286      Marker m = enter_section_(b, l, _NONE_, null);
   287      r = consumeToken(b, BNF_OP_OR);
   288      p = r; // pin = 1
   289      r = r && sequence(b, l + 1);
   290      exit_section_(b, l, m, null, r, p, null);
   291      return r || p;
   292    }
   293  
   294    /* ********************************************************** */
   295    // choice?
   296    public static boolean expression(PsiBuilder b, int l) {
   297      if (!recursion_guard_(b, l, "expression")) return false;
   298      Marker m = enter_section_(b, l, _COLLAPSE_, "<expression>");
   299      choice(b, l + 1);
   300      exit_section_(b, l, m, BNF_EXPRESSION, true, false, null);
   301      return true;
   302    }
   303  
   304    /* ********************************************************** */
   305    // (attrs | rule) *
   306    static boolean grammar(PsiBuilder b, int l) {
   307      if (!recursion_guard_(b, l, "grammar")) return false;
   308      int c = current_position_(b);
   309      while (true) {
   310        if (!grammar_0(b, l + 1)) break;
   311        if (!empty_element_parsed_guard_(b, "grammar", c)) break;
   312        c = current_position_(b);
   313      }
   314      return true;
   315    }
   316  
   317    // attrs | rule
   318    private static boolean grammar_0(PsiBuilder b, int l) {
   319      if (!recursion_guard_(b, l, "grammar_0")) return false;
   320      boolean r;
   321      Marker m = enter_section_(b);
   322      r = attrs(b, l + 1);
   323      if (!r) r = rule(b, l + 1);
   324      exit_section_(b, m, null, r);
   325      return r;
   326    }
   327  
   328    /* ********************************************************** */
   329    // string_literal_expression | number
   330    public static boolean literal_expression(PsiBuilder b, int l) {
   331      if (!recursion_guard_(b, l, "literal_expression")) return false;
   332      if (!nextTokenIs(b, "<literal expression>", BNF_NUMBER, BNF_STRING)) return false;
   333      boolean r;
   334      Marker m = enter_section_(b, l, _COLLAPSE_, "<literal expression>");
   335      r = string_literal_expression(b, l + 1);
   336      if (!r) r = consumeToken(b, BNF_NUMBER);
   337      exit_section_(b, l, m, BNF_LITERAL_EXPRESSION, r, false, null);
   338      return r;
   339    }
   340  
   341    /* ********************************************************** */
   342    // 'private' | 'external' | 'wrapped'
   343    public static boolean modifier(PsiBuilder b, int l) {
   344      if (!recursion_guard_(b, l, "modifier")) return false;
   345      boolean r;
   346      Marker m = enter_section_(b, l, _NONE_, "<modifier>");
   347      r = consumeToken(b, "private");
   348      if (!r) r = consumeToken(b, "external");
   349      if (!r) r = consumeToken(b, "wrapped");
   350      exit_section_(b, l, m, BNF_MODIFIER, r, false, null);
   351      return r;
   352    }
   353  
   354    /* ********************************************************** */
   355    // quantified | predicate
   356    static boolean option(PsiBuilder b, int l) {
   357      if (!recursion_guard_(b, l, "option")) return false;
   358      boolean r;
   359      Marker m = enter_section_(b);
   360      r = quantified(b, l + 1);
   361      if (!r) r = predicate(b, l + 1);
   362      exit_section_(b, m, null, r);
   363      return r;
   364    }
   365  
   366    /* ********************************************************** */
   367    // '(' expression ')'
   368    public static boolean paren_expression(PsiBuilder b, int l) {
   369      if (!recursion_guard_(b, l, "paren_expression")) return false;
   370      if (!nextTokenIs(b, BNF_LEFT_PAREN)) return false;
   371      boolean r, p;
   372      Marker m = enter_section_(b, l, _NONE_, null);
   373      r = consumeToken(b, BNF_LEFT_PAREN);
   374      p = r; // pin = 1
   375      r = r && report_error_(b, expression(b, l + 1));
   376      r = p && consumeToken(b, BNF_RIGHT_PAREN) && r;
   377      exit_section_(b, l, m, BNF_PAREN_EXPRESSION, r, p, null);
   378      return r || p;
   379    }
   380  
   381    /* ********************************************************** */
   382    // predicate_sign  simple
   383    public static boolean predicate(PsiBuilder b, int l) {
   384      if (!recursion_guard_(b, l, "predicate")) return false;
   385      if (!nextTokenIs(b, "<predicate>", BNF_OP_NOT, BNF_OP_AND)) return false;
   386      boolean r;
   387      Marker m = enter_section_(b, l, _NONE_, "<predicate>");
   388      r = predicate_sign(b, l + 1);
   389      r = r && simple(b, l + 1);
   390      exit_section_(b, l, m, BNF_PREDICATE, r, false, null);
   391      return r;
   392    }
   393  
   394    /* ********************************************************** */
   395    // '&' | '!'
   396    public static boolean predicate_sign(PsiBuilder b, int l) {
   397      if (!recursion_guard_(b, l, "predicate_sign")) return false;
   398      if (!nextTokenIs(b, "<predicate sign>", BNF_OP_NOT, BNF_OP_AND)) return false;
   399      boolean r;
   400      Marker m = enter_section_(b, l, _NONE_, "<predicate sign>");
   401      r = consumeToken(b, BNF_OP_AND);
   402      if (!r) r = consumeToken(b, BNF_OP_NOT);
   403      exit_section_(b, l, m, BNF_PREDICATE_SIGN, r, false, null);
   404      return r;
   405    }
   406  
   407    /* ********************************************************** */
   408    // '[' expression ']' | simple quantifier?
   409    public static boolean quantified(PsiBuilder b, int l) {
   410      if (!recursion_guard_(b, l, "quantified")) return false;
   411      boolean r;
   412      Marker m = enter_section_(b, l, _COLLAPSE_, "<quantified>");
   413      r = quantified_0(b, l + 1);
   414      if (!r) r = quantified_1(b, l + 1);
   415      exit_section_(b, l, m, BNF_QUANTIFIED, r, false, null);
   416      return r;
   417    }
   418  
   419    // '[' expression ']'
   420    private static boolean quantified_0(PsiBuilder b, int l) {
   421      if (!recursion_guard_(b, l, "quantified_0")) return false;
   422      boolean r;
   423      Marker m = enter_section_(b);
   424      r = consumeToken(b, BNF_LEFT_BRACKET);
   425      r = r && expression(b, l + 1);
   426      r = r && consumeToken(b, BNF_RIGHT_BRACKET);
   427      exit_section_(b, m, null, r);
   428      return r;
   429    }
   430  
   431    // simple quantifier?
   432    private static boolean quantified_1(PsiBuilder b, int l) {
   433      if (!recursion_guard_(b, l, "quantified_1")) return false;
   434      boolean r;
   435      Marker m = enter_section_(b);
   436      r = simple(b, l + 1);
   437      r = r && quantified_1_1(b, l + 1);
   438      exit_section_(b, m, null, r);
   439      return r;
   440    }
   441  
   442    // quantifier?
   443    private static boolean quantified_1_1(PsiBuilder b, int l) {
   444      if (!recursion_guard_(b, l, "quantified_1_1")) return false;
   445      quantifier(b, l + 1);
   446      return true;
   447    }
   448  
   449    /* ********************************************************** */
   450    // '?' | '+' | '*'
   451    public static boolean quantifier(PsiBuilder b, int l) {
   452      if (!recursion_guard_(b, l, "quantifier")) return false;
   453      boolean r;
   454      Marker m = enter_section_(b, l, _NONE_, "<quantifier>");
   455      r = consumeToken(b, BNF_OP_OPT);
   456      if (!r) r = consumeToken(b, BNF_OP_ONEMORE);
   457      if (!r) r = consumeToken(b, BNF_OP_ZEROMORE);
   458      exit_section_(b, l, m, BNF_QUANTIFIER, r, false, null);
   459      return r;
   460    }
   461  
   462    /* ********************************************************** */
   463    // id
   464    public static boolean reference_or_token(PsiBuilder b, int l) {
   465      if (!recursion_guard_(b, l, "reference_or_token")) return false;
   466      if (!nextTokenIs(b, BNF_ID)) return false;
   467      boolean r;
   468      Marker m = enter_section_(b);
   469      r = consumeToken(b, BNF_ID);
   470      exit_section_(b, m, BNF_REFERENCE_OR_TOKEN, r);
   471      return r;
   472    }
   473  
   474    /* ********************************************************** */
   475    // modifier* id '::=' expression attrs? ';'?
   476    public static boolean rule(PsiBuilder b, int l) {
   477      if (!recursion_guard_(b, l, "rule")) return false;
   478      boolean r, p;
   479      Marker m = enter_section_(b, l, _NONE_, "<rule>");
   480      r = rule_0(b, l + 1);
   481      r = r && consumeToken(b, BNF_ID);
   482      r = r && consumeToken(b, BNF_OP_IS);
   483      p = r; // pin = 3
   484      r = r && report_error_(b, expression(b, l + 1));
   485      r = p && report_error_(b, rule_4(b, l + 1)) && r;
   486      r = p && rule_5(b, l + 1) && r;
   487      exit_section_(b, l, m, BNF_RULE, r, p, rule_recover_until_parser_);
   488      return r || p;
   489    }
   490  
   491    // modifier*
   492    private static boolean rule_0(PsiBuilder b, int l) {
   493      if (!recursion_guard_(b, l, "rule_0")) return false;
   494      int c = current_position_(b);
   495      while (true) {
   496        if (!modifier(b, l + 1)) break;
   497        if (!empty_element_parsed_guard_(b, "rule_0", c)) break;
   498        c = current_position_(b);
   499      }
   500      return true;
   501    }
   502  
   503    // attrs?
   504    private static boolean rule_4(PsiBuilder b, int l) {
   505      if (!recursion_guard_(b, l, "rule_4")) return false;
   506      attrs(b, l + 1);
   507      return true;
   508    }
   509  
   510    // ';'?
   511    private static boolean rule_5(PsiBuilder b, int l) {
   512      if (!recursion_guard_(b, l, "rule_5")) return false;
   513      consumeToken(b, BNF_SEMICOLON);
   514      return true;
   515    }
   516  
   517    /* ********************************************************** */
   518    // !'{'
   519    static boolean rule_recover_until(PsiBuilder b, int l) {
   520      if (!recursion_guard_(b, l, "rule_recover_until")) return false;
   521      boolean r;
   522      Marker m = enter_section_(b, l, _NOT_, null);
   523      r = !consumeToken(b, BNF_LEFT_BRACE);
   524      exit_section_(b, l, m, null, r, false, null);
   525      return r;
   526    }
   527  
   528    /* ********************************************************** */
   529    // option +
   530    public static boolean sequence(PsiBuilder b, int l) {
   531      if (!recursion_guard_(b, l, "sequence")) return false;
   532      boolean r;
   533      Marker m = enter_section_(b, l, _COLLAPSE_, "<sequence>");
   534      r = option(b, l + 1);
   535      int c = current_position_(b);
   536      while (r) {
   537        if (!option(b, l + 1)) break;
   538        if (!empty_element_parsed_guard_(b, "sequence", c)) break;
   539        c = current_position_(b);
   540      }
   541      exit_section_(b, l, m, BNF_SEQUENCE, r, false, null);
   542      return r;
   543    }
   544  
   545    /* ********************************************************** */
   546    // !(modifier* id '::=' ) reference_or_token | literal_expression | paren_expression
   547    static boolean simple(PsiBuilder b, int l) {
   548      if (!recursion_guard_(b, l, "simple")) return false;
   549      boolean r;
   550      Marker m = enter_section_(b);
   551      r = simple_0(b, l + 1);
   552      if (!r) r = literal_expression(b, l + 1);
   553      if (!r) r = paren_expression(b, l + 1);
   554      exit_section_(b, m, null, r);
   555      return r;
   556    }
   557  
   558    // !(modifier* id '::=' ) reference_or_token
   559    private static boolean simple_0(PsiBuilder b, int l) {
   560      if (!recursion_guard_(b, l, "simple_0")) return false;
   561      boolean r;
   562      Marker m = enter_section_(b);
   563      r = simple_0_0(b, l + 1);
   564      r = r && reference_or_token(b, l + 1);
   565      exit_section_(b, m, null, r);
   566      return r;
   567    }
   568  
   569    // !(modifier* id '::=' )
   570    private static boolean simple_0_0(PsiBuilder b, int l) {
   571      if (!recursion_guard_(b, l, "simple_0_0")) return false;
   572      boolean r;
   573      Marker m = enter_section_(b, l, _NOT_, null);
   574      r = !simple_0_0_0(b, l + 1);
   575      exit_section_(b, l, m, null, r, false, null);
   576      return r;
   577    }
   578  
   579    // modifier* id '::='
   580    private static boolean simple_0_0_0(PsiBuilder b, int l) {
   581      if (!recursion_guard_(b, l, "simple_0_0_0")) return false;
   582      boolean r;
   583      Marker m = enter_section_(b);
   584      r = simple_0_0_0_0(b, l + 1);
   585      r = r && consumeToken(b, BNF_ID);
   586      r = r && consumeToken(b, BNF_OP_IS);
   587      exit_section_(b, m, null, r);
   588      return r;
   589    }
   590  
   591    // modifier*
   592    private static boolean simple_0_0_0_0(PsiBuilder b, int l) {
   593      if (!recursion_guard_(b, l, "simple_0_0_0_0")) return false;
   594      int c = current_position_(b);
   595      while (true) {
   596        if (!modifier(b, l + 1)) break;
   597        if (!empty_element_parsed_guard_(b, "simple_0_0_0_0", c)) break;
   598        c = current_position_(b);
   599      }
   600      return true;
   601    }
   602  
   603    /* ********************************************************** */
   604    // string
   605    public static boolean string_literal_expression(PsiBuilder b, int l) {
   606      if (!recursion_guard_(b, l, "string_literal_expression")) return false;
   607      if (!nextTokenIs(b, BNF_STRING)) return false;
   608      boolean r;
   609      Marker m = enter_section_(b);
   610      r = consumeToken(b, BNF_STRING);
   611      exit_section_(b, m, BNF_STRING_LITERAL_EXPRESSION, r);
   612      return r;
   613    }
   614  
   615    final static Parser attr_recover_until_parser_ = new Parser() {
   616      public boolean parse(PsiBuilder b, int l) {
   617        return attr_recover_until(b, l + 1);
   618      }
   619    };
   620    final static Parser rule_recover_until_parser_ = new Parser() {
   621      public boolean parse(PsiBuilder b, int l) {
   622        return rule_recover_until(b, l + 1);
   623      }
   624    };
   625  }