Package gherkin.lexer

Source Code of gherkin.lexer.Sv

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


  private final Listener listener;

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

 
// line 26 "java/src/main/java/gherkin/lexer/Sv.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,   19,   20,   21,   39,   40,   41,   43,   45,   50,   55,
     60,   65,   69,   73,   75,   76,   77,   78,   79,   80,   81,   82,
     83,   84,   85,   86,   87,   88,   89,   90,   91,   93,   95100,
    107112113114115116117118119120121122,
    123124125126127128129130131145147149,
    151153155157159161163165167169171173,
    175193194195196197198199200201202203,
    218220222224226228230232234236238240,
    242244246248250252254256258260262264,
    266268270272274276278280282284286288,
    290292294296298300302304306308310312,
    314316318321323325327329331333335338,
    340342344346347348349350351352353354,
    355366368370372374376378380382384386,
    388390392394396398400402404406408410,
    412414416418420422424426428430432434,
    436438440442445447449451453455457459,
    461463465467469471473475477479481484,
    486488489490491492493494495496503505,
    507509511513515517519520521522523524,
    525526527528529530532533534535536537,
    538539541542543559561563565567569571,
    573575577579581583585587589591593595,
    597599601603605607609611613615617619,
    621623625627629631633635637639641643,
    645647649651653655657659661663665667,
    669671673676678680682684686688690693,
    695697699700701702706712715717723741,
    743745747749751753755757759761763765,
    767769771773775777779782784786788790,
    792794796
  };
}

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,   66,   69,   71,
     77,   78,   79,   83124,    9,   13,  -69,  -65,   10,   32,   34,
     35,   37,   42,   64,   65,   66,   69,   71,   77,   78,   79,   83,
    124,    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,   98115116114,   97107116,   32,
     83,   99101110,   97114105111,   58,   10,   10,   10,
     32,   35,   37,   42,   64,   69,   71,   77,   78,   79,   83,    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,   66,   69,   71,   77,   78,   79,   83124,    9,
     13,   97107103114117110100,   58,   10,   10,   10,
     32,   35,   37,   42,   64,   65,   69,   71,   77,   78,   79,   83,
      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,   98,   10115,
     10116,   10114,   10,   97,   10107,   10116,   10,   32,
     10,   83,   10,   99,   10101,   10110,   10,   97,   10114,
     10105,   10111,   10,   58,   10103,   10101,   10110,
     10115,   10107,   10,   97,   10112,   10105,   10118,
     10101,   10116,   10101,   10110,  -61,   10,  -92,   10,
     10114,   10,   99,   10104,  -61,   10,   99,  -91,   10,   10,
    101,   10110,   10,   97,   10114,   10105,   10111,   10,
     58109,   10,   97,   10108,   10108103120101110,
    115107,   97112,   58,   10,   10,   10,   32,   35,   37,   64,
     65,   66,   69,   83,    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,   98,
     10115,   10116,   10114,   10,   97,   10107,   10116,
     10,   32,   10,   83,   10,   99,   10101,   10110,   10,   97,
     10114,   10105,   10111,   10,   58,   10,   97,   10107,
     10103,   10114,   10117,   10110,   10100,   10103,
    120,   10101,   10110,   10115,   10107,   10,   97,   10,
    112,   10101,   10109,   10112,   10101,   10108,   10,
     99,   10101,   10110,   10,   97,   10114,   10105,   10,
    111,   10,   58109,   10,   97,   10108101109112101,
    108,   58,   10,   10,   10,   32,   35,   69124,    9,   13,   10,
    103,   10101,   10110,   10115,   10107,   10,   97,   10,
    112,   10,   58105118101116101110,  -61,  -92114,
     99104,  -61,   99,  -91101110,   97114105111,   58,
    109,   10,   10,   10,   32,   35,   37,   42,   64,   65,   66,   69,
     71,   77,   78,   79,   83,    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,   98,   10115,   10116,   10114,   10,   97,   10,
    107,   10116,   10,   32,   10,   83,   10,   99,   10101,   10,
    110,   10,   97,   10114,   10105,   10111,   10,   58,   10,
     97,   10107,   10103,   10114,   10117,   10110,   10,
    100,   10103,   10101,   10110,   10115,   10107,   10,
     97,   10112,   10105,   10118,   10101,   10116,   10,
    101,   10110,  -61,   10,  -92,   10,   10114,   10,   99,   10,
    104,  -61,   10,   99,  -91,   10,   10101,   10110,   10,   97,
     10114,   10105,   10111,   10,   58109,   10,   97,   10,
    108,   10108,   97108108,   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,   66,
     69,   71,   77,   78,   79,   83124,    9,   13,   10103,   10,
    101,   10110,   10115,   10107,   10,   97,   10112,   10,
     58,   10105,   10118,   10101,   10116,   10101,   10,
    110,  -61,   10,  -92,   10,   10114,   10,   99,   10104,  -61,
     10,   99,  -91,   10,   10101,   10110,   10,   97,   10114,
     10105,   10111,    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,   17,    1,    1,   16,    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,    1,    1,    1,    1,    1,   12,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
     16,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,   13,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    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,    3,    2,
      2,    2,    2,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      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,    3,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    3,    2,
      2,    1,    1,    1,    1,    1,    1,    1,    1,    5,    2,    2,
      2,    2,    2,    2,    2,    2,    1,    1,    1,    1,    1,    1,
      1,    1,    1,    1,    1,    2,    1,    1,    1,    1,    1,    1,
      1,    2,    1,    1,   14,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,    2,
      2,    2,    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,    3,    2,
      2,    2,    1,    1,    1,    2,    4,    3,    2,    4,   16,    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,    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,    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,    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,
      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,    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,    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,    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
  };
}

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,   19,   21,   23,   41,   43,   45,   48,   51,   56,   61,
     66,   71,   75,   79,   82,   84,   86,   88,   90,   92,   94,   96,
     98100102104106108110112114117120125,
    132137139141143145147149151153155157,
    159161163165167169171173175189192195,
    198201204207210213216219222225228231,
    234252254256258260262264266268270272,
    287290293296299302305308311314317320,
    323326329332335338341344347350353356,
    359362365368371374377380383386389392,
    395398401404407410413416419422425428,
    431434437441444447450453456459462466,
    469472475478480482484486488490492494,
    496507510513516519522525528531534537,
    540543546549552555558561564567570573,
    576579582585588591594597600603606609,
    612615618621625628631634637640643646,
    649652655658661664667670673676679683,
    686689691693695697699701703705712715,
    718721724727730733736738740742744746,
    748750752754756758761763765767769771,
    773775778780782798801804807810813816,
    819822825828831834837840843846849852,
    855858861864867870873876879882885888,
    891894897900903906909912915918921924,
    927930933936939942945948951954957960,
    963966969973976979982985988991994998,
   1001, 1004, 1007, 1009, 1011, 1013, 1017, 1023, 1027, 1030, 1036, 1054,
   1057, 1060, 1063, 1066, 1069, 1072, 1075, 1078, 1081, 1084, 1087, 1090,
   1093, 1096, 1099, 1102, 1105, 1108, 1111, 1115, 1118, 1121, 1124, 1127,
   1130, 1133, 1136
  };
}

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,   14,   15,   16,   17,    2,    0,   18,    0,    2,    0,    3,
      2,    4,    5,    6,    7,    8,    9,   10,   11,   12,   13,   14,
     15,   16,   17,    2,    0,   19,    0,   20,    0,   22,   23,   21,
     25,   26,   24,   29,   28,   30,   28,   27,   33,   32,   34,   32,
     31,   33,   32,   35,   32,   31,   33,   32,   36,   32,   31,   38,
     37,   37,    0,    3,   39,   39,    0,   41,   42,   40,    3,    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,
     55,    0,   56,    0,   57,    0,   59,   60,   58,   62,   63,   61,
      0,    0,    0,    0,   64,   65,   66,   65,   65,   68,   67,   64,
      3,   69,    8,   69,    0,   70,    0,   71,    0,   72,    0,   73,
      0,   74,    0,   75,    0,   76,    0,   77,    0,   78,    0,   79,
      0,   80,    0,   81,    0,   82,    0,   83,    0,   84,    0,   85,
      0,   86,    0,   88,   87,   90,   89,   90,   91,   92,   93,   94,
     92,   95,   96,   97,   98,   99100,   91,   89,   90101,   89,
     90102,   89,   90103,   89,   90104,   89,   90105,   89,
     90106,   89,   90107,   89,   90108,   89,   90109,   89,
     90110,   89,   90111,   89,   90112,   89,   90113,   89,
     90114,   89,   90115,   89117116118119120121,
    122123124125126127128129130131116,    0,
    132,    0133,    0134,    0135,    0136,    0137,    0,
    138,    0139,    0141140143142143144145146,
    147145148149150151152153154144142143,
    155142143156142143157142143158142143,
    159142143160142143161142143162142143,
    163142143164142143165142143166142143,
    167142143168142143169142143170142143,
    171142143172142143173142143174142143,
    175142143176142143177142143178142143,
    179142143180142143181142143182142143,
    183142143184142143185142143169142143,
    186142143187142143188142143189142143,
    190142143191142143185142143192142143,
    193142143194142143195142143196142143,
    195142197143142198143142143195142143,
    199142143195142200143201142195143142,
    143202142143203142143204142143205142,
    143206142143207142143169208142143209,
    142143210142143185142211212,    0213,    0,
    214,    0215,    0216,    0217,    0218,    0219,    0,
    221220223222223224225226225227228229,
    230224222223231222223232222223233222,
    223234222223235222223236222223237222,
    223238222223239222223240222223241222,
    223242222223243222223244222223245222,
    223246222223247222223248222223249222,
    223250222223251222223252222223253222,
    223254222223255222223256222223257222,
    223258222223259222223260222223261222,
    223262222223263222223264222223265222,
    223266222223267222223260222223268269,
    222223270222223271222223272222223273,
    222223274222223260222223275222223276,
    222223277222223278222223260222223279,
    222223280222223281222223282222223283,
    222223284222223285222223261286222223,
    287222223278222288,    0289,    0290,    0291,
      0292,    0293,    0295294297296297298299,
    300299298296297301296297302296297303,
    296297304296297305296297306296297307,
    296297308296309,    0310,    0311,    0312,    0,
    313,    0312,    0314,    0315,    0312,    0316,    0,
    312,    0317318,    0312,    0319,    0320,    0321,
      0322,    0323,    0324,    0325326,    0328327,
    330329330331332333334332335336337338,
    339340341342331329330343329330344329,
    330345329330346329330347329330348329,
    330349329330350329330351329330352329,
    330353329330354329330355329330356329,
    330357329330358329330359329330360329,
    330361329330362329330363329330364329,
    330365329330366329330367329330368329,
    330369329330370329330371329330372329,
    330373329330357329330374329330375329,
    330376329330377329330378329330379329,
    330373329330380329330381329330382329,
    330383329330384329330385329330373329,
    330386329330387329330388329330389329,
    330390329330389329391330329392330329,
    330389329330393329330389329394330395,
    329389330329330396329330397329330398,
    329330399329330400329330401329330357,
    402329330403329330404329330373329405,
      0406,    0,   85,    0407408407,    0411410412,
    413410409,    0415416414,    0415414411417,
    415416417414411418419420421422423424,
    425426427428429430431432418,    0,   90433,
     89,   90434,   89,   90435,   89,   90436,   89,   90437,
     89,   90438,   89,   90439,   89,   90115,   89,   90440,
     89,   90441,   89,   90442,   89,   90443,   89,   90444,
     89,   90443,   89445,   90,   89446,   90,   89,   90443,
     89,   90447,   89,   90443,   89448,   90449,   89443,
     90,   89,   90450,   89,   90451,   89,   90452,   89,   90,
    453,   89,   90454,   89,   90439,   89455,    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,   73146,
    234238240243245329,    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,   30362,   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,
     52,   53,   54,   55,   56,   55,   56,   56,    4,   57,   71335,
    343347349352354,   58,   59,   60,   61,   62,   63,   64,
     65,   66,   67,   68,   69,   70,    4,   72,    4,    4,    5,   15,
     17,   31,   34,   37,   73146234238240243245329,
     74,   75,   76,   77,   78,   79,   80,   81,   82,   83,   82,   83,
     83,    4,   84,   98,   99116123127129132134,   85,
     86,   87,   88,   89,   90,   91,   92,   93,   94,   95,   96,   97,
      4,   72100101102103104105106107108109,
    110111112113114115117118119120121122,
    124125126,   98128130131133135136137138,
    139140141142143144145147217148149150,
    151152153154155156155156156,    4157171,
    188195207158159160161162163164165166,
    167168169170,    4172173174175176177178,
    179180181182183184185186187,   72189190,
    191192193194196202197198199200201203,
    204205206208209210211212213214215216,
    218219220221222223224225224225225,    4,
    226227228229230231232233,   72235236237,
     31239241242244246247248249250251252,
    253254326255256255256256,    4257271272,
    289296303307309312314258259260261262,
    263264265266267268269270,    4,   72273274,
    275276277278279280281282283284285286,
    287288290291292293294295297298299300,
    301302304305306271308310311313315316,
    317318319320321322323324325327328329,
    330331333334332330331332330333334,    5,
     15,   17,   31,   34,   37,   73146234238240243245,
    329336337338339340341342344345346,   71,
    348350351353355356357358359360361,    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,   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,   57149,
    126,    0110,   23,    0,   27118,   27,   51,    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,   84,   84,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,   19,   19,   31130,   60,   57,
     31,   63,   57,   63,   63,   63,   63,   63,   63,   63,   63,   66,
      0,    0,    0,    0,    0,    0,    0,    0,   57144,    0,   54,
      0,   72,   33,   84,   84,   84,   84,   84,   84,   84,   84,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     15,   15,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    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,   69,   33,   84,
     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,    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,   57144,    0,   54,    0,   81,
     84,    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,   57144,    0,   54,    0,   75,   33,   84,   84,
     84,   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,   37,   37,   54,   37,   87,    0,    0,   39,    0,    0,   93,
     90,   41,   96,   90,   96,   96,   96,   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
  };
}

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
  };
}

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


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

static final int lexer_en_main = 1;


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

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

case 5:
  }
  break; }
  }

// line 186 "ragel/i18n/sv.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.Sv

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.