Package gherkin.lexer

Source Code of gherkin.lexer.Es

// line 1 "ragel/i18n/es.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 Es implements Lexer {
 
// line 150 "ragel/i18n/es.java.rl"


  private final Listener listener;

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

 
// line 26 "java/src/main/java/gherkin/lexer/Es.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,   17,   18,   19,   35,   36,   37,   39,   41,   46,   51,
     56,   61,   65,   69,   71,   72,   73,   74,   75,   76,   77,   78,
     79,   80,   81,   82,   83,   84,   85,   86,   87,   89,   91,   96,
    103108109110111112113114115116117118,
    119120121122135137139141143145147149,
    151153155157159161163165181183184185,
    186187188189190191192193194195196197,
    198199209211213215217219221223225227,
    229231233235237239241243245247249251,
    253255257259261263265267269271273275,
    277279281283285287289292294296298300,
    302305307309311313315317319321323325,
    327329331333335337339341342343344345,
    346347349351354355356357358359360361,
    362363370372374376378380382384386388,
    390392394396398400401402403404405406,
    408409410411412413414415416417431433,
    435437439441443445447449451453455457,
    459461463465467469471473475477479481,
    483485488490492494496498500502504506,
    508510512514516518520522524526529532,
    535537539541543545547550552554556558,
    560562564566568570572574576578580582,
    584586588590591592593594595596597598,
    599600601602603604605606607608609610,
    611624626628630632634636638640642644,
    646648650652654657659661663665667669,
    671673675677679681683685687689691693,
    695697700703706708710712714716718720,
    722724726728730732734736737738742748,
    751753759775778780782784786788790792,
    794796798800802804806808810812814816,
    818821824827829831833835837839842844,
    846848850852854856858860862864866868,
    870872874876878880882
  };
}

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


private static byte[] init__lexer_trans_keys_0()
{
  return new byte [] {
    -17,   10,   32,   34,   35,   37,   42,   64,   65,   67,   68,   69,
     80,   89124,    9,   13,  -69,  -65,   10,   32,   34,   35,   37,
     42,   64,   65,   67,   68,   69,   80,   89124,    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,   32,   10,   13,   10,   13,   13,   32,   64,    9,   10,
      9,   10,   13,   32,   64,   11,   12,   10,   32,   64,    9,   13,
    110116101,   99101100101110116101115,   58,
     10,   10,   10,   32,   35,   37,   42,   64,   67,   68,   69,   80,
     89,    9,   13,   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,   10,   32,   10,   32,   34,
     35,   37,   42,   64,   65,   67,   68,   69,   80,   89124,    9,
     13,   97117114,   97,   99116101114,  -61,  -83115,
    116105,   99,   97,   58,   10,   10,   10,   32,   35,   37,   64,
     65,   67,   69,    9,   13,   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,   10110,   10,
    116,   10101,   10,   99,   10101,   10100,   10101,   10,
    110,   10116,   10101,   10115,   10,   58,   10,   97,   10,
    114,   10,   97,   10,   99,   10116,   10101,   10114,  -61,
     10,  -83,   10,   10115,   10116,   10105,   10,   99,   10,
     97,   10106115,   10101,   10109,   10112,   10108,
     10111,   10,   99113,   10101,   10110,   10,   97,   10,
    114,   10105,   10111,   10117,   10101,   10109,   10,
     97,   10,   32,   10100,   10101,   10108,   10,   32,   10,
    101,   10115,   10,   99,   97110100111,   97100,   97,
    111,   32115106110115101109112108111115,
     58,   10,   10,   10,   32,   35,   67124,    9,   13,   10,   97,
     10114,   10,   97,   10,   99,   10116,   10101,   10114,
    -61,   10,  -83,   10,   10115,   10116,   10105,   10,   99,
     10,   97,   10,   58116111110,   99101115,   99113,
    101110,   97114105111,   58,   10,   10,   10,   32,   35,
     37,   42,   64,   65,   67,   68,   69,   80,   89,    9,   13,   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,   10,   32,   10110,   10116,   10101,   10,
     99,   10101,   10100,   10101,   10110,   10116,   10,
    101,   10115,   10,   58,   10,   97117,   10114,   10,   97,
     10,   99,   10116,   10101,   10114,  -61,   10,  -83,   10,
     10115,   10116,   10105,   10,   99,   10,   97,   10,   97,
     10110,   10100,   10111,   10,   97,   10100,   10,   97,
    111,   10,   32115,   10110115,   10116,   10111,   10,
    110,   10,   99,   10101,   10115,   10,   99113,   10101,
     10110,   10,   97,   10114,   10105,   10111,   10117,
     10101,   10109,   10,   97,   10,   32,   10100,   10101,
     10108,   10,   32,   10101,   10115,   10,   99,   10101,
     10114117101109,   97,   32100101108,   32101,
    115,   99101110,   97114105111,   58,   10,   10,   10,
     32,   35,   37,   42,   64,   67,   68,   69,   80,   89,    9,   13,
     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,   10,   32,   10,   97117,   10114,   10,
     97,   10,   99,   10116,   10101,   10114,  -61,   10,  -83,
     10,   10115,   10116,   10105,   10,   99,   10,   97,   10,
     58,   10,   97,   10110,   10100,   10111,   10,   97,   10,
    100,   10,   97111,   10,   32115,   10110115,   10116,
     10111,   10110,   10,   99,   10101,   10115,   10,   99,
     10101,   10110,   10,   97,   10114,   10105,   10111,
     10101,   10114101114,   32124,    9,   13,   10,   32,
     92124,    9,   13,   10,   92124,   10,   92,   10,   32,   92,
    124,    9,   13,   10,   32,   34,   35,   37,   42,   64,   65,   67,
     68,   69,   80,   89124,    9,   13,   10,   97117,   10114,
     10,   97,   10,   99,   10116,   10101,   10114,  -61,   10,
    -83,   10,   10115,   10116,   10105,   10,   99,   10,   97,
     10,   58,   10,   97,   10110,   10100,   10111,   10,   97,
     10100,   10,   97111,   10,   32115,   10110115,   10,
    116,   10111,   10110,   10,   99,   10101,   10115,   10,
     99113,   10101,   10110,   10,   97,   10114,   10105,
     10111,   10117,   10101,   10109,   10,   97,   10,   32,
     10100,   10101,   10108,   10,   32,   10101,   10115,
     10,   99,   10101,   10114,    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,   15,    1,    1,   14,    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,    1,    2,    2,    3,    5,
      3,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    1,    1,   11,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,   14,    2,    1,    1,    1,
      1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    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,    3,    2,    2,    2,    2,    2,
      3,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    1,    1,    1,    1,    1,
      1,    2,    2,    3,    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,    1,    1,    1,    1,    1,    1,    2,
      1,    1,    1,    1,    1,    1,    1,    1,    1,   12,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    3,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    3,    3,    3,
      2,    2,    2,    2,    2,    2,    3,    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,
     11,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    3,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    3,    3,    3,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    1,    1,    2,    4,    3,
      2,    4,   14,    3,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      3,    3,    3,    2,    2,    2,    2,    2,    2,    3,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    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,    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,    0,    0,    0,    1,    1,
      1,    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,    1,    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,    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,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      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,    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,    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,   17,   19,   21,   37,   39,   41,   44,   47,   52,   57,
     62,   67,   71,   75,   78,   80,   82,   84,   86,   88,   90,   92,
     94,   96,   98100102104106108110113116121,
    128133135137139141143145147149151153,
    155157159161174177180183186189192195,
    198201204207210213216219235238240242,
    244246248250252254256258260262264266,
    268270280283286289292295298301304307,
    310313316319322325328331334337340343,
    346349352355358361364367370373376379,
    382385388391394397400404407410413416,
    419423426429432435438441444447450453,
    456459462465468471474477479481483485,
    487489492495499501503505507509511513,
    515517524527530533536539542545548551,
    554557560563566569571573575577579581,
    584586588590592594596598600602616619,
    622625628631634637640643646649652655,
    658661664667670673676679682685688691,
    694697701704707710713716719722725728,
    731734737740743746749752755758762766,
    770773776779782785788792795798801804,
    807810813816819822825828831834837840,
    843846849852854856858860862864866868,
    870872874876878880882884886888890892,
    894907910913916919922925928931934937,
    940943946949952956959962965968971974,
    977980983986989992995998, 1001, 1004, 1007, 1010,
   1013, 1016, 1020, 1024, 1028, 1031, 1034, 1037, 1040, 1043, 1046, 1049,
   1052, 1055, 1058, 1061, 1064, 1067, 1070, 1073, 1075, 1077, 1081, 1087,
   1091, 1094, 1100, 1116, 1120, 1123, 1126, 1129, 1132, 1135, 1138, 1141,
   1144, 1147, 1150, 1153, 1156, 1159, 1162, 1165, 1168, 1171, 1174, 1177,
   1180, 1184, 1188, 1192, 1195, 1198, 1201, 1204, 1207, 1210, 1214, 1217,
   1220, 1223, 1226, 1229, 1232, 1235, 1238, 1241, 1244, 1247, 1250, 1253,
   1256, 1259, 1262, 1265, 1268, 1271, 1274
  };
}

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


private static short[] init__lexer_indicies_0()
{
  return new short [] {
      1,    3,    2,    4,    5,    6,    7,    8,    9,   10,   11,   12,
     13,    7,   14,    2,    0,   15,    0,    2,    0,    3,    2,    4,
      5,    6,    7,    8,    9,   10,   11,   12,   13,    7,   14,    2,
      0,   16,    0,   17,    0,   19,   20,   18,   22,   23,   21,   26,
     25,   27,   25,   24,   30,   29,   31,   29,   28,   30,   29,   32,
     29,   28,   30,   29,   33,   29,   28,   35,   34,   34,    0,    3,
     36,   36,    0,   38,   39,   37,    3,    0,   40,    0,   41,    0,
     42,    0,   43,    0,   44,    0,   45,    0,   46,    0,   47,    0,
     48,    0,   49,    0,   50,    0,   51,    0,   52,    0,   53,    0,
     54,    0,   56,   57,   55,   59,   60,   58,    0,    0,    0,    0,
     61,   62,   63,   62,   62,   65,   64,   61,    3,   66,    8,   66,
      0,   67,    0,   68,    0,   69,    0,   70,    0,   71,    0,   72,
      0,   73,    0,   74,    0,   75,    0,   76,    0,   77,    0,   78,
      0,   80,   79,   82,   81,   82,   83,   84,   85,   86,   84,   87,
     88,   89,   90,   86,   83,   81,   82,   91,   81,   82,   92,   81,
     82,   93,   81,   82,   94,   81,   82,   95,   81,   82,   96,   81,
     82,   97,   81,   82,   98,   81,   82,   99,   81,   82100,   81,
     82101,   81,   82102,   81,   82103,   81,   82104,   81,
     82105,   81107106108109110111112113114,
    115116117111118106,    0119120,    0121,    0,
    122,    0123,    0124,    0125,    0126,    0127,    0,
    128,    0129,    0130,    0131,    0132,    0133,    0,
    134,    0136135138137138139140141140142,
    143144139137138145137138146137138147,
    137138148137138149137138150137138151,
    137138152137138153137138154137138155,
    137138156137138157137138158137138159,
    137138160137138161137138162137138163,
    137138164137138165137138166137138167,
    137138168137138169137138170137138171,
    137138172137138173137138174137138175,
    137138176137138177137178138137179138,
    137138180137138181137138182137138183,
    137138169137138184185137138186137138,
    187137138188137138189137138168137138,
    190191137138192137138193137138194137,
    138195137138196137138169137138197137,
    138198137138199137138200137138201137,
    138202137138203137138204137138205137,
    138206137138207137138190137208,    0209,
      0210,    0211,    0212,    0213,    0214214,    0,
     54211,    0215216217,    0218,    0219,    0220,
      0221,    0222,    0223,    0224,    0226225228,
    227228229230231230229227228232227228,
    233227228234227228235227228236227228,
    237227228238227239228227240228227228,
    241227228242227228243227228244227228,
    245227228246227247,    0248,    0249,    0250,
      0251,    0211,    0252253,    0254,    0255,    0,
    256,    0257,    0258,    0259,    0260,    0262261,
    264263264265266267268266269270271272,
    273268265263264274263264275263264276,
    263264277263264278263264279263264280,
    263264281263264282263264283263264284,
    263264285263264286263264287263264288,
    263264289263264290263264291263264292,
    263264293263264294263264295263264296,
    263264297263264298263264299263264288,
    263264300301263264302263264303263264,
    304263264305263264306263264307263308,
    264263309264263264310263264311263264,
    312263264313263264299263264314263264,
    315263264316263264317263264318263264,
    319263264320320263264288317263264321,
    322263264323263264324263264325263264,
    326263264327263264317263264328329263,
    264330263264331263264332263264333263,
    264334263264299263264335263264336263,
    264337263264338263264339263264340263,
    264341263264342263264343263264344263,
    264345263264328263264346263264316263,
    347,    0348,    0349,    0350,    0351,    0352,    0,
    353,    0354,    0355,    0356,    0357,    0358,    0,
    359,    0360,    0361,    0362,    0363,    0364,    0,
    365,    0367366369368369370371372373371,
    374375376377373370368369378368369379,
    368369380368369381368369382368369383,
    368369384368369385368369386368369387,
    368369388368369389368369390368369391,
    368369392368369393394368369395368369,
    396368369397368369398368369399368369,
    400368401369368402369368369403368369,
    404368369405368369406368369407368369,
    392368369408368369409368369410368369,
    411368369412368369413368369414414368,
    369392411368369415416368369417368369,
    418368369419368369420368369421368369,
    411368369422368369423368369424368369,
    425368369426368369427368369407368369,
    428368369410368429,    0210,    0430431430,
      0434433435436433432,    0438439437,    0,
    438437434440438439440437434441442443,
    444445446447448449450451445452441,    0,
     82453454,   81,   82455,   81,   82456,   81,   82457,
     81,   82458,   81,   82459,   81,   82460,   81461,   82,
     81462,   82,   81,   82463,   81,   82464,   81,   82465,
     81,   82466,   81,   82467,   81,   82105,   81,   82468,
     81,   82469,   81,   82470,   81,   82471,   81,   82472,
     81,   82473,   81,   82474474,   81,   82105471,   81,
     82475476,   81,   82477,   81,   82478,   81,   82479,
     81,   82480,   81,   82481,   81,   82471,   81,   82482,
    483,   81,   82484,   81,   82485,   81,   82486,   81,   82,
    487,   81,   82488,   81,   82467,   81,   82489,   81,   82,
    490,   81,   82491,   81,   82492,   81,   82493,   81,   82,
    494,   81,   82495,   81,   82496,   81,   82497,   81,   82,
    498,   81,   82499,   81,   82482,   81,   82500,   81,   82,
    470,   81501,    0
  };
}

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


private static short[] init__lexer_trans_targs_0()
{
  return new short [] {
      0,    2,    4,    4,    5,   15,   17,   31,   34,   37,   68155,
    159355357,    3,    6,    7,    8,    9,    8,    8,    9,    8,
     10,   10,   10,   11,   10,   10,   10,   11,   12,   13,   14,    4,
     14,   15,    4,   16,   18,   19,   20,   21,   22,   23,   24,   25,
     26,   27,   28,   29,   30414,   32,   33,    4,   16,   33,    4,
     16,   35,   36,    4,   35,   34,   36,   38,   39,   40,   41,   42,
     43,   44,   45,   46,   47,   48,   49,   50,   51,   50,   51,   51,
      4,   52,   66363382386412,   53,   54,   55,   56,   57,
     58,   59,   60,   61,   62,   63,   64,   65,    4,   67,    4,    4,
      5,   15,   17,   31,   34,   37,   68155159355357,   69,
    151,   70,   71,   72,   73,   74,   75,   76,   77,   78,   79,   80,
     81,   82,   83,   84,   85,   84,   85,   85,    4,   86100112,
    126,   87,   88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
     98,   99,    4101102103104105106107108109,
    110111,   67113114115116117118119120121,
    122123124125127132128129130131133139,
    134135136137138140141142143144145146,
    147148149150152153154,   31156157158160,
    185191161162163164165166167168169168,
    169169,    4170171172173174175176177178,
    179180181182183184,   67186187188189190,
    192279193194195196197198199200201200,
    201201,    4202216217229247251277203204,
    205206207208209210211212213214215,    4,
     67218219220221222223224225226227228,
    230243231232233234235236237238239240,
    241242244245246216248249250252258253,
    254255256257259265260261262263264266,
    267268269270271272273274275276278280,
    281282283284285286287288289290291292,
    293294295296297298299300299300300,    4,
    301315316335339353302303304305306307,
    308309310311312313314,    4,   67317331318,
    319320321322323324325326327328329330,
    332333334315336337338340346341342343,
    344345347348349350351352354356357358,
    359361362360358359360358361362,    5,   15,
     17,   31,   34,   37,   68155159355357364378365,
    366367368369370371372373374375376377,
    379380381,   66383384385387393388389390,
    391392394400395396397398399401402403,
    404405406407408409410411413,    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,    0,    0,   54,    3,    1,    0,   29,    1,   29,   29,   29,
     29,   29,   35,    0,    0,    0,    7139,   48,    0102,    9,
      5,   45134,   45,    0,   33122,   33,   33,    0,   11106,
      0,    0114,   25,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,   57149126,    0110,
     23,    0,   27118,   27,   51,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,   57144,    0,   54,    0,
     72,   33,   84,   84,   84,   84,   84,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,   15,   15,   31130,
     60,   57,   31,   63,   57,   63,   63,   63,   63,   63,   66,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,   57144,    0,   54,    0,   69,   33,   84,   84,
     84,    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,   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,   57144,    0,
     54,    0,   81,   84,    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,   57144,    0,
     54,    0,   75,   33,   84,   84,   84,   84,   84,   84,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,   17,
     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,   57144,    0,   54,    0,   78,
     33,   84,   84,   84,   84,   84,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,   19,   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,
     37,   37,   54,   37,   87,    0,    0,   39,    0,    0,   93,   90,
     41,   96,   90,   96,   96,   96,   96,   96,   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,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    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
  };
}

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


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

static final int lexer_en_main = 1;


// line 159 "ragel/i18n/es.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 603 "java/src/main/java/gherkin/lexer/Es.java"
  {
  cs = lexer_start;
  }

// line 185 "ragel/i18n/es.java.rl"
   
// line 610 "java/src/main/java/gherkin/lexer/Es.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/es.java.rl"
  {
      contentStart = p;
      currentLine = lineNumber;
      if(keyword != null) {
        startCol = p - lastNewline - (keyword.length() + 1);
      }
    }
  break;
  case 1:
// line 24 "ragel/i18n/es.java.rl"
  {
      currentLine = lineNumber;
      startCol = p - lastNewline;
    }
  break;
  case 2:
// line 29 "ragel/i18n/es.java.rl"
  {
      contentStart = p;
    }
  break;
  case 3:
// line 33 "ragel/i18n/es.java.rl"
  {
      docstringContentTypeStart = p;
    }
  break;
  case 4:
// line 37 "ragel/i18n/es.java.rl"
  {
      docstringContentTypeEnd = p;
    }
  break;
  case 5:
// line 41 "ragel/i18n/es.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/es.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/es.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/es.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/es.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/es.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/es.java.rl"
  {
      listener.step(keyword, substring(data, contentStart, p).trim(), currentLine);
    }
  break;
  case 12:
// line 86 "ragel/i18n/es.java.rl"
  {
      listener.comment(substring(data, contentStart, p).trim(), lineNumber);
      keywordStart = -1;
    }
  break;
  case 13:
// line 91 "ragel/i18n/es.java.rl"
  {
      listener.tag(substring(data, contentStart, p).trim(), currentLine);
      keywordStart = -1;
    }
  break;
  case 14:
// line 96 "ragel/i18n/es.java.rl"
  {
      lineNumber++;
    }
  break;
  case 15:
// line 100 "ragel/i18n/es.java.rl"
  {
      lastNewline = p + 1;
    }
  break;
  case 16:
// line 104 "ragel/i18n/es.java.rl"
  {
      if(keywordStart == -1) keywordStart = p;
    }
  break;
  case 17:
// line 108 "ragel/i18n/es.java.rl"
  {
      keyword = substring(data, keywordStart, p).replaceFirst(":$","");
      keywordStart = -1;
    }
  break;
  case 18:
// line 113 "ragel/i18n/es.java.rl"
  {
      nextKeywordStart = p;
    }
  break;
  case 19:
// line 117 "ragel/i18n/es.java.rl"
  {
      p = p - 1;
      currentRow = new ArrayList<String>();
      currentLine = lineNumber;
    }
  break;
  case 20:
// line 123 "ragel/i18n/es.java.rl"
  {
      contentStart = p;
    }
  break;
  case 21:
// line 127 "ragel/i18n/es.java.rl"
  {
      String con = substring(data, contentStart, p).trim();
      currentRow.add(con
        .replace("\\|", "|")
        .replace("\\n", "\n")
        .replace("\\\\", "\\")
      );
    }
  break;
  case 22:
// line 136 "ragel/i18n/es.java.rl"
  {
      listener.row(currentRow, currentLine);
    }
  break;
  case 23:
// line 140 "ragel/i18n/es.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 871 "java/src/main/java/gherkin/lexer/Es.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/es.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 903 "java/src/main/java/gherkin/lexer/Es.java"
    }
  }
  }

case 5:
  }
  break; }
  }

// line 186 "ragel/i18n/es.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.Es

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.