Package

Source Code of HpricotCss

// line 1 "hpricot_css.java.rl"
import java.io.IOException;

import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.RubyClass;
import org.jruby.RubyHash;
import org.jruby.RubyModule;
import org.jruby.RubyNumeric;
import org.jruby.RubyObject;
import org.jruby.RubyObjectAdapter;
import org.jruby.RubyRegexp;
import org.jruby.RubyString;
import org.jruby.anno.JRubyMethod;
import org.jruby.exceptions.RaiseException;
import org.jruby.javasupport.JavaEmbedUtils;
import org.jruby.runtime.Arity;
import org.jruby.runtime.Block;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.runtime.callback.Callback;
import org.jruby.exceptions.RaiseException;
import org.jruby.runtime.load.BasicLibraryService;
import org.jruby.util.ByteList;

public class HpricotCss {
    public void FILTER(String id) {
        IRubyObject[] args = new IRubyObject[fargs];
        System.arraycopy(fvals, 0, args, 0, fargs);
        mod.callMethod(ctx, id, args);
        tmpt.rb_clear();
        fargs = 1;
    }

    public void FILTERAUTO() {
        try {
            FILTER(new String(data, ts, te - ts, "ISO-8859-1"));
        } catch(java.io.UnsupportedEncodingException e) {}
    }

    public void PUSH(int aps, int ape) {
        RubyString str = RubyString.newString(runtime, data, aps, ape-aps);
        fvals[fargs++] = str;
        tmpt.append(str);
    }

    private IRubyObject self, mod, str, node;
    private int cs, act, eof, p, pe, ts, te, aps, ape, aps2, ape2;
    private byte[] data;

    private int fargs = 1;
    private IRubyObject[] fvals = new IRubyObject[6];
    private RubyArray focus;
    private RubyArray tmpt;
    private Ruby runtime;
    private ThreadContext ctx;

    public HpricotCss(IRubyObject self, IRubyObject mod, IRubyObject str, IRubyObject node) {
        this.self = self;
        this.mod = mod;
        this.str = str;
        this.node = node;
        this.runtime = self.getRuntime();
        this.ctx = runtime.getCurrentContext();
        this.focus = RubyArray.newArray(runtime, node);
        this.tmpt = runtime.newArray();

        fvals[0] = focus;

        if(!(str instanceof RubyString)) {
            throw runtime.newArgumentError("bad CSS selector, String only please.");
        }

        ByteList bl = ((RubyString)str).getByteList();

        data = bl.bytes;
        p = bl.begin;
        pe = p + bl.realSize;
        eof = pe;
    }


// line 86 "HpricotCss.java"
private static byte[] init__hpricot_css_actions_0()
{
  return new byte [] {
      0,    1,    0,    1,    1,    1,    2,    1,    3,    1,    6,    1,
      7,    1,   15,    1,   19,    1,   22,    1,   24,    1,   28,    1,
     29,    1,   30,    1,   31,    1,   32,    1,   33,    1,   34,    1,
     35,    2,    0,    3,    2,    1,   14,    2,    1,   16,    2,    1,
     17,    2,    1,   18,    2,    1,   20,    2,    1,   21,    2,    1,
     23,    2,    1,   25,    2,    1,   26,    2,    1,   27,    2,    4,
      5,    2,    7,    8,    2,    7,    9,    2,    7,   10,    2,    7,
     11,    2,    7,   12,    2,    7,   13,    3,    0,    1,   16,    3,
      0,    1,   18,    3,    7,    0,    8,    3,    7,    0,    9,    3,
      7,    0,   10,    3,    7,    0,   13,    3,    7,    1,   13
  };
}

private static final byte _hpricot_css_actions[] = init__hpricot_css_actions_0();


private static short[] init__hpricot_css_key_offsets_0()
{
  return new short [] {
      0,    0,    4,   20,   21,   23,   25,   27,   29,   30,   32,   34,
     36,   38,   54,   55,   57,   59,   61,   63,   85,   89,   92,   95,
     98,   99100101103107111114115116118119,
    120122123125127129131137142153161165,
    169173176180184201221222228229235237,
    238239241242246253259261264267270272,
    275277278299320341361384401403406409,
    412415417419449453456472477495511527,
    544563580598616634652670688705723741,
    759777795812830849867885904922940958,
    975976977994, 1011, 1027, 1044
  };
}

private static final short _hpricot_css_key_offsets[] = init__hpricot_css_key_offsets_0();


private static char[] init__hpricot_css_trans_keys_0()
{
  return new char [] {
     32,   44,    9,   13,   45,   92,   95196,   48,   57,   65,   90,
     97122197223224239240244,   46168191128,
    191128191128191,   46168191128191128191,
    128191,   45,   92,   95196,   48,   57,   65,   90,   97122,
    197223224239240244,   46168191128191128,
    191128191,   45,   92,   95101102103108110111,
    196,   48,   57,   65,   90,   97122197223224239240,
    244,   34,   39,   40,   41,   34,   40,   41,   34,   40,   41,   34,
     40,   41,   41,   41,   41,   34,   40,   34,   39,   40,   41,   34,
     39,   40,   41,   39,   40,   41,   41,   41,   39,   40,   41,   41,
     40,   41,   46168191128191128191128191,   34,
     39,   40,   41,   48,   57,   34,   40,   41,   48,   57,   34,   39,
     40,   41,   43,   45101110111,   48,   57,   34,   40,   41,
     43,   45110,   48,   57,   34,   40,   41118,   34,   40,   41,
    101,   34,   40,   41110,   34,   40,   41,   34,   40,   41100,
     34,   40,   41100,   45,   92,   95110196,   48,   57,   65,
     90,   97122197223224239240244,   32,   45,   61,
     92,   95196,    9,   13,   48,   57,   65,   90,   97122197,
    223224239240244,   61,   32,   34,   39,   93,    9,   13,
     93,   32,   34,   39,   93,    9,   13,   34,   93,   34,   93,   39,
     93,   39,   32,   61,    9,   13,   32,   34,   39,   61,   93,    9,
     13,   32,   34,   39,   93,    9,   13,   46,   61,   61168191,
     61128191,   61128191128191,   61128191128,
    191,   46,   32,   45,   61,   92,   95,   97196,    9,   13,   48,
     57,   65,   90,   98122197223224239240244,   32,
     45,   61,   92,   95109196,    9,   13,   48,   57,   65,   90,
     97122197223224239240244,   32,   45,   61,   92,
     95101196,    9,   13,   48,   57,   65,   90,   97122197,
    223224239240244,   32,   45,   61,   92,   95196,    9,
     13,   48,   57,   65,   90,   97122197223224239240,
    244,   32,   34,   39,   45,   61,   92,   93,   95196,    9,   13,
     48,   57,   65,   90,   97122197223224239240244,
     45,   92,   93,   95196,   48,   57,   65,   90,   97122197,
    223224239240244,   46,   93,   93168191,   93128,
    191,   93128191,   93128191168191128191,   32,
     35,   43,   44,   45,   46,   58,   62,   91,   92,   95101110,
    111126196,    9,   13,   48,   57,   65,   90,   97122197,
    223224239240244,   32,   44,    9,   13,   32,    9,   13,
     45,   92,   95196,   48,   57,   65,   90,   97122197223,
    224239240244,   43,   45110,   48,   57,   43,   45,   92,
     95110196,   48,   57,   65,   90,   97122197223224,
    239240244,   45,   92,   95196,   48,   57,   65,   90,   97,
    122197223224239240244,   45,   92,   95196,   48,
     57,   65,   90,   97122197223224239240244,   40,
     45,   92,   95196,   48,   57,   65,   90,   97122197223,
    224239240244,   40,   45,   92,   95113118196,   48,
     57,   65,   90,   97122197223224239240244,   40,
     45,   92,   95196,   48,   57,   65,   90,   97122197223,
    224239240244,   40,   45,   92,   95101196,   48,   57,
     65,   90,   97122197223224239240244,   40,   45,
     92,   95110196,   48,   57,   65,   90,   97122197223,
    224239240244,   40,   45,   92,   95105196,   48,   57,
     65,   90,   97122197223224239240244,   40,   45,
     92,   95114196,   48,   57,   65,   90,   97122197223,
    224239240244,   40,   45,   92,   95115196,   48,   57,
     65,   90,   97122197223224239240244,   40,   45,
     92,   95116196,   48,   57,   65,   90,   97122197223,
    224239240244,   40,   45,   92,   95196,   48,   57,   65,
     90,   97122197223224239240244,   40,   45,   92,
     95,   99196,   48,   57,   65,   90,   97122197223224,
    239240244,   40,   45,   92,   95104196,   48,   57,   65,
     90,   97122197223224239240244,   40,   45,   92,
     95105196,   48,   57,   65,   90,   97122197223224,
    239240244,   40,   45,   92,   95108196,   48,   57,   65,
     90,   97122197223224239240244,   40,   45,   92,
     95100196,   48,   57,   65,   90,   97122197223224,
    239240244,   40,   45,   92,   95196,   48,   57,   65,   90,
     97122197223224239240244,   40,   45,   92,   95,
    116196,   48,   57,   65,   90,   97122197223224239,
    240244,   40,   45,   92,   95,   97116196,   48,   57,   65,
     90,   98122197223224239240244,   40,   45,   92,
     95116196,   48,   57,   65,   90,   97122197223224,
    239240244,   40,   45,   92,   95104196,   48,   57,   65,
     90,   97122197223224239240244,   40,   45,   92,
     95100110196,   48,   57,   65,   90,   97122197223,
    224239240244,   40,   45,   92,   95100196,   48,   57,
     65,   90,   97122197223224239240244,   40,   45,
     92,   95108196,   48,   57,   65,   90,   97122197223,
    224239240244,   40,   45,   92,   95121196,   48,   57,
     65,   90,   97122197223224239240244,   40,   45,
     92,   95196,   48,   57,   65,   90,   97122197223224,
    239240244,   34,   39,   45,   92,   95118196,   48,   57,
     65,   90,   97122197223224239240244,   45,   92,
     95101196,   48,   57,   65,   90,   97122197223224,
    239240244,   45,   92,   95196,   48,   57,   65,   90,   97,
    122197223224239240244,   45,   92,   95100196,
     48,   57,   65,   90,   97122197223224239240244,
     45,   92,   95196,   48,   57,   65,   90,   97122197223,
    224239240244,    0
  };
}

private static final char _hpricot_css_trans_keys[] = init__hpricot_css_trans_keys_0();


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

private static final byte _hpricot_css_single_lengths[] = init__hpricot_css_single_lengths_0();


private static byte[] init__hpricot_css_range_lengths_0()
{
  return new byte [] {
      0,    1,    6,    0,    1,    1,    1,    1,    0,    1,    1,    1,
      1,    6,    0,    1,    1,    1,    1,    6,    0,    0,    0,    1,
      0,    0,    0,    0,    0,    0,    1,    0,    0,    0,    0,    0,
      0,    0,    1,    1,    1,    1,    1,    1,    1,    1,    0,    0,
      0,    0,    0,    0,    6,    7,    0,    1,    0,    1,    0,    0,
      0,    0,    0,    1,    1,    1,    0,    1,    1,    1,    1,    1,
      1,    0,    7,    7,    7,    7,    7,    6,    0,    1,    1,    1,
      1,    1,    1,    7,    1,    1,    6,    1,    6,    6,    6,    6,
      6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
      6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,    6,
      0,    0,    6,    6,    6,    6,    6
  };
}

private static final byte _hpricot_css_range_lengths[] = init__hpricot_css_range_lengths_0();


private static short[] init__hpricot_css_index_offsets_0()
{
  return new short [] {
      0,    0,    4,   15,   17,   19,   21,   23,   25,   27,   29,   31,
     33,   35,   46,   48,   50,   52,   54,   56,   73,   78,   82,   86,
     89,   91,   93,   95,   98103108111113115118120,
    122125127129131133135141146157165170,
    175180184189194206220222228230236239,
    241243246248252259265268271274277279,
    282284286301316331345362374377380383,
    386389391393417421424435440453464475,
    487501513526539552565578591603616629,
    642655668680693707720733747760773786,
    798800802814826837849
  };
}

private static final short _hpricot_css_index_offsets[] = init__hpricot_css_index_offsets_0();


private static byte[] init__hpricot_css_trans_targs_0()
{
  return new byte [] {
      1,   89,    1,   87,   90,    3,   90,    4,   90,   90,   90,    5,
      6,    7,    0,   90,   87,   90,   87,   90,   87,    5,   87,    6,
     87,   93,   87,   93,   87,   93,   87,   10,   87,   11,   87,   94,
     14,   94,   15,   94,   94,   94,   16,   17,   18,    0,   94,   87,
     94,   87,   94,   87,   16,   87,   17,   87,   95,   37,   95,   96,
    100111112113115,   38,   95,   95,   95,   39,   40,   41,
      0,   22,   28,   34,   87,   21,   87,   87,   87,   21,   24,   25,
     87,   23,   24,   87,   23,   87,   87,   87,   26,   27,   26,   24,
     25,   87,   30,   21,   31,   87,   29,   30,   21,   87,   87,   29,
     24,   87,   30,   87,   32,   33,   32,   24,   31,   87,   87,   35,
     36,   35,   34,   87,   87,   95,   87,   95,   87,   95,   87,   39,
     87,   40,   87,   22,   28,   34,   87,   43,   21,   87,   87,   87,
     43,   21,   22,   28,   34,   87,   45,   45,   46,   45,   50,   45,
     21,   87,   87,   87,   45,   45,   45,   45,   21,   87,   87,   87,
     47,   21,   87,   87,   87,   48,   21,   87,   87,   87,   49,   21,
     87,   87,   87,   21,   87,   87,   87,   51,   21,   87,   87,   87,
     49,   21,   53,   73,   53,   74,   85,   53,   53,   53,   70,   72,
     86,    0,   63,   53,   64,   66,   53,   67,   63,   53,   53,   53,
     68,   69,   71,   54,   55,    0,   57,   58,   61,    0,   57,   56,
     87,   56,   57,   58,   61,   87,   57,   56,   56120,   58,   60,
     59,   87,   87,   56121,   61,   60,   62,   63,   64,   63,   54,
     57,   58,   61,   65,    0,   57,   56,   57,   58,   61,   87,   57,
     56,   53,   55,    0,   55,   53,    0,   55,   53,    0,   55,   70,
      0,   53,    0,   55,   72,    0,   70,    0,   53,    0,   63,   53,
     64,   66,   53,   75,   67,   63,   53,   53,   53,   68,   69,   71,
     54,   63,   53,   64,   66,   53,   76,   67,   63,   53,   53,   53,
     68,   69,   71,   54,   63,   53,   64,   66,   53,   77,   67,   63,
     53,   53,   53,   68,   69,   71,   54,   63,   53,   78,   66,   53,
     67,   63,   53,   53,   53,   68,   69,   71,   54,   57,   58,   61,
     79,   65,   80,    0,   79,   81,   57,   79,   79,   79,   82,   83,
     84,   56,   79,   80,   87,   79,   81,   79,   79,   79,   82,   83,
     84,   56,   79,   87,   56,   87,   79,   56,   87,   79,   56,   87,
     82,   56,   87,   83,   56,   53,    0,   72,    0,   88,    2,   91,
     89,   92,   13,   19,   87,   52,    8,   93122,   92125,   87,
      9,   88,   92,   93,   93,   10,   11,   12,    0,    1,   89,    1,
     87,   89,   89,   87,   90,    3,   90,    4,   90,   90,   90,    5,
      6,    7,   87,   91,   91,   91,   91,   87,   91,   92,    8,   93,
     92,    9,   92,   93,   93,   10,   11,   12,   87,   93,    8,   93,
      9,   93,   93,   93,   10,   11,   12,   87,   94,   14,   94,   15,
     94,   94,   94,   16,   17,   18,   87,   20,   95,   37,   95,   38,
     95,   95,   95,   39,   40,   41,   87,   20,   95,   37,   95,   97,
     98,   38,   95,   95,   95,   39,   40,   41,   87,   42,   95,   37,
     95,   38,   95,   95,   95,   39,   40,   41,   87,   20,   95,   37,
     95,   99,   38,   95,   95,   95,   39,   40,   41,   87,   20,   95,
     37,   95,   97,   38,   95,   95,   95,   39,   40,   41,   87,   20,
     95,   37,   95101,   38,   95,   95,   95,   39,   40,   41,   87,
     20,   95,   37,   95102,   38,   95,   95,   95,   39,   40,   41,
     87,   20,   95,   37,   95103,   38,   95,   95,   95,   39,   40,
     41,   87,   20,   95,   37,   95104,   38,   95,   95,   95,   39,
     40,   41,   87,   42105,   37,   95,   38,   95,   95,   95,   39,
     40,   41,   87,   20,   95,   37,   95106,   38,   95,   95,   95,
     39,   40,   41,   87,   20,   95,   37,   95107,   38,   95,   95,
     95,   39,   40,   41,   87,   20,   95,   37,   95108,   38,   95,
     95,   95,   39,   40,   41,   87,   20,   95,   37,   95109,   38,
     95,   95,   95,   39,   40,   41,   87,   20,   95,   37,   95110,
     38,   95,   95,   95,   39,   40,   41,   87,   44,   95,   37,   95,
     38,   95,   95,   95,   39,   40,   41,   87,   20,   95,   37,   95,
     97,   38,   95,   95,   95,   39,   40,   41,   87,   20,   95,   37,
     95102,   97,   38,   95,   95,   95,   39,   40,   41,   87,   20,
     95,   37,   95114,   38,   95,   95,   95,   39,   40,   41,   87,
     20,   95,   37,   95104,   38,   95,   95,   95,   39,   40,   41,
     87,   20,   95,   37,   95116117,   38,   95,   95,   95,   39,
     40,   41,   87,   20,   95,   37,   95,   97,   38,   95,   95,   95,
     39,   40,   41,   87,   20,   95,   37,   95118,   38,   95,   95,
     95,   39,   40,   41,   87,   20,   95,   37,   95119,   38,   95,
     95,   95,   39,   40,   41,   87,   20105,   37,   95,   38,   95,
     95,   95,   39,   40,   41,   87,   60,   59,   60,   62,   93,    8,
     93123,    9,   93,   93,   93,   10,   11,   12,   87,   93,    8,
     93124,    9,   93,   93,   93,   10,   11,   12,   87,   93,    8,
     93,    9,   93,   93,   93,   10,   11,   12,   87,   93,    8,   93,
    126,    9,   93,   93,   93,   10,   11,   12,   87,   93,    8,   93,
      9,   93,   93,   93,   10,   11,   12,   87,   87,   87,   87,   87,
     87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
     87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
     87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
     87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
     87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
     87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
     87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,   87,
     87,   87,    0
  };
}

private static final byte _hpricot_css_trans_targs[] = init__hpricot_css_trans_targs_0();


private static byte[] init__hpricot_css_trans_actions_0()
{
  return new byte [] {
      0,    0,    0,   33,   99,    1,   99,    1,   99,   99,   99,    1,
      1,    1,    0,   73,   35,   73,   35,   73,   35,    0,   35,    0,
     35,   79,   35,   79,   35,   79,   35,    0,   35,    0,   35103,
      1103,    1103103103,    1,    1,    1,    0,   76,   35,
     76,   35,   76,   35,    0,   35,    0,   35111,    1111111,
    111111111111111,    1111111111,    1,    1,    1,
      0,    1,    1,    1,   95,    1,   35,   35,   49,    0,    0,    0,
     35,    0,    0,   35,    0,   49,   35,   35,    0,    0,    0,    0,
      0,   35,    0,    0,    0,   49,    0,    0,    0,   35,   49,    0,
      0,   35,    0,   35,    0,    0,    0,    0,    0,   35,   35,    0,
      0,    0,    0,   49,   35,   88,   35,   88,   35,   88,   35,    0,
     35,    0,   35,    1,    1,    1,   95,    1,    1,   29,   29,   46,
      0,    0,    1,    1,    1,   91,    1,    1,    1,    1,    1,    1,
      1,   27,   27,   43,    0,    0,    0,    0,    0,   27,   27,   49,
      0,    0,   27,   27,   49,    0,    0,   27,   27,   49,    0,    0,
     27,   27,   43,    0,   27,   27,   49,    0,    0,   27,   27,   49,
      0,    0,    1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
      1,    0,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
      5,    5,    5,    5,    0,    0,    7,    7,    7,    0,    7,    7,
     13,    0,    0,    0,    0,   13,    0,    0,    0,   11,    0,    0,
      0,   13,   25,    0,   11,    0,    0,    0,    0,    0,    0,    0,
      7,    7,    7,    7,    0,    7,    7,    7,    7,    7,   13,    7,
      7,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    5,    5,
      5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
      5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
      5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
      5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
      5,    5,    5,    5,    5,    5,    5,    5,    5,    7,    7,    7,
     37,    7,   37,    0,   37,   37,    7,   37,   37,   37,   37,   37,
     37,    7,    0,    0,   40,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,   13,    0,   13,    0,    0,   13,    0,    0,   13,
      0,    0,   13,    0,    0,    0,    0,    0,    0,   11,    0,    0,
      0107,    0,    0,   15,    0,    1107107107107,   15,
      1,   11107107107,    1,    1,    1,    0,    0,    0,    0,
     23,    0,    0,   21,   73,    0,   73,    0,   73,   73,   73,    0,
      0,    0,   52,    0,    0,    0,    0,   19,    3,   79,    0,   79,
     79,    0,   79,   79,   79,    0,    0,    0,   58,   79,    0,   79,
      0,   79,   79,   79,    0,    0,    0,   58,   76,    0,   76,    0,
     76,   76,   76,    0,    0,    0,   55,    3,   88,    0,   88,    0,
     88,   88,   88,    0,    0,    0,   67,    3,   88,    0,   88,   85,
     88,    0,   88,   88,   88,    0,    0,    0,   67,    3115,    3,
    115,    3115115115,    3,    3,    3,   64,    3,   88,    0,
     88,   88,    0,   88,   88,   88,    0,    0,    0,   67,    3,   88,
      0,   88,   85,    0,   88,   88,   88,    0,    0,    0,   67,    3,
     88,    0,   88,   88,    0,   88,   88,   88,    0,    0,    0,   67,
      3,   88,    0,   88,   88,    0,   88,   88,   88,    0,    0,    0,
     67,    3,   88,    0,   88,   88,    0,   88,   88,   88,    0,    0,
      0,   67,    3,   88,    0,   88,   85,    0,   88,   88,   88,    0,
      0,    0,   67,    3115,    3115,    3115115115,    3,
      3,    3,   64,    3,   88,    0,   88,   88,    0,   88,   88,   88,
      0,    0,    0,   67,    3,   88,    0,   88,   88,    0,   88,   88,
     88,    0,    0,    0,   67,    3,   88,    0,   88,   88,    0,   88,
     88,   88,    0,    0,    0,   67,    3,   88,    0,   88,   88,    0,
     88,   88,   88,    0,    0,    0,   67,    3,   88,    0,   88,   82,
      0,   88,   88,   88,    0,    0,    0,   67,    3115,    3115,
      3115115115,    3,    3,    3,   61,    3,   88,    0,   88,
     85,    0,   88,   88,   88,    0,    0,    0,   67,    3,   88,    0,
     88,   88,   85,    0,   88,   88,   88,    0,    0,    0,   67,    3,
     88,    0,   88,   88,    0,   88,   88,   88,    0,    0,    0,   67,
      3,   88,    0,   88,   85,    0,   88,   88,   88,    0,    0,    0,
     67,    3,   88,    0,   88,   88,   88,    0,   88,   88,   88,    0,
      0,    0,   67,    3,   88,    0,   88,   85,    0,   88,   88,   88,
      0,    0,    0,   67,    3,   88,    0,   88,   88,    0,   88,   88,
     88,    0,    0,    0,   67,    3,   88,    0,   88,   88,    0,   88,
     88,   88,    0,    0,    0,   67,    3,   88,    0,   88,    0,   88,
     88,   88,    0,    0,    0,   67,    0,    0,    0,    0,   79,    0,
     79,   79,    0,   79,   79,   79,    0,    0,    0,   58,   79,    0,
     79,   79,    0,   79,   79,   79,    0,    0,    0,   58,   79,    0,
     79,    0,   79,   79,   79,    0,    0,    0,   58,   79,    0,   79,
     79,    0,   79,   79,   79,    0,    0,    0,   58,   79,    0,   79,
      0,   79,   79,   79,    0,    0,    0,   58,   33,   35,   35,   35,
     35,   35,   35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
     31,   35,   35,   35,   35,   35,   35,   35,   35,   35,   35,   35,
     35,   35,   35,   35,   35,   35,   35,   35,   35,   35,   29,   29,
     27,   27,   27,   27,   27,   27,   27,   27,   25,   25,   25,   23,
     21,   52,   19,   58,   58,   55,   67,   67,   64,   67,   67,   67,
     67,   67,   67,   64,   67,   67,   67,   67,   67,   61,   67,   67,
     67,   67,   67,   67,   67,   67,   67,   17,   17,   58,   58,   58,
     58,   58,    0
  };
}

private static final byte _hpricot_css_trans_actions[] = init__hpricot_css_trans_actions_0();


private static byte[] init__hpricot_css_to_state_actions_0()
{
  return new byte [] {
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,   70,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    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 _hpricot_css_to_state_actions[] = init__hpricot_css_to_state_actions_0();


private static byte[] init__hpricot_css_from_state_actions_0()
{
  return new byte [] {
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    9,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    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 _hpricot_css_from_state_actions[] = init__hpricot_css_from_state_actions_0();


private static short[] init__hpricot_css_eof_trans_0()
{
  return new short [] {
      0861,    0898898898898898898898898898,
    898,    0898898898898898,    0877898898898,
    898898898898898898898898898898898898,
    898898898898898898900900908908908908,
    908908908908,    0,    0,    0,    0,    0,    0,    0911,
    911,    0911,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
      0,    0,    0,    0912913914915950950918943,
    943928943943943943943943928943943943,
    943943934943943943943943943943943943,
    945945950950950950950
  };
}

private static final short _hpricot_css_eof_trans[] = init__hpricot_css_eof_trans_0();


static final int hpricot_css_start = 87;
static final int hpricot_css_error = 0;

static final int hpricot_css_en_main = 87;


// line 147 "hpricot_css.java.rl"


    public IRubyObject scan() {

// line 533 "HpricotCss.java"
  {
  cs = hpricot_css_start;
  ts = -1;
  te = -1;
  act = 0;
  }

// line 151 "hpricot_css.java.rl"

// line 543 "HpricotCss.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:
  _acts = _hpricot_css_from_state_actions[cs];
  _nacts = (int) _hpricot_css_actions[_acts++];
  while ( _nacts-- > 0 ) {
    switch ( _hpricot_css_actions[_acts++] ) {
  case 6:
// line 1 "NONE"
  {ts = p;}
  break;
// line 572 "HpricotCss.java"
    }
  }

  _match: do {
  _keys = _hpricot_css_key_offsets[cs];
  _trans = _hpricot_css_index_offsets[cs];
  _klen = _hpricot_css_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] < _hpricot_css_trans_keys[_mid] )
        _upper = _mid - 1;
      else if ( data[p] > _hpricot_css_trans_keys[_mid] )
        _lower = _mid + 1;
      else {
        _trans += (_mid - _keys);
        break _match;
      }
    }
    _keys += _klen;
    _trans += _klen;
  }

  _klen = _hpricot_css_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] < _hpricot_css_trans_keys[_mid] )
        _upper = _mid - 2;
      else if ( data[p] > _hpricot_css_trans_keys[_mid+1] )
        _lower = _mid + 2;
      else {
        _trans += ((_mid - _keys)>>1);
        break _match;
      }
    }
    _trans += _klen;
  }
  } while (false);

case 3:
  cs = _hpricot_css_trans_targs[_trans];

  if ( _hpricot_css_trans_actions[_trans] != 0 ) {
    _acts = _hpricot_css_trans_actions[_trans];
    _nacts = (int) _hpricot_css_actions[_acts++];
    while ( _nacts-- > 0 )
  {
      switch ( _hpricot_css_actions[_acts++] )
      {
  case 0:
// line 85 "hpricot_css.java.rl"
  {
    aps = p;
  }
  break;
  case 1:
// line 89 "hpricot_css.java.rl"
  {
    ape = p;
    PUSH(aps, ape);
  }
  break;
  case 2:
// line 94 "hpricot_css.java.rl"
  {
    ape = p;
    aps2 = p;
  }
  break;
  case 3:
// line 99 "hpricot_css.java.rl"
  {
    ape2 = p;
    PUSH(aps, ape);
    PUSH(aps2, ape2);
  }
  break;
  case 7:
// line 1 "NONE"
  {te = p+1;}
  break;
  case 8:
// line 132 "hpricot_css.java.rl"
  {act = 1;}
  break;
  case 9:
// line 133 "hpricot_css.java.rl"
  {act = 2;}
  break;
  case 10:
// line 136 "hpricot_css.java.rl"
  {act = 5;}
  break;
  case 11:
// line 138 "hpricot_css.java.rl"
  {act = 7;}
  break;
  case 12:
// line 139 "hpricot_css.java.rl"
  {act = 8;}
  break;
  case 13:
// line 140 "hpricot_css.java.rl"
  {act = 9;}
  break;
  case 14:
// line 134 "hpricot_css.java.rl"
  {te = p+1;{ FILTER("NAME"); }}
  break;
  case 15:
// line 135 "hpricot_css.java.rl"
  {te = p+1;{ FILTER("ATTR"); }}
  break;
  case 16:
// line 138 "hpricot_css.java.rl"
  {te = p+1;{ FILTER("CHILD"); }}
  break;
  case 17:
// line 139 "hpricot_css.java.rl"
  {te = p+1;{ FILTER("POS"); }}
  break;
  case 18:
// line 140 "hpricot_css.java.rl"
  {te = p+1;{ FILTER("PSUEDO"); }}
  break;
  case 19:
// line 142 "hpricot_css.java.rl"
  {te = p+1;{ FILTERAUTO(); }}
  break;
  case 20:
// line 132 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("ID"); }}
  break;
  case 21:
// line 133 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("CLASS"); }}
  break;
  case 22:
// line 135 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("ATTR"); }}
  break;
  case 23:
// line 136 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("TAG"); }}
  break;
  case 24:
// line 137 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("MOD"); }}
  break;
  case 25:
// line 138 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("CHILD"); }}
  break;
  case 26:
// line 139 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("POS"); }}
  break;
  case 27:
// line 140 "hpricot_css.java.rl"
  {te = p;p--;{ FILTER("PSUEDO"); }}
  break;
  case 28:
// line 141 "hpricot_css.java.rl"
  {te = p;p--;{ focus = RubyArray.newArray(runtime, node); }}
  break;
  case 29:
// line 143 "hpricot_css.java.rl"
  {te = p;p--;}
  break;
  case 30:
// line 135 "hpricot_css.java.rl"
  {{p = ((te))-1;}{ FILTER("ATTR"); }}
  break;
  case 31:
// line 138 "hpricot_css.java.rl"
  {{p = ((te))-1;}{ FILTER("CHILD"); }}
  break;
  case 32:
// line 139 "hpricot_css.java.rl"
  {{p = ((te))-1;}{ FILTER("POS"); }}
  break;
  case 33:
// line 140 "hpricot_css.java.rl"
  {{p = ((te))-1;}{ FILTER("PSUEDO"); }}
  break;
  case 34:
// line 143 "hpricot_css.java.rl"
  {{p = ((te))-1;}}
  break;
  case 35:
// line 1 "NONE"
  switch( act ) {
  case 0:
  {{cs = 0; _goto_targ = 2; if (true) continue _goto;}}
  break;
  case 1:
  {{p = ((te))-1;} FILTER("ID"); }
  break;
  case 2:
  {{p = ((te))-1;} FILTER("CLASS"); }
  break;
  case 5:
  {{p = ((te))-1;} FILTER("TAG"); }
  break;
  case 7:
  {{p = ((te))-1;} FILTER("CHILD"); }
  break;
  case 8:
  {{p = ((te))-1;} FILTER("POS"); }
  break;
  case 9:
  {{p = ((te))-1;} FILTER("PSUEDO"); }
  break;
  }
  }
  break;
// line 802 "HpricotCss.java"
      }
    }
  }

case 2:
  _acts = _hpricot_css_to_state_actions[cs];
  _nacts = (int) _hpricot_css_actions[_acts++];
  while ( _nacts-- > 0 ) {
    switch ( _hpricot_css_actions[_acts++] ) {
  case 4:
// line 1 "NONE"
  {ts = -1;}
  break;
  case 5:
// line 1 "NONE"
  {act = 0;}
  break;
// line 820 "HpricotCss.java"
    }
  }

  if ( cs == 0 ) {
    _goto_targ = 5;
    continue _goto;
  }
  if ( ++p != pe ) {
    _goto_targ = 1;
    continue _goto;
  }
case 4:
  if ( p == eof )
  {
  if ( _hpricot_css_eof_trans[cs] > 0 ) {
    _trans = _hpricot_css_eof_trans[cs] - 1;
    _goto_targ = 3;
    continue _goto;
  }
  }

case 5:
  }
  break; }
  }

// line 152 "hpricot_css.java.rl"

        return focus;
    }
}
TOP

Related Classes of HpricotCss

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.