// This is a generated file. Not intended for manual editing.
package com.jetbrains.python.requirements.psi.parser;

import com.intellij.lang.PsiBuilder;
import com.intellij.lang.PsiBuilder.Marker;
import static com.jetbrains.python.requirements.psi.RequirementsTypes.*;
import static com.intellij.lang.parser.GeneratedParserUtilBase.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.lang.ASTNode;
import com.intellij.psi.tree.TokenSet;
import com.intellij.lang.PsiParser;
import com.intellij.lang.LightPsiParser;

@SuppressWarnings({"SimplifiableIfStatement", "UnusedAssignment"})
public class RequirementsParser implements PsiParser, LightPsiParser {

  public ASTNode parse(IElementType t, PsiBuilder b) {
    parseLight(t, b);
    return b.getTreeBuilt();
  }

  public void parseLight(IElementType t, PsiBuilder b) {
    boolean r;
    b = adapt_builder_(t, b, this, null);
    Marker m = enter_section_(b, 0, _COLLAPSE_, null);
    r = parse_root_(t, b);
    exit_section_(b, 0, m, t, r, true, TRUE_CONDITION);
  }

  protected boolean parse_root_(IElementType t, PsiBuilder b) {
    return parse_root_(t, b, 0);
  }

  static boolean parse_root_(IElementType t, PsiBuilder b, int l) {
    return requirementsFile(b, l + 1);
  }

  /* ********************************************************** */
  // LSBRACE (IPv6address | IPvFuture) RSBRACE
  public static boolean IP_literal(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IP_literal")) return false;
    if (!nextTokenIs(b, LSBRACE)) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeToken(b, LSBRACE);
    r = r && IP_literal_1(b, l + 1);
    r = r && consumeToken(b, RSBRACE);
    exit_section_(b, m, IP_LITERAL, r);
    return r;
  }

  // IPv6address | IPvFuture
  private static boolean IP_literal_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IP_literal_1")) return false;
    boolean r;
    r = IPv6address(b, l + 1);
    if (!r) r = IPvFuture(b, l + 1);
    return r;
  }

  /* ********************************************************** */
  // dec_octet DOT dec_octet DOT dec_octet DOT dec_octet
  public static boolean IPv4address(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv4address")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, I_PV_4_ADDRESS, "<i pv 4 address>");
    r = dec_octet(b, l + 1);
    r = r && consumeToken(b, DOT);
    r = r && dec_octet(b, l + 1);
    r = r && consumeToken(b, DOT);
    r = r && dec_octet(b, l + 1);
    r = r && consumeToken(b, DOT);
    r = r && dec_octet(b, l + 1);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  /* ********************************************************** */
  // h16_colon h16_colon h16_colon h16_colon h16_colon h16_colon ls32
  //                   | COLON COLON h16_colon h16_colon h16_colon h16_colon h16_colon ls32
  //                   | h16?  COLON COLON h16_colon h16_colon h16_colon h16_colon ls32
  //                   | (h16_colon? h16)? COLON COLON h16_colon h16_colon h16_colon ls32
  //                   | (h16_colon? h16_colon? h16 )? COLON COLON h16_colon h16_colon ls32
  //                   | (h16_colon? h16_colon? h16_colon? h16 )? COLON COLON h16_colon ls32
  //                   | (h16_colon? h16_colon? h16_colon? h16_colon? h16 )? COLON COLON ls32
  //                   | (h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16 )? COLON COLON h16
  //                   | (h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16 )? COLON COLON
  public static boolean IPv6address(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, I_PV_6_ADDRESS, "<i pv 6 address>");
    r = IPv6address_0(b, l + 1);
    if (!r) r = IPv6address_1(b, l + 1);
    if (!r) r = IPv6address_2(b, l + 1);
    if (!r) r = IPv6address_3(b, l + 1);
    if (!r) r = IPv6address_4(b, l + 1);
    if (!r) r = IPv6address_5(b, l + 1);
    if (!r) r = IPv6address_6(b, l + 1);
    if (!r) r = IPv6address_7(b, l + 1);
    if (!r) r = IPv6address_8(b, l + 1);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  // h16_colon h16_colon h16_colon h16_colon h16_colon h16_colon ls32
  private static boolean IPv6address_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && ls32(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // COLON COLON h16_colon h16_colon h16_colon h16_colon h16_colon ls32
  private static boolean IPv6address_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_1")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeTokens(b, 0, COLON, COLON);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && ls32(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16?  COLON COLON h16_colon h16_colon h16_colon h16_colon ls32
  private static boolean IPv6address_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_2")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_2_0(b, l + 1);
    r = r && consumeTokens(b, 0, COLON, COLON);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && ls32(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16?
  private static boolean IPv6address_2_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_2_0")) return false;
    h16(b, l + 1);
    return true;
  }

  // (h16_colon? h16)? COLON COLON h16_colon h16_colon h16_colon ls32
  private static boolean IPv6address_3(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_3")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_3_0(b, l + 1);
    r = r && consumeTokens(b, 0, COLON, COLON);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && ls32(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // (h16_colon? h16)?
  private static boolean IPv6address_3_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_3_0")) return false;
    IPv6address_3_0_0(b, l + 1);
    return true;
  }

  // h16_colon? h16
  private static boolean IPv6address_3_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_3_0_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_3_0_0_0(b, l + 1);
    r = r && h16(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16_colon?
  private static boolean IPv6address_3_0_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_3_0_0_0")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // (h16_colon? h16_colon? h16 )? COLON COLON h16_colon h16_colon ls32
  private static boolean IPv6address_4(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_4")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_4_0(b, l + 1);
    r = r && consumeTokens(b, 0, COLON, COLON);
    r = r && h16_colon(b, l + 1);
    r = r && h16_colon(b, l + 1);
    r = r && ls32(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // (h16_colon? h16_colon? h16 )?
  private static boolean IPv6address_4_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_4_0")) return false;
    IPv6address_4_0_0(b, l + 1);
    return true;
  }

  // h16_colon? h16_colon? h16
  private static boolean IPv6address_4_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_4_0_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_4_0_0_0(b, l + 1);
    r = r && IPv6address_4_0_0_1(b, l + 1);
    r = r && h16(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16_colon?
  private static boolean IPv6address_4_0_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_4_0_0_0")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_4_0_0_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_4_0_0_1")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // (h16_colon? h16_colon? h16_colon? h16 )? COLON COLON h16_colon ls32
  private static boolean IPv6address_5(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_5")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_5_0(b, l + 1);
    r = r && consumeTokens(b, 0, COLON, COLON);
    r = r && h16_colon(b, l + 1);
    r = r && ls32(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // (h16_colon? h16_colon? h16_colon? h16 )?
  private static boolean IPv6address_5_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_5_0")) return false;
    IPv6address_5_0_0(b, l + 1);
    return true;
  }

  // h16_colon? h16_colon? h16_colon? h16
  private static boolean IPv6address_5_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_5_0_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_5_0_0_0(b, l + 1);
    r = r && IPv6address_5_0_0_1(b, l + 1);
    r = r && IPv6address_5_0_0_2(b, l + 1);
    r = r && h16(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16_colon?
  private static boolean IPv6address_5_0_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_5_0_0_0")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_5_0_0_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_5_0_0_1")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_5_0_0_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_5_0_0_2")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // (h16_colon? h16_colon? h16_colon? h16_colon? h16 )? COLON COLON ls32
  private static boolean IPv6address_6(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_6")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_6_0(b, l + 1);
    r = r && consumeTokens(b, 0, COLON, COLON);
    r = r && ls32(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // (h16_colon? h16_colon? h16_colon? h16_colon? h16 )?
  private static boolean IPv6address_6_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_6_0")) return false;
    IPv6address_6_0_0(b, l + 1);
    return true;
  }

  // h16_colon? h16_colon? h16_colon? h16_colon? h16
  private static boolean IPv6address_6_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_6_0_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_6_0_0_0(b, l + 1);
    r = r && IPv6address_6_0_0_1(b, l + 1);
    r = r && IPv6address_6_0_0_2(b, l + 1);
    r = r && IPv6address_6_0_0_3(b, l + 1);
    r = r && h16(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16_colon?
  private static boolean IPv6address_6_0_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_6_0_0_0")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_6_0_0_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_6_0_0_1")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_6_0_0_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_6_0_0_2")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_6_0_0_3(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_6_0_0_3")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // (h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16 )? COLON COLON h16
  private static boolean IPv6address_7(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_7_0(b, l + 1);
    r = r && consumeTokens(b, 0, COLON, COLON);
    r = r && h16(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // (h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16 )?
  private static boolean IPv6address_7_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7_0")) return false;
    IPv6address_7_0_0(b, l + 1);
    return true;
  }

  // h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16
  private static boolean IPv6address_7_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7_0_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_7_0_0_0(b, l + 1);
    r = r && IPv6address_7_0_0_1(b, l + 1);
    r = r && IPv6address_7_0_0_2(b, l + 1);
    r = r && IPv6address_7_0_0_3(b, l + 1);
    r = r && IPv6address_7_0_0_4(b, l + 1);
    r = r && h16(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16_colon?
  private static boolean IPv6address_7_0_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7_0_0_0")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_7_0_0_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7_0_0_1")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_7_0_0_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7_0_0_2")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_7_0_0_3(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7_0_0_3")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_7_0_0_4(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_7_0_0_4")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // (h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16 )? COLON COLON
  private static boolean IPv6address_8(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_8_0(b, l + 1);
    r = r && consumeTokens(b, 0, COLON, COLON);
    exit_section_(b, m, null, r);
    return r;
  }

  // (h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16 )?
  private static boolean IPv6address_8_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0")) return false;
    IPv6address_8_0_0(b, l + 1);
    return true;
  }

  // h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16_colon? h16
  private static boolean IPv6address_8_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPv6address_8_0_0_0(b, l + 1);
    r = r && IPv6address_8_0_0_1(b, l + 1);
    r = r && IPv6address_8_0_0_2(b, l + 1);
    r = r && IPv6address_8_0_0_3(b, l + 1);
    r = r && IPv6address_8_0_0_4(b, l + 1);
    r = r && IPv6address_8_0_0_5(b, l + 1);
    r = r && h16(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // h16_colon?
  private static boolean IPv6address_8_0_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0_0_0")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_8_0_0_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0_0_1")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_8_0_0_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0_0_2")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_8_0_0_3(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0_0_3")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_8_0_0_4(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0_0_4")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  // h16_colon?
  private static boolean IPv6address_8_0_0_5(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPv6address_8_0_0_5")) return false;
    h16_colon(b, l + 1);
    return true;
  }

  /* ********************************************************** */
  // 'v' hexdig+ DOT (unreserved | SUB_DELIMS | DOLLAR_SIGN | COLON)+
  public static boolean IPvFuture(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPvFuture")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, I_PV_FUTURE, "<i pv future>");
    r = consumeToken(b, "v");
    r = r && IPvFuture_1(b, l + 1);
    r = r && consumeToken(b, DOT);
    r = r && IPvFuture_3(b, l + 1);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  // hexdig+
  private static boolean IPvFuture_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPvFuture_1")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = hexdig(b, l + 1);
    while (r) {
      int c = current_position_(b);
      if (!hexdig(b, l + 1)) break;
      if (!empty_element_parsed_guard_(b, "IPvFuture_1", c)) break;
    }
    exit_section_(b, m, null, r);
    return r;
  }

  // (unreserved | SUB_DELIMS | DOLLAR_SIGN | COLON)+
  private static boolean IPvFuture_3(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPvFuture_3")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = IPvFuture_3_0(b, l + 1);
    while (r) {
      int c = current_position_(b);
      if (!IPvFuture_3_0(b, l + 1)) break;
      if (!empty_element_parsed_guard_(b, "IPvFuture_3", c)) break;
    }
    exit_section_(b, m, null, r);
    return r;
  }

  // unreserved | SUB_DELIMS | DOLLAR_SIGN | COLON
  private static boolean IPvFuture_3_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "IPvFuture_3_0")) return false;
    boolean r;
    r = unreserved(b, l + 1);
    if (!r) r = consumeToken(b, SUB_DELIMS);
    if (!r) r = consumeToken(b, DOLLAR_SIGN);
    if (!r) r = consumeToken(b, COLON);
    return r;
  }

  /* ********************************************************** */
  // (userinfo AT)? host (COLON port)?
  public static boolean authority(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "authority")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, AUTHORITY, "<authority>");
    r = authority_0(b, l + 1);
    r = r && host(b, l + 1);
    r = r && authority_2(b, l + 1);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  // (userinfo AT)?
  private static boolean authority_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "authority_0")) return false;
    authority_0_0(b, l + 1);
    return true;
  }

  // userinfo AT
  private static boolean authority_0_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "authority_0_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = userinfo(b, l + 1);
    r = r && consumeToken(b, AT);
    exit_section_(b, m, null, r);
    return r;
  }

  // (COLON port)?
  private static boolean authority_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "authority_2")) return false;
    authority_2_0(b, l + 1);
    return true;
  }

  // COLON port
  private static boolean authority_2_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "authority_2_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeToken(b, COLON);
    r = r && port(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  /* ********************************************************** */
  // extras_list | BINARY_ALL | BINARY_NONE
  public static boolean binary_list(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "binary_list")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, BINARY_LIST, "<binary list>");
    r = extras_list(b, l + 1);
    if (!r) r = consumeToken(b, BINARY_ALL);
    if (!r) r = consumeToken(b, BINARY_NONE);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  /* ********************************************************** */
  // CONSTRAINT  uri_reference
  public static boolean constraint_req(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "constraint_req")) return false;
    if (!nextTokenIs(b, CONSTRAINT)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_, CONSTRAINT_REQ, null);
    r = consumeToken(b, CONSTRAINT);
    p = r; // pin = 1
    r = r && uri_reference(b, l + 1);
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  /* ********************************************************** */
  // DIGIT // 0-9
  //                   | nz DIGIT // 10-99
  //                   | "1" DIGIT DIGIT // 100-199
  //                   | "2" ("0" | "1" | "2" | "3" | "4") DIGIT // 200-249
  //                   | "2" "5" ("0" | "1" | "2" | "3" | "4" | "5")
  public static boolean dec_octet(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "dec_octet")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, DEC_OCTET, "<dec octet>");
    r = consumeToken(b, DIGIT);
    if (!r) r = dec_octet_1(b, l + 1);
    if (!r) r = dec_octet_2(b, l + 1);
    if (!r) r = dec_octet_3(b, l + 1);
    if (!r) r = dec_octet_4(b, l + 1);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  // nz DIGIT
  private static boolean dec_octet_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "dec_octet_1")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = nz(b, l + 1);
    r = r && consumeToken(b, DIGIT);
    exit_section_(b, m, null, r);
    return r;
  }

  // "1" DIGIT DIGIT
  private static boolean dec_octet_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "dec_octet_2")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeToken(b, "1");
    r = r && consumeTokens(b, 0, DIGIT, DIGIT);
    exit_section_(b, m, null, r);
    return r;
  }

  // "2" ("0" | "1" | "2" | "3" | "4") DIGIT
  private static boolean dec_octet_3(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "dec_octet_3")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeToken(b, "2");
    r = r && dec_octet_3_1(b, l + 1);
    r = r && consumeToken(b, DIGIT);
    exit_section_(b, m, null, r);
    return r;
  }

  // "0" | "1" | "2" | "3" | "4"
  private static boolean dec_octet_3_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "dec_octet_3_1")) return false;
    boolean r;
    r = consumeToken(b, "0");
    if (!r) r = consumeToken(b, "1");
    if (!r) r = consumeToken(b, "2");
    if (!r) r = consumeToken(b, "3");
    if (!r) r = consumeToken(b, "4");
    return r;
  }

  // "2" "5" ("0" | "1" | "2" | "3" | "4" | "5")
  private static boolean dec_octet_4(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "dec_octet_4")) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeToken(b, "2");
    r = r && consumeToken(b, "5");
    r = r && dec_octet_4_2(b, l + 1);
    exit_section_(b, m, null, r);
    return r;
  }

  // "0" | "1" | "2" | "3" | "4" | "5"
  private static boolean dec_octet_4_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "dec_octet_4_2")) return false;
    boolean r;
    r = consumeToken(b, "0");
    if (!r) r = consumeToken(b, "1");
    if (!r) r = consumeToken(b, "2");
    if (!r) r = consumeToken(b, "3");
    if (!r) r = consumeToken(b, "4");
    if (!r) r = consumeToken(b, "5");
    return r;
  }

  /* ********************************************************** */
  // EDITABLE uri_reference
  public static boolean editable_req(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "editable_req")) return false;
    if (!nextTokenIs(b, EDITABLE)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_, EDITABLE_REQ, null);
    r = consumeToken(b, EDITABLE);
    p = r; // pin = 1
    r = r && uri_reference(b, l + 1);
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  /* ********************************************************** */
  // DOLLAR_SIGN LBRACE variable_name RBRACE
  public static boolean env_variable(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "env_variable")) return false;
    if (!nextTokenIs(b, DOLLAR_SIGN)) return false;
    boolean r;
    Marker m = enter_section_(b);
    r = consumeTokens(b, 0, DOLLAR_SIGN, LBRACE);
    r = r && variable_name(b, l + 1);
    r = r && consumeToken(b, RBRACE);
    exit_section_(b, m, ENV_VARIABLE, r);
    return r;
  }

  /* ********************************************************** */
  // EXTRA_INDEX_URL uri_reference
  public static boolean extra_index_url_req(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "extra_index_url_req")) return false;
    if (!nextTokenIs(b, EXTRA_INDEX_URL)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_, EXTRA_INDEX_URL_REQ, null);
    r = consumeToken(b, EXTRA_INDEX_URL);
    p = r; // pin = 1
    r = r && uri_reference(b, l + 1);
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  /* ********************************************************** */
  // LSBRACE extras_list? RSBRACE
  public static boolean extras(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "extras")) return false;
    if (!nextTokenIs(b, LSBRACE)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_, EXTRAS, null);
    r = consumeToken(b, LSBRACE);
    p = r; // pin = 1
    r = r && report_error_(b, extras_1(b, l + 1));
    r = p && consumeToken(b, RSBRACE) && r;
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  // extras_list?
  private static boolean extras_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "extras_1")) return false;
    extras_list(b, l + 1);
    return true;
  }

  /* ********************************************************** */
  // IDENTIFIER (COMMA IDENTIFIER)*
  public static boolean extras_list(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "extras_list")) return false;
    if (!nextTokenIs(b, IDENTIFIER)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_, EXTRAS_LIST, null);
    r = consumeToken(b, IDENTIFIER);
    p = r; // pin = 1
    r = r && extras_list_1(b, l + 1);
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  // (COMMA IDENTIFIER)*
  private static boolean extras_list_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "extras_list_1")) return false;
    while (true) {
      int c = current_position_(b);
      if (!extras_list_1_0(b, l + 1)) break;
      if (!empty_element_parsed_guard_(b, "extras_list_1", c)) break;
    }
    return true;
  }

  // COMMA IDENTIFIER
  private static boolean extras_list_1_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "extras_list_1_0")) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_);
    r = consumeTokens(b, 1, COMMA, IDENTIFIER);
    p = r; // pin = 1
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  /* ********************************************************** */
  // FIND_LINKS uri_reference
  public static boolean find_links_req(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "find_links_req")) return false;
    if (!nextTokenIs(b, FIND_LINKS)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_, FIND_LINKS_REQ, null);
    r = consumeToken(b, FIND_LINKS);
    p = r; // pin = 1
    r = r && uri_reference(b, l + 1);
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  /* ********************************************************** */
  // (pchar | SLASH | QUESTION_MARK)*
  public static boolean fragment(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "fragment")) return false;
    Marker m = enter_section_(b, l, _NONE_, FRAGMENT, "<fragment>");
    while (true) {
      int c = current_position_(b);
      if (!fragment_0(b, l + 1)) break;
      if (!empty_element_parsed_guard_(b, "fragment", c)) break;
    }
    exit_section_(b, l, m, true, false, null);
    return true;
  }

  // pchar | SLASH | QUESTION_MARK
  private static boolean fragment_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "fragment_0")) return false;
    boolean r;
    r = pchar(b, l + 1);
    if (!r) r = consumeToken(b, SLASH);
    if (!r) r = consumeToken(b, QUESTION_MARK);
    return r;
  }

  /* ********************************************************** */
  // hexdig hexdig? hexdig? hexdig?
  public static boolean h16(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "h16")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, H_16, "<h 16>");
    r = hexdig(b, l + 1);
    r = r && h16_1(b, l + 1);
    r = r && h16_2(b, l + 1);
    r = r && h16_3(b, l + 1);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  // hexdig?
  private static boolean h16_1(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "h16_1")) return false;
    hexdig(b, l + 1);
    return true;
  }

  // hexdig?
  private static boolean h16_2(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "h16_2")) return false;
    hexdig(b, l + 1);
    return true;
  }

  // hexdig?
  private static boolean h16_3(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "h16_3")) return false;
    hexdig(b, l + 1);
    return true;
  }

  /* ********************************************************** */
  // h16 COLON
  public static boolean h16_colon(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "h16_colon")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, H_16_COLON, "<h 16 colon>");
    r = h16(b, l + 1);
    r = r && consumeToken(b, COLON);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  /* ********************************************************** */
  // HASH EQUAL IDENTIFIER COLON HEX
  public static boolean hash_option(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "hash_option")) return false;
    if (!nextTokenIs(b, HASH)) return false;
    boolean r, p;
    Marker m = enter_section_(b, l, _NONE_, HASH_OPTION, null);
    r = consumeTokens(b, 1, HASH, EQUAL, IDENTIFIER, COLON, HEX);
    p = r; // pin = 1
    exit_section_(b, l, m, r, p, null);
    return r || p;
  }

  /* ********************************************************** */
  // DIGIT | 'a' | 'A' | 'b' | 'B' | 'c' | 'C' | 'd' | 'D' | 'e' | 'E' | 'f' | 'F'
  public static boolean hexdig(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "hexdig")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, HEXDIG, "<hexdig>");
    r = consumeToken(b, DIGIT);
    if (!r) r = consumeToken(b, "a");
    if (!r) r = consumeToken(b, "A");
    if (!r) r = consumeToken(b, "b");
    if (!r) r = consumeToken(b, "B");
    if (!r) r = consumeToken(b, "c");
    if (!r) r = consumeToken(b, "C");
    if (!r) r = consumeToken(b, "d");
    if (!r) r = consumeToken(b, "D");
    if (!r) r = consumeToken(b, "e");
    if (!r) r = consumeToken(b, "E");
    if (!r) r = consumeToken(b, "f");
    if (!r) r = consumeToken(b, "F");
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  /* ********************************************************** */
  // SLASH SLASH authority path_abempty | path_absolute | path_rootless | path_empty
  public static boolean hier_part(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "hier_part")) return false;
    boolean r;
    Marker m = enter_section_(b, l, _NONE_, HIER_PART, "<hier part>");
    r = hier_part_0(b, l + 1);
    if (!r) r = path_absolute(b, l + 1);
    if (!r) r = path_rootless(b, l + 1);
    if (!r) r = path_empty(b, l + 1);
    exit_section_(b, l, m, r, false, null);
    return r;
  }

  // SLASH SLASH authority path_abempty
  private static boolean hier_part_0(PsiBuilder b, int l) {
    if (!recursion_guard_(b, l, "hier_part_0")) return false;
    boolean r;
    Marker m = enter_section_(b);
