Package gherkin.lexer

Source Code of gherkin.lexer.Bg

// line 1 "ragel/i18n/bg.java.rl"
package gherkin.lexer;

import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.ArrayList;
import java.util.regex.Pattern;
import gherkin.lexer.Lexer;
import gherkin.lexer.Listener;
import gherkin.lexer.LexingError;

public class Bg implements Lexer {
 
// line 150 "ragel/i18n/bg.java.rl"


  private final Listener listener;

  public Bg(Listener listener) {
    this.listener = listener;
  }

 
// line 26 "java/src/main/java/gherkin/lexer/Bg.java"
private static byte[] init__lexer_actions_0()
{
  return new byte [] {
      0,    1,    0,    1,    1,    1,    2,    1,    3,    1,    4,    1,
      5,    1,    6,    1,    7,    1,    8,    1,    9,    1,   10,    1,
     11,    1,   12,    1,   13,    1,   16,    1,   17,    1,   18,    1,
     19,    1,   20,    1,   21,    1,   22,    1,   23,    2,    2,   18,
      2,    3,    4,    2,   13,    0,    2,   14,   15,    2,   17,    0,
      2,   17,    1,    2,   17,   16,    2,   17,   19,    2,   18,    6,
      2,   18,    7,    2,   18,    8,    2,   18,    9,    2,   18,   10,
      2,   18,   16,    2,   20,   21,    2,   22,    0,    2,   22,    1,
      2,   22,   16,    2,   22,   19,    3,    4,   14,   15,    3,    5,
     14,   15,    3,   11,   14,   15,    3,   12,   14,   15,    3,   13,
     14,   15,    3,   14,   15,   18,    3,   17,    0,   11,    3,   17,
     14,   15,    4,    2,   14,   15,   18,    4,    3,    4,   14,   15,
      4,   17,    0,   14,   15,    5,   17,    0,   11,   14,   15
  };
}

private static final byte _lexer_actions[] = init__lexer_actions_0();


private static short[] init__lexer_key_offsets_0()
{
  return new short [] {
      0,    0,   12,   21,   22,   23,   24,   25,   26,   27,   28,   29,
     30,   31,   32,   34,   36,   47,   48,   49,   51,   53,   58,   63,
     68,   73,   77,   81,   83,   84,   85,   86,   87,   88,   89,   90,
     91,   92,   93,   94,   95,   96,   97,   98103110115119,
    125128130136147148149150151152153154,
    155156157158160161162163164165166167,
    168169170171172173174175176177178179,
    188197199201203205207209211213215217,
    219230232234236238240242244246248250,
    252254256258260262264266268270272274,
    276278280282284286288290292294296298,
    300302304306308310312314316318320322,
    324326328330332334336338340342344346,
    348350352354356358360362364366368370,
    372374376378380382384386388389390391,
    392393394395396397398399406408410412,
    414416418420422424426428430432434436,
    438440442444446448450452454456458460,
    462463464465466467468469470471472473,
    474475476477478479480481482483484485,
    486487488489490491492493494495504512,
    514516518520522524526528530532534536,
    538540542544546548550552554556558560,
    562564566568570572574576578580582584,
    586588590592594596598600602604606608,
    610612614616618620622624626628630632,
    634636638640642644646648650652654656,
    658660661662663664665666667668669670,
    671672673674675676677686696698700702,
    704706708710712714716718720722724726,
    728730732734736738740742744746748750,
    752754756758760762764766768770772774,
    776778780782784786788790792794796798,
    800802804806808810812814816818820822,
    824826828830832834836838840842844846,
    848850852854856858860862864866868870,
    872874876878880882884886888890892894,
    896898900902904906908910912914916917,
    918919920921922923924925926927928929,
    930931932933934935936937938939940941,
    942943944945953958960962964967969971,
    973975977979981983985987989991993995,
    997999, 1001, 1003, 1005, 1007, 1009, 1011, 1013, 1015, 1017, 1019,
   1021, 1023, 1025, 1027, 1029, 1031, 1033, 1035, 1037, 1039, 1041, 1043,
   1045, 1047, 1049, 1051, 1053, 1055, 1057, 1059, 1061, 1063, 1065, 1067,
   1069, 1071, 1073, 1075, 1077, 1079, 1081, 1083, 1085, 1087, 1089, 1091,
   1093, 1095, 1097, 1099, 1101, 1103, 1105, 1107, 1109, 1111, 1113, 1115,
   1117, 1119, 1121, 1123, 1125, 1127, 1129, 1131, 1133, 1135, 1137, 1139,
   1141, 1143, 1145, 1147, 1149, 1151, 1153, 1155, 1157, 1158, 1159
  };
}

private static final short _lexer_key_offsets[] = init__lexer_key_offsets_0();


private static byte[] init__lexer_trans_keys_0()
{
  return new byte [] {
    -48,  -17,   10,   32,   34,   35,   37,   42,   64124,    9,   13,
   -108, -104, -102,  -99,  -97,  -96,  -95,  -94,  -92,  -48,  -80,  -48,
    -76,  -48,  -75,  -48,  -67,  -48,  -66,   32,   10,   13,   10,   13,
    -48,   10,   32,   34,   35,   37,   42,   64124,    9,   13,   34,
     34,   10,   13,   10,   13,   10,   32,   34,    9,   13,   10,   32,
     34,    9,   13,   10,   32,   34,    9,   13,   10,   32,   34,    9,
     13,   10,   32,    9,   13,   10,   32,    9,   13,   10,   13,   10,
     95,   70,   69,   65,   84,   85,   82,   69,   95,   69,   78,   68,
     95,   37,   13,   32,   64,    9,   10,    9,   10,   13,   32,   64,
     11,   12,   10,   32,   64,    9,   13,   32124,    9,   13,   10,
     32,   92124,    9,   13,   10,   92124,   10,   92,   10,   32,
     92124,    9,   13,  -48,   10,   32,   34,   35,   37,   42,   64,
    124,    9,   13,  -48,  -66,  -48,  -77,  -48,  -80,  -47, -126,  -47,
   -128,  -48,  -75,  -72,  -48,  -76,  -48,  -72,  -47, -127,  -47, -126,
    -48,  -66,  -47, -128,  -48,  -72,  -47, -113,   58,   10,   10,  -48,
     10,   32,   35,   37,   42,   64,    9,   13, -108, -104, -102,  -99,
    -96,  -95,  -94,  -92,   10,  -48,   10,  -80,   10,  -48,   10,  -76,
     10,  -48,   10,  -75,   10,  -48,   10,  -67,   10,  -48,   10,  -66,
     10,   10,   32,  -48,   10,   32,   34,   35,   37,   42,   64124,
      9,   13,  -48,   10,  -66,   10,  -48,   10,  -77,   10,  -48,   10,
    -80,   10,  -47,   10, -126,   10,  -48,   10,  -80,   10,  -48,   10,
    -68,   10,  -48,   10,  -70,   10,  -48,   10,  -80,   10,   10,   32,
    -48,   10,  -67,   10,  -48,   10,  -80,   10,   10,   32,  -47,   10,
   -127,   10,  -47,   10, -122,   10,  -48,   10,  -75,   10,  -48,   10,
    -67,   10,  -48,   10,  -80,   10,  -47,   10, -128,   10,  -48,   10,
    -72,   10,  -48,   10,  -71,   10,   10,   58,  -47,   10, -125,   10,
    -48,   10,  -67,   10,  -48,   10,  -70,   10,  -47,   10, -122,   10,
    -48,   10,  -72,   10,  -48,   10,  -66,   10,  -48,   10,  -67,   10,
    -48,   10,  -80,   10,  -48,   10,  -69,   10,  -48,   10,  -67,   10,
    -48,   10,  -66,   10,  -47,   10, -127,   10,  -47,   10, -126,   10,
     10,   95,   10,   70,   10,   69,   10,   65,   10,   84,   10,   85,
     10,   82,   10,   69,   10,   95,   10,   69,   10,   78,   10,   68,
     10,   95,   10,   37,  -48,  -68,  -48,  -75,  -47, -128,  -48,  -72,
     58,   10,   10,  -48,   10,   32,   35124,    9,   13,  -92,   10,
    -47,   10, -125,   10,  -48,   10,  -67,   10,  -48,   10,  -70,   10,
    -47,   10, -122,   10,  -48,   10,  -72,   10,  -48,   10,  -66,   10,
    -48,   10,  -67,   10,  -48,   10,  -80,   10,  -48,   10,  -69,   10,
    -48,   10,  -67,   10,  -48,   10,  -66,   10,  -47,   10, -127,   10,
    -47,   10, -126,   10,   10,   58,  -48,  -80,  -48,  -68,  -48,  -70,
    -48,  -80,   32,  -48,  -67,  -48,  -80,   32,  -47, -127,  -47, -122,
    -48,  -75,  -48,  -67,  -48,  -80,  -47, -128,  -48,  -72,  -48,  -71,
     58,   10,   10,  -48,   10,   32,   35,   37,   42,   64,    9,   13,
   -108, -104, -102,  -99,  -95,  -94,  -92,   10,  -48,   10,  -80,   10,
    -48,   10,  -76,   10,  -48,   10,  -75,   10,  -48,   10,  -67,   10,
    -48,   10,  -66,   10,   10,   32,  -48,   10,  -66,   10,  -48,   10,
    -77,   10,  -48,   10,  -80,   10,  -47,   10, -126,   10,  -47,   10,
   -122,   10,  -48,   10,  -75,   10,  -48,   10,  -67,   10,  -48,   10,
    -80,   10,  -47,   10, -128,   10,  -48,   10,  -72,   10,  -48,   10,
    -71,   10,   10,   58,  -47,   10, -125,   10,  -48,   10,  -67,   10,
    -48,   10,  -70,   10,  -47,   10, -122,   10,  -48,   10,  -72,   10,
    -48,   10,  -66,   10,  -48,   10,  -67,   10,  -48,   10,  -80,   10,
    -48,   10,  -69,   10,  -48,   10,  -67,   10,  -48,   10,  -66,   10,
    -47,   10, -127,   10,  -47,   10, -126,   10,   10,   95,   10,   70,
     10,   69,   10,   65,   10,   84,   10,   85,   10,   82,   10,   69,
     10,   95,   10,   69,   10,   78,   10,   68,   10,   95,   10,   37,
    -47, -122,  -48,  -75,  -48,  -67,  -48,  -80,  -47, -128,  -48,  -72,
    -48,  -71,   58,   10,   10,  -48,   10,   32,   35,   37,   42,   64,
      9,   13, -108, -104, -102,  -99,  -97,  -96,  -95,  -94,  -92,   10,
    -48,   10,  -80,   10,  -48,   10,  -76,   10,  -48,   10,  -75,   10,
    -48,   10,  -67,   10,  -48,   10,  -66,   10,   10,   32,  -48,   10,
    -66,   10,  -48,   10,  -77,   10,  -48,   10,  -80,   10,  -47,   10,
   -126,   10,  -47,   10, -128,   10,  -48,   10,  -75,   10,  -48,   10,
    -76,   10,  -48,   10,  -72,   10,  -47,   10, -127,   10,  -47,   10,
   -126,   10,  -48,   10,  -66,   10,  -47,   10, -128,   10,  -48,   10,
    -72,   10,  -47,   10, -113,   10,   10,   58,  -48,   10,  -80,   10,
    -48,   10,  -68,   10,  -48,   10,  -70,   10,  -48,   10,  -80,   10,
     10,   32,  -48,   10,  -67,   10,  -48,   10,  -80,   10,   10,   32,
    -47,   10, -127,   10,  -47,   10, -122,   10,  -48,   10,  -75,   10,
    -48,   10,  -67,   10,  -48,   10,  -80,   10,  -47,   10, -128,   10,
    -48,   10,  -72,   10,  -48,   10,  -71,   10,  -47,   10, -125,   10,
    -48,   10,  -67,   10,  -48,   10,  -70,   10,  -47,   10, -122,   10,
    -48,   10,  -72,   10,  -48,   10,  -66,   10,  -48,   10,  -67,   10,
    -48,   10,  -80,   10,  -48,   10,  -69,   10,  -48,   10,  -67,   10,
    -48,   10,  -66,   10,  -47,   10, -127,   10,  -47,   10, -126,   10,
     10,   95,   10,   70,   10,   69,   10,   65,   10,   84,   10,   85,
     10,   82,   10,   69,   10,   95,   10,   69,   10,   78,   10,   68,
     10,   95,   10,   37,  -47, -125,  -48,  -67,  -48,  -70,  -47, -122,
    -48,  -72,  -48,  -66,  -48,  -67,  -48,  -80,  -48,  -69,  -48,  -67,
    -48,  -66,  -47, -127,  -47, -126,   58,   10,   10,  -48,   10,   32,
     35,   37,   64,    9,   13,  -97,  -96,  -95,  -92,   10,  -47,   10,
   -128,   10,  -48,   10,  -75,  -72,   10,  -48,   10,  -76,   10,  -48,
     10,  -72,   10,  -47,   10, -127,   10,  -47,   10, -126,   10,  -48,
     10,  -66,   10,  -47,   10, -128,   10,  -48,   10,  -72,   10,  -47,
     10, -113,   10,   10,   58,  -48,   10,  -68,   10,  -48,   10,  -75,
     10,  -47,   10, -128,   10,  -48,   10,  -72,   10,  -48,   10,  -80,
     10,  -48,   10,  -68,   10,  -48,   10,  -70,   10,  -48,   10,  -80,
     10,   10,   32,  -48,   10,  -67,   10,  -48,   10,  -80,   10,   10,
     32,  -47,   10, -127,   10,  -47,   10, -122,   10,  -48,   10,  -75,
     10,  -48,   10,  -67,   10,  -48,   10,  -80,   10,  -47,   10, -128,
     10,  -48,   10,  -72,   10,  -48,   10,  -71,   10,  -47,   10, -125,
     10,  -48,   10,  -67,   10,  -48,   10,  -70,   10,  -47,   10, -122,
     10,  -48,   10,  -72,   10,  -48,   10,  -66,   10,  -48,   10,  -67,
     10,  -48,   10,  -80,   10,  -48,   10,  -69,   10,  -48,   10,  -67,
     10,  -48,   10,  -66,   10,  -47,   10, -127,   10,  -47,   10, -126,
     10,   10,   95,   10,   70,   10,   69,   10,   65,   10,   84,   10,
     85,   10,   82,   10,   69,   10,   95,   10,   69,   10,   78,   10,
     68,   10,   95,   10,   37,  -69,  -65,    0
  };
}

private static final byte _lexer_trans_keys[] = init__lexer_trans_keys_0();


private static byte[] init__lexer_single_lengths_0()
{
  return new byte [] {
      0,   10,    9,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    2,    2,    9,    1,    1,    2,    2,    3,    3,    3,
      3,    2,    2,    2,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    3,    5,    3,    2,    4,
      3,    2,    4,    9,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    2,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    7,
      9,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      9,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    5,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    1,    1,    7,    8,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    7,   10,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    6,    5,    2,    2,    2,    3,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    1,    1,    0
  };
}

private static final byte _lexer_single_lengths[] = init__lexer_single_lengths_0();


private static byte[] init__lexer_range_lengths_0()
{
  return new byte [] {
      0,    1,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    1,    0,    0,    0,    0,    1,    1,    1,
      1,    1,    1,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    1,    1,    1,    1,    1,
      0,    0,    1,    1,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    1,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      1,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    1,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    1,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    1,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    1,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0
  };
}

private static final byte _lexer_range_lengths[] = init__lexer_range_lengths_0();


private static short[] init__lexer_index_offsets_0()
{
  return new short [] {
      0,    0,   12,   22,   24,   26,   28,   30,   32,   34,   36,   38,
     40,   42,   44,   47,   50,   61,   63,   65,   68,   71,   76,   81,
     86,   91,   95,   99102104106108110112114116,
    118120122124126128130132137144149153,
    159163166172183185187189191193195197,
    199201203205208210212214216218220222,
    224226228230232234236238240242244246,
    255265268271274277280283286289292295,
    298309312315318321324327330333336339,
    342345348351354357360363366369372375,
    378381384387390393396399402405408411,
    414417420423426429432435438441444447,
    450453456459462465468471474477480483,
    486489492495498501504507510513516519,
    522525528531534537540543546548550552,
    554556558560562564566568575578581584,
    587590593596599602605608611614617620,
    623626629632635638641644647650653656,
    659661663665667669671673675677679681,
    683685687689691693695697699701703705,
    707709711713715717719721723725734743,
    746749752755758761764767770773776779,
    782785788791794797800803806809812815,
    818821824827830833836839842845848851,
    854857860863866869872875878881884887,
    890893896899902905908911914917920923,
    926929932935938941944947950953956959,
    962965967969971973975977979981983985,
    987989991993995997999, 1008, 1019, 1022, 1025, 1028,
   1031, 1034, 1037, 1040, 1043, 1046, 1049, 1052, 1055, 1058, 1061, 1064,
   1067, 1070, 1073, 1076, 1079, 1082, 1085, 1088, 1091, 1094, 1097, 1100,
   1103, 1106, 1109, 1112, 1115, 1118, 1121, 1124, 1127, 1130, 1133, 1136,
   1139, 1142, 1145, 1148, 1151, 1154, 1157, 1160, 1163, 1166, 1169, 1172,
   1175, 1178, 1181, 1184, 1187, 1190, 1193, 1196, 1199, 1202, 1205, 1208,
   1211, 1214, 1217, 1220, 1223, 1226, 1229, 1232, 1235, 1238, 1241, 1244,
   1247, 1250, 1253, 1256, 1259, 1262, 1265, 1268, 1271, 1274, 1277, 1280,
   1283, 1286, 1289, 1292, 1295, 1298, 1301, 1304, 1307, 1310, 1313, 1316,
   1319, 1322, 1325, 1328, 1331, 1334, 1337, 1340, 1343, 1346, 1349, 1351,
   1353, 1355, 1357, 1359, 1361, 1363, 1365, 1367, 1369, 1371, 1373, 1375,
   1377, 1379, 1381, 1383, 1385, 1387, 1389, 1391, 1393, 1395, 1397, 1399,
   1401, 1403, 1405, 1407, 1415, 1421, 1424, 1427, 1430, 1434, 1437, 1440,
   1443, 1446, 1449, 1452, 1455, 1458, 1461, 1464, 1467, 1470, 1473, 1476,
   1479, 1482, 1485, 1488, 1491, 1494, 1497, 1500, 1503, 1506, 1509, 1512,
   1515, 1518, 1521, 1524, 1527, 1530, 1533, 1536, 1539, 1542, 1545, 1548,
   1551, 1554, 1557, 1560, 1563, 1566, 1569, 1572, 1575, 1578, 1581, 1584,
   1587, 1590, 1593, 1596, 1599, 1602, 1605, 1608, 1611, 1614, 1617, 1620,
   1623, 1626, 1629, 1632, 1635, 1638, 1641, 1644, 1647, 1650, 1653, 1656,
   1659, 1662, 1665, 1668, 1671, 1674, 1677, 1680, 1683, 1686, 1689, 1692,
   1695, 1698, 1701, 1704, 1707, 1710, 1713, 1716, 1719, 1721, 1723
  };
}

private static final short _lexer_index_offsets[] = init__lexer_index_offsets_0();


private static short[] init__lexer_indicies_0()
{
  return new short [] {
      1,    2,    4,    3,    5,    6,    7,    8,    9,   10,    3,    0,
     11,   12,   13,   14,   15,   16,   17,   14,   18,    0,   19,    0,
     20,    0,   21,    0,   22,    0,   23,    0,   24,    0,   25,    0,
     14,    0,   26,    0,   12,    0,   27,    0,   29,   30,   28,   32,
     33,   31,    1,    4,    3,    5,    6,    7,    8,    9,   10,    3,
      0,   34,    0,   35,    0,   37,   38,   36,   40,   41,   39,   44,
     43,   45,   43,   42,   48,   47,   49,   47,   46,   48,   47,   50,
     47,   46,   48,   47,   51,   47,   46,   53,   52,   52,    0,    4,
     54,   54,    0,   56,   57,   55,    4,    0,   58,    0,   59,    0,
     60,    0,   61,    0,   62,    0,   63,    0,   64,    0,   65,    0,
     66,    0,   67,    0,   68,    0,   69,    0,   70,    0,   71,    0,
      0,    0,    0,    0,   72,   73,   74,   73,   73,   76,   75,   72,
      4,   77,    9,   77,    0,   78,   79,   78,    0,   82,   81,   83,
     84,   81,   80,    0,   86,   87,   85,    0,   86,   85,   82,   88,
     86,   87,   88,   85,   89,   82,   90,   91,   92,   93,   94,   95,
     96,   90,    0,   97,    0,   98,    0,   99,    0100,    0101,
      0102,    0103,    0,   14,    0104,    0105,    0106,
      0107108,    0109,    0110,    0111,    0112,    0,
    113,    0114,    0115,    0116,    0117,    0118,    0,
    119,    0120,    0121,    0122,    0123,    0124,    0,
    125,    0127126129128130129131132133134,
    132131128135136137138139140138141129,
    128142129128143129128144129128145129,
    128146129128147129128148129128138129,
    128149129128136129128129150128151153,
    152154155156157158159152,    0160129128,
    161129128162129128163129128164129128,
    165129128166129128138129128167129128,
    168129128169129128170129128171129128,
    172129128173129128174129128129175128,
    176129128177129128178129128179129128,
    129180128181129128140129128182129128,
    183129128184129128185129128186129128,
    187129128188129128189129128190129128,
    191129128192129128193129128194129128,
    195129128129150128196129128197129128,
    198129128199129128200129128201129128,
    202129128203129128204129128205129128,
    206129128207129128208129128209129128,
    210129128211129128212129128213129128,
    214129128215129128216129128217129128,
    218129128219129128220129128195129128,
    129221128129222128129223128129224128,
    129225128129226128129227128129228128,
    129229128129230128129231128129232128,
    129233128129234128235,    0236,    0237,    0,
    238,    0239,    0240,    0241,    0242,    0243,    0,
    245244247246248247249250250249246251,
    247246252247246253247246254247246255,
    247246256247246257247246258247246259,
    247246260247246261247246262247246263,
    247246264247246265247246266247246267,
    247246268247246269247246270247246271,
    247246272247246273247246274247246275,
    247246276247246277247246247278246279,
      0280,    0281,    0282,    0283,    0284,    0285,
      0286,    0287,    0288,    0289,    0290,    0291,
      0292,    0293,    0294,    0295,    0296,    0297,
      0298,    0299,    0300,    0301,    0302,    0303,
      0304,    0305,    0306,    0307,    0308,    0309,
      0311310313312314313315316317318316,
    315312319320321322323322324313312325,
    313312326313312327313312328313312329,
    313312330313312331313312322313312332,
    313312320313312313333312334313312335,
    313312336313312337313312338313312339,
    313312340313312322313312341313312342,
    313312343313312344313312345313312346,
    313312347313312348313312349313312350,
    313312351313312352313312353313312354,
    313312313333312355313312356313312357,
    313312358313312359313312360313312361,
    313312362313312363313312364313312365,
    313312366313312367313312368313312369,
    313312370313312371313312372313312373,
    313312374313312375313312376313312377,
    313312378313312379313312354313312313,
    380312313381312313382312313383312313,
    384312313385312313386312313387312313,
    388312313389312313390312313391312313,
    392312313393312394,    0395,    0396,    0397,
      0398,    0399,    0400,    0401,    0402,    0403,
      0404,    0405,    0406,    0407,    0408,    0410,
    409412411413412414415416417415414411,
    418419420421422423424421425412411426,
    412411427412411428412411429412411430,
    412411431412411432412411421412411433,
    412411419412411412434411435412411436,
    412411437412411438412411439412411440,
    412411441412411421412411442412411443,
    412411444412411445412411446412411447,
    412411448412411449412411450412411451,
    412411452412411453412411454412411455,
    412411456412411457412411458412411459,
    412411460412411461412411412434411462,
    412411463412411464412411465412411466,
    412411467412411468412411469412411412,
    470411471412411472412411473412411474,
    412411412475411476412411424412411477,
    412411478412411479412411480412411481,
    412411482412411483412411484412411485,
    412411486412411487412411488412411489,
    412411461412411490412411491412411492,
    412411493412411494412411495412411496,
    412411497412411498412411499412411500,
    412411501412411502412411503412411504,
    412411505412411506412411507412411508,
    412411509412411510412411511412411512,
    412411513412411514412411461412411412,
    515411412516411412517411412518411412,
    519411412520411412521411412522411412,
    523411412524411412525411412526411412,
    527411412528411529,    0530,    0531,    0532,
      0533,    0534,    0535,    0536,    0537,    0538,
      0539,    0540,    0541,    0542,    0543,    0544,
      0545,    0546,    0547,    0548,    0549,    0550,
      0551,    0552,    0553,    0554,    0555,    0557,
    556559558560559561562563562561558564,
    565566567559558568559558569559558570,
    559558571572559558573559558574559558,
    575559558576559558577559558578559558,
    579559558580559558581559558582559558,
    583559558584559558585559558586559558,
    587559558588559558559589558590559558,
    591559558592559558593559558594559558,
    595559558596559558588559558597559558,
    598559558599559558600559558601559558,
    602559558603559558604559558559605558,
    606559558607559558608559558609559558,
    559610558611559558566559558612559558,
    613559558614559558615559558616559558,
    617559558618559558619559558620559558,
    621559558622559558623559558624559558,
    588559558625559558626559558627559558,
    628559558629559558630559558631559558,
    632559558633559558634559558635559558,
    636559558637559558638559558639559558,
    640559558641559558642559558643559558,
    644559558645559558646559558647559558,
    648559558649559558588559558559650558,
    559651558559652558559653558559654558,
    559655558559656558559657558559658558,
    559659558559660558559661558559662558,
    559663558664,    0,    3,    0665,    0
  };
}

private static final short _lexer_indicies[] = init__lexer_indicies_0();


private static short[] init__lexer_trans_targs_0()
{
  return new short [] {
      0,    2584,   16,   16,   17,   27,   29,   13,   43,   46,    3,
     13,   52,   11,   60216325454,    4,    5,    6,    7,    8,
      9,   10,   12,   14,   15,   16,   28,   15,   16,   28,   18,   19,
     20,   21,   20,   20,   21,   20,   22,   22,   22,   23,   22,   22,
     22,   23,   24,   25,   26,   16,   26,   27,   16,   28,   30,   31,
     32,   33,   34,   35,   36,   37,   38,   39,   40,   41,   42586,
     44,   45,   16,   44,   43,   45,   46,   47,   48,   50,   51,   49,
     47,   48,   49,   47,   50,    2,   51,   17,   27,   29,   13,   43,
     46,   53,   54,   55,   56,   57,   58,   59,   61,   62,   63,   64,
    176,   65,   66,   67,   68,   69,   70,   71,   72,   73,   74,   75,
     76,   77,   78,   79,   80,   81,   82,   83,   82,   83,   84,   83,
     16162,   95,   85,   95,   97,   93105121136,   86,   87,
     88,   89,   90,   91,   92,   94,   96,    2,   16,   16,   17,   27,
     29,   13,   43,   46,   98,   99100101102103104106,
    107108109110111112113114115116117118,
    119120122123124125126127128129130131,
    132133134135137138139140141142143144,
    145146147148149150151152153154155156,
    157158159160161163164165166167168169,
    170171172173174175,   16177178179180181,
    182183184185186187186187188187,   16189,
    190191192193194195196197198199200201,
    202203204205206207208209210211212213,
    214215,   96217218219220221222223224225,
    226227228229230231232233234235236237,
    238239240241242243244245246247248249,
    248249250249,   16311261251261262259270,
    285252253254255256257258260,   96263264,
    265266267268269271272273274275276277,
    278279280281282283284286287288289290,
    291292293294295296297298299300301302,
    303304305306307308309310312313314315,
    316317318319320321322323324,   16326327,
    328329330331332333334335336337338339,
    340341342341342343342,   16440354344354,
    355352363384400414345346347348349350,
    351353,   96356357358359360361362364365,
    366367368369370371372373374375376377,
    378379380381382383385386387388389390,
    391392393394395396397398399401402403,
    404405406407408409410411412413415416,
    417418419420421422423424425426427428,
    429430431432433434435436437438439441,
    442443444445446447448449450451452453,
     16455456457458459460461462463464465,
    466467468469470471472473474475476477,
    478479480481482483482483484483,   16570,
    485514530544486487488489506490491492,
    493494495496497498499500501502503504,
    505,   96507508509510511512513515516517,
    518519520521522523524525526527528529,
    531532533534535536537538539540541542,
    543545546547548549550551552553554555,
    556557558559560561562563564565566567,
    568569571572573574575576577578579580,
    581582583,   16585,    0
  };
}

private static final short _lexer_trans_targs[] = init__lexer_trans_targs_0();


private static short[] init__lexer_trans_actions_0()
{
  return new short [] {
     43,   29,    0,    0,   54,    3,    1,    0,   29,    1,   35,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,   57149126,    0110,   23,    0,    0,
      7139,   48,    0102,    9,    5,   45134,   45,    0,   33,
    122,   33,   33,    0,   11106,    0,    0114,   25,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,   27118,   27,   51,    0,    0,    0,   37,   37,   54,   37,
     87,    0,    0,   39,    0,   96,    0,   93,   90,   41,   96,   90,
     99,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,   57144,    0,   54,   84,    0,
     72,   33,   84,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,   15,   63,   31130,   60,   57,
     31,   63,   57,   66,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,   15,    0,    0,    0,    0,    0,
      0,    0,    0,    0,   57144,    0,   54,   84,    0,   81,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,   21,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   57144,
      0,   54,   84,    0,   78,   33,   84,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,   19,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,   19,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,   57144,    0,   54,   84,    0,   75,   33,   84,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,   17,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     17,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,   57144,    0,   54,   84,    0,   69,   33,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,   13,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,   13,    0,    0
  };
}

private static final short _lexer_trans_actions[] = init__lexer_trans_actions_0();


private static short[] init__lexer_eof_actions_0()
{
  return new short [] {
      0,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43,
     43,   43,   43,   43,   43,   43,   43,   43,   43,   43,   43
  };
}

private static final short _lexer_eof_actions[] = init__lexer_eof_actions_0();


static final int lexer_start = 1;
static final int lexer_first_final = 586;

static final int lexer_en_main = 1;


// line 159 "ragel/i18n/bg.java.rl"

  public void scan(String source)  {
    String input = source + "\n%_FEATURE_END_%";
    byte[] data = null;
    try {
      data = input.getBytes("UTF-8");
    } catch(UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
    int cs, p = 0, pe = data.length;
    int eof = pe;

    int lineNumber = 1;
    int lastNewline = 0;

    int contentStart = -1;
    int currentLine = -1;
    int docstringContentTypeStart = -1;
    int docstringContentTypeEnd = -1;
    int startCol = -1;
    int nextKeywordStart = -1;
    int keywordStart = -1;
    String keyword = null;
    List<String> currentRow = null;

   
// line 761 "java/src/main/java/gherkin/lexer/Bg.java"
  {
  cs = lexer_start;
  }

// line 185 "ragel/i18n/bg.java.rl"
   
// line 768 "java/src/main/java/gherkin/lexer/Bg.java"
  {
  int _klen;
  int _trans = 0;
  int _acts;
  int _nacts;
  int _keys;
  int _goto_targ = 0;

  _goto: while (true) {
  switch ( _goto_targ ) {
  case 0:
  if ( p == pe ) {
    _goto_targ = 4;
    continue _goto;
  }
  if ( cs == 0 ) {
    _goto_targ = 5;
    continue _goto;
  }
case 1:
  _match: do {
  _keys = _lexer_key_offsets[cs];
  _trans = _lexer_index_offsets[cs];
  _klen = _lexer_single_lengths[cs];
  if ( _klen > 0 ) {
    int _lower = _keys;
    int _mid;
    int _upper = _keys + _klen - 1;
    while (true) {
      if ( _upper < _lower )
        break;

      _mid = _lower + ((_upper-_lower) >> 1);
      if ( data[p] < _lexer_trans_keys[_mid] )
        _upper = _mid - 1;
      else if ( data[p] > _lexer_trans_keys[_mid] )
        _lower = _mid + 1;
      else {
        _trans += (_mid - _keys);
        break _match;
      }
    }
    _keys += _klen;
    _trans += _klen;
  }

  _klen = _lexer_range_lengths[cs];
  if ( _klen > 0 ) {
    int _lower = _keys;
    int _mid;
    int _upper = _keys + (_klen<<1) - 2;
    while (true) {
      if ( _upper < _lower )
        break;

      _mid = _lower + (((_upper-_lower) >> 1) & ~1);
      if ( data[p] < _lexer_trans_keys[_mid] )
        _upper = _mid - 2;
      else if ( data[p] > _lexer_trans_keys[_mid+1] )
        _lower = _mid + 2;
      else {
        _trans += ((_mid - _keys)>>1);
        break _match;
      }
    }
    _trans += _klen;
  }
  } while (false);

  _trans = _lexer_indicies[_trans];
  cs = _lexer_trans_targs[_trans];

  if ( _lexer_trans_actions[_trans] != 0 ) {
    _acts = _lexer_trans_actions[_trans];
    _nacts = (int) _lexer_actions[_acts++];
    while ( _nacts-- > 0 )
  {
      switch ( _lexer_actions[_acts++] )
      {
  case 0:
// line 16 "ragel/i18n/bg.java.rl"
  {
      contentStart = p;
      currentLine = lineNumber;
      if(keyword != null) {
        startCol = p - lastNewline - (keyword.length() + 1);
      }
    }
  break;
  case 1:
// line 24 "ragel/i18n/bg.java.rl"
  {
      currentLine = lineNumber;
      startCol = p - lastNewline;
    }
  break;
  case 2:
// line 29 "ragel/i18n/bg.java.rl"
  {
      contentStart = p;
    }
  break;
  case 3:
// line 33 "ragel/i18n/bg.java.rl"
  {
      docstringContentTypeStart = p;
    }
  break;
  case 4:
// line 37 "ragel/i18n/bg.java.rl"
  {
      docstringContentTypeEnd = p;
    }
  break;
  case 5:
// line 41 "ragel/i18n/bg.java.rl"
  {
      String con = unindent(startCol, substring(data, contentStart, nextKeywordStart-1).replaceFirst("(\\r?\\n)?([\\t ])*\\Z", "").replace("\\\"\\\"\\\"", "\"\"\""));
      String conType = substring(data, docstringContentTypeStart, docstringContentTypeEnd).trim();
      listener.docString(conType, con, currentLine);
    }
  break;
  case 6:
// line 47 "ragel/i18n/bg.java.rl"
  {
      String[] nameDescription = nameAndUnindentedDescription(startCol, keywordContent(data, p, eof, nextKeywordStart, contentStart));
      listener.feature(keyword, nameDescription[0], nameDescription[1], currentLine);
      if(nextKeywordStart != -1) p = nextKeywordStart - 1;
      nextKeywordStart = -1;
    }
  break;
  case 7:
// line 54 "ragel/i18n/bg.java.rl"
  {
      String[] nameDescription = nameAndUnindentedDescription(startCol, keywordContent(data, p, eof, nextKeywordStart, contentStart));
      listener.background(keyword, nameDescription[0], nameDescription[1], currentLine);
      if(nextKeywordStart != -1) p = nextKeywordStart - 1;
      nextKeywordStart = -1;
    }
  break;
  case 8:
// line 61 "ragel/i18n/bg.java.rl"
  {
      String[] nameDescription = nameAndUnindentedDescription(startCol, keywordContent(data, p, eof, nextKeywordStart, contentStart));
      listener.scenario(keyword, nameDescription[0], nameDescription[1], currentLine);
      if(nextKeywordStart != -1) p = nextKeywordStart - 1;
      nextKeywordStart = -1;
    }
  break;
  case 9:
// line 68 "ragel/i18n/bg.java.rl"
  {
      String[] nameDescription = nameAndUnindentedDescription(startCol, keywordContent(data, p, eof, nextKeywordStart, contentStart));
      listener.scenarioOutline(keyword, nameDescription[0], nameDescription[1], currentLine);
      if(nextKeywordStart != -1) p = nextKeywordStart - 1;
      nextKeywordStart = -1;
    }
  break;
  case 10:
// line 75 "ragel/i18n/bg.java.rl"
  {
      String[] nameDescription = nameAndUnindentedDescription(startCol, keywordContent(data, p, eof, nextKeywordStart, contentStart));
      listener.examples(keyword, nameDescription[0], nameDescription[1], currentLine);
      if(nextKeywordStart != -1) p = nextKeywordStart - 1;
      nextKeywordStart = -1;
    }
  break;
  case 11:
// line 82 "ragel/i18n/bg.java.rl"
  {
      listener.step(keyword, substring(data, contentStart, p).trim(), currentLine);
    }
  break;
  case 12:
// line 86 "ragel/i18n/bg.java.rl"
  {
      listener.comment(substring(data, contentStart, p).trim(), lineNumber);
      keywordStart = -1;
    }
  break;
  case 13:
// line 91 "ragel/i18n/bg.java.rl"
  {
      listener.tag(substring(data, contentStart, p).trim(), currentLine);
      keywordStart = -1;
    }
  break;
  case 14:
// line 96 "ragel/i18n/bg.java.rl"
  {
      lineNumber++;
    }
  break;
  case 15:
// line 100 "ragel/i18n/bg.java.rl"
  {
      lastNewline = p + 1;
    }
  break;
  case 16:
// line 104 "ragel/i18n/bg.java.rl"
  {
      if(keywordStart == -1) keywordStart = p;
    }
  break;
  case 17:
// line 108 "ragel/i18n/bg.java.rl"
  {
      keyword = substring(data, keywordStart, p).replaceFirst(":$","");
      keywordStart = -1;
    }
  break;
  case 18:
// line 113 "ragel/i18n/bg.java.rl"
  {
      nextKeywordStart = p;
    }
  break;
  case 19:
// line 117 "ragel/i18n/bg.java.rl"
  {
      p = p - 1;
      currentRow = new ArrayList<String>();
      currentLine = lineNumber;
    }
  break;
  case 20:
// line 123 "ragel/i18n/bg.java.rl"
  {
      contentStart = p;
    }
  break;
  case 21:
// line 127 "ragel/i18n/bg.java.rl"
  {
      String con = substring(data, contentStart, p).trim();
      currentRow.add(con
        .replace("\\|", "|")
        .replace("\\n", "\n")
        .replace("\\\\", "\\")
      );
    }
  break;
  case 22:
// line 136 "ragel/i18n/bg.java.rl"
  {
      listener.row(currentRow, currentLine);
    }
  break;
  case 23:
// line 140 "ragel/i18n/bg.java.rl"
  {
      if(cs < lexer_first_final) {
        String content = currentLineContent(data, lastNewline);
        throw new LexingError("Lexing error on line " + lineNumber + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.");
      } else {
        listener.eof();
      }
    }
  break;
// line 1029 "java/src/main/java/gherkin/lexer/Bg.java"
      }
    }
  }

case 2:
  if ( cs == 0 ) {
    _goto_targ = 5;
    continue _goto;
  }
  if ( ++p != pe ) {
    _goto_targ = 1;
    continue _goto;
  }
case 4:
  if ( p == eof )
  {
  int __acts = _lexer_eof_actions[cs];
  int __nacts = (int) _lexer_actions[__acts++];
  while ( __nacts-- > 0 ) {
    switch ( _lexer_actions[__acts++] ) {
  case 23:
// line 140 "ragel/i18n/bg.java.rl"
  {
      if(cs < lexer_first_final) {
        String content = currentLineContent(data, lastNewline);
        throw new LexingError("Lexing error on line " + lineNumber + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.");
      } else {
        listener.eof();
      }
    }
  break;
// line 1061 "java/src/main/java/gherkin/lexer/Bg.java"
    }
  }
  }

case 5:
  }
  break; }
  }

// line 186 "ragel/i18n/bg.java.rl"
  }

  private String keywordContent(byte[] data, int p, int eof, int nextKeywordStart, int contentStart) {
    int endPoint = (nextKeywordStart == -1 || (p == eof)) ? p : nextKeywordStart;
    return substring(data, contentStart, endPoint);
  }

  private String[] nameAndUnindentedDescription(int startCol, String text) {
    String[] lines = text.split("\n");
    String name = lines.length > 0 ? lines[0].trim() : "";
    StringBuffer description = new StringBuffer();
    for(int i = 1; i < lines.length; i++) {
      description.append(lines[i]);
      description.append("\n");
    }
    return new String[]{name, unindent(startCol+2, description.toString()).replaceAll("\\s+$", "")};
  }

  private String unindent(int startCol, String text) {
    return Pattern.compile("^[\t ]{0," + startCol + "}", Pattern.MULTILINE).matcher(text).replaceAll("");
  }

  private String currentLineContent(byte[] data, int lastNewline) {
    return substring(data, lastNewline, data.length).trim();
  }

  private String substring(byte[] data, int start, int end) {
    try {
      return new String(data, start, end-start, "utf-8");
    } catch(java.io.UnsupportedEncodingException e) {
      throw new RuntimeException("Internal error", e);
    }
  }
}
TOP

Related Classes of gherkin.lexer.Bg

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.