Packages
floki
0.4.0
0.38.4
0.38.3
0.38.2
0.38.1
0.38.0
0.37.1
0.37.0
0.36.3
0.36.2
0.36.1
0.36.0
0.35.4
0.35.3
0.35.2
0.35.1
0.35.0
0.34.3
0.34.2
0.34.1
0.34.0
0.33.1
0.33.0
0.32.1
0.32.0
0.31.0
0.30.1
0.30.0
0.29.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.0
0.23.1
0.23.0
0.22.0
0.21.0
0.20.4
0.20.3
0.20.2
0.20.1
0.20.0
0.19.3
0.19.2
0.19.1
0.19.0
0.18.1
0.18.0
0.17.2
0.17.1
0.17.0
0.16.0
0.15.0
0.14.0
0.13.2
0.13.1
0.13.0
0.12.1
0.12.0
0.11.0
0.10.1
0.10.0
0.9.0
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.1
0.6.0
0.5.0
0.4.1
0.4.0
0.3.3
0.3.2
0.3.1
0.3.0
0.2.1
0.2.0
0.1.1
0.1.0
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Floki is a simple HTML parser that enables search for nodes using CSS selectors.
Current section
Files
Jump to
Current section
Files
src/floki_selector_lexer.erl
-file("/usr/local/Cellar/erlang/18.0.2/lib/erlang/lib/parsetools-2.1/include/leexinc.hrl", 0).
%% The source of this file is part of leex distribution, as such it
%% has the same Copyright as the other files in the leex
%% distribution. The Copyright is defined in the accompanying file
%% COPYRIGHT. However, the resultant scanner generated by leex is the
%% property of the creator of the scanner and is not covered by that
%% Copyright.
-module(floki_selector_lexer).
-export([string/1,string/2,token/2,token/3,tokens/2,tokens/3]).
-export([format_error/1]).
%% User code. This is placed here to allow extra attributes.
-file("src/floki_selector_lexer.xrl", 28).
remove_quotes(Chars) ->
Len = string:len(Chars),
string:substr(Chars, 2, Len - 2).
tail([_|T]) ->
T.
-file("/usr/local/Cellar/erlang/18.0.2/lib/erlang/lib/parsetools-2.1/include/leexinc.hrl", 14).
format_error({illegal,S}) -> ["illegal characters ",io_lib:write_string(S)];
format_error({user,S}) -> S.
string(String) -> string(String, 1).
string(String, Line) -> string(String, Line, String, []).
%% string(InChars, Line, TokenChars, Tokens) ->
%% {ok,Tokens,Line} | {error,ErrorInfo,Line}.
%% Note the line number going into yystate, L0, is line of token
%% start while line number returned is line of token end. We want line
%% of token start.
string([], L, [], Ts) -> % No partial tokens!
{ok,yyrev(Ts),L};
string(Ics0, L0, Tcs, Ts) ->
case yystate(yystate(), Ics0, L0, 0, reject, 0) of
{A,Alen,Ics1,L1} -> % Accepting end state
string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts);
{A,Alen,Ics1,L1,_S1} -> % Accepting transistion state
string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts);
{reject,_Alen,Tlen,_Ics1,L1,_S1} -> % After a non-accepting state
{error,{L0,?MODULE,{illegal,yypre(Tcs, Tlen+1)}},L1};
{A,Alen,_Tlen,_Ics1,_L1,_S1} ->
string_cont(yysuf(Tcs, Alen), L0, yyaction(A, Alen, Tcs, L0), Ts)
end.
%% string_cont(RestChars, Line, Token, Tokens)
%% Test for and remove the end token wrapper. Push back characters
%% are prepended to RestChars.
-dialyzer({nowarn_function, string_cont/4}).
string_cont(Rest, Line, {token,T}, Ts) ->
string(Rest, Line, Rest, [T|Ts]);
string_cont(Rest, Line, {token,T,Push}, Ts) ->
NewRest = Push ++ Rest,
string(NewRest, Line, NewRest, [T|Ts]);
string_cont(Rest, Line, {end_token,T}, Ts) ->
string(Rest, Line, Rest, [T|Ts]);
string_cont(Rest, Line, {end_token,T,Push}, Ts) ->
NewRest = Push ++ Rest,
string(NewRest, Line, NewRest, [T|Ts]);
string_cont(Rest, Line, skip_token, Ts) ->
string(Rest, Line, Rest, Ts);
string_cont(Rest, Line, {skip_token,Push}, Ts) ->
NewRest = Push ++ Rest,
string(NewRest, Line, NewRest, Ts);
string_cont(_Rest, Line, {error,S}, _Ts) ->
{error,{Line,?MODULE,{user,S}},Line}.
%% token(Continuation, Chars) ->
%% token(Continuation, Chars, Line) ->
%% {more,Continuation} | {done,ReturnVal,RestChars}.
%% Must be careful when re-entering to append the latest characters to the
%% after characters in an accept. The continuation is:
%% {token,State,CurrLine,TokenChars,TokenLen,TokenLine,AccAction,AccLen}
token(Cont, Chars) -> token(Cont, Chars, 1).
token([], Chars, Line) ->
token(yystate(), Chars, Line, Chars, 0, Line, reject, 0);
token({token,State,Line,Tcs,Tlen,Tline,Action,Alen}, Chars, _) ->
token(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Action, Alen).
%% token(State, InChars, Line, TokenChars, TokenLen, TokenLine,
%% AcceptAction, AcceptLen) ->
%% {more,Continuation} | {done,ReturnVal,RestChars}.
%% The argument order is chosen to be more efficient.
token(S0, Ics0, L0, Tcs, Tlen0, Tline, A0, Alen0) ->
case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of
%% Accepting end state, we have a token.
{A1,Alen1,Ics1,L1} ->
token_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline));
%% Accepting transition state, can take more chars.
{A1,Alen1,[],L1,S1} -> % Need more chars to check
{more,{token,S1,L1,Tcs,Alen1,Tline,A1,Alen1}};
{A1,Alen1,Ics1,L1,_S1} -> % Take what we got
token_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline));
%% After a non-accepting state, maybe reach accept state later.
{A1,Alen1,Tlen1,[],L1,S1} -> % Need more chars to check
{more,{token,S1,L1,Tcs,Tlen1,Tline,A1,Alen1}};
{reject,_Alen1,Tlen1,eof,L1,_S1} -> % No token match
%% Check for partial token which is error.
Ret = if Tlen1 > 0 -> {error,{Tline,?MODULE,
%% Skip eof tail in Tcs.
{illegal,yypre(Tcs, Tlen1)}},L1};
true -> {eof,L1}
end,
{done,Ret,eof};
{reject,_Alen1,Tlen1,Ics1,L1,_S1} -> % No token match
Error = {Tline,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}},
{done,{error,Error,L1},Ics1};
{A1,Alen1,_Tlen1,_Ics1,_L1,_S1} -> % Use last accept match
token_cont(yysuf(Tcs, Alen1), L0, yyaction(A1, Alen1, Tcs, Tline))
end.
%% token_cont(RestChars, Line, Token)
%% If we have a token or error then return done, else if we have a
%% skip_token then continue.
-dialyzer({nowarn_function, token_cont/3}).
token_cont(Rest, Line, {token,T}) ->
{done,{ok,T,Line},Rest};
token_cont(Rest, Line, {token,T,Push}) ->
NewRest = Push ++ Rest,
{done,{ok,T,Line},NewRest};
token_cont(Rest, Line, {end_token,T}) ->
{done,{ok,T,Line},Rest};
token_cont(Rest, Line, {end_token,T,Push}) ->
NewRest = Push ++ Rest,
{done,{ok,T,Line},NewRest};
token_cont(Rest, Line, skip_token) ->
token(yystate(), Rest, Line, Rest, 0, Line, reject, 0);
token_cont(Rest, Line, {skip_token,Push}) ->
NewRest = Push ++ Rest,
token(yystate(), NewRest, Line, NewRest, 0, Line, reject, 0);
token_cont(Rest, Line, {error,S}) ->
{done,{error,{Line,?MODULE,{user,S}},Line},Rest}.
%% tokens(Continuation, Chars, Line) ->
%% {more,Continuation} | {done,ReturnVal,RestChars}.
%% Must be careful when re-entering to append the latest characters to the
%% after characters in an accept. The continuation is:
%% {tokens,State,CurrLine,TokenChars,TokenLen,TokenLine,Tokens,AccAction,AccLen}
%% {skip_tokens,State,CurrLine,TokenChars,TokenLen,TokenLine,Error,AccAction,AccLen}
tokens(Cont, Chars) -> tokens(Cont, Chars, 1).
tokens([], Chars, Line) ->
tokens(yystate(), Chars, Line, Chars, 0, Line, [], reject, 0);
tokens({tokens,State,Line,Tcs,Tlen,Tline,Ts,Action,Alen}, Chars, _) ->
tokens(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Ts, Action, Alen);
tokens({skip_tokens,State,Line,Tcs,Tlen,Tline,Error,Action,Alen}, Chars, _) ->
skip_tokens(State, Chars, Line, Tcs ++ Chars, Tlen, Tline, Error, Action, Alen).
%% tokens(State, InChars, Line, TokenChars, TokenLen, TokenLine, Tokens,
%% AcceptAction, AcceptLen) ->
%% {more,Continuation} | {done,ReturnVal,RestChars}.
tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Ts, A0, Alen0) ->
case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of
%% Accepting end state, we have a token.
{A1,Alen1,Ics1,L1} ->
tokens_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Ts);
%% Accepting transition state, can take more chars.
{A1,Alen1,[],L1,S1} -> % Need more chars to check
{more,{tokens,S1,L1,Tcs,Alen1,Tline,Ts,A1,Alen1}};
{A1,Alen1,Ics1,L1,_S1} -> % Take what we got
tokens_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Ts);
%% After a non-accepting state, maybe reach accept state later.
{A1,Alen1,Tlen1,[],L1,S1} -> % Need more chars to check
{more,{tokens,S1,L1,Tcs,Tlen1,Tline,Ts,A1,Alen1}};
{reject,_Alen1,Tlen1,eof,L1,_S1} -> % No token match
%% Check for partial token which is error, no need to skip here.
Ret = if Tlen1 > 0 -> {error,{Tline,?MODULE,
%% Skip eof tail in Tcs.
{illegal,yypre(Tcs, Tlen1)}},L1};
Ts == [] -> {eof,L1};
true -> {ok,yyrev(Ts),L1}
end,
{done,Ret,eof};
{reject,_Alen1,Tlen1,_Ics1,L1,_S1} ->
%% Skip rest of tokens.
Error = {L1,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}},
skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error);
{A1,Alen1,_Tlen1,_Ics1,_L1,_S1} ->
Token = yyaction(A1, Alen1, Tcs, Tline),
tokens_cont(yysuf(Tcs, Alen1), L0, Token, Ts)
end.
%% tokens_cont(RestChars, Line, Token, Tokens)
%% If we have an end_token or error then return done, else if we have
%% a token then save it and continue, else if we have a skip_token
%% just continue.
-dialyzer({nowarn_function, tokens_cont/4}).
tokens_cont(Rest, Line, {token,T}, Ts) ->
tokens(yystate(), Rest, Line, Rest, 0, Line, [T|Ts], reject, 0);
tokens_cont(Rest, Line, {token,T,Push}, Ts) ->
NewRest = Push ++ Rest,
tokens(yystate(), NewRest, Line, NewRest, 0, Line, [T|Ts], reject, 0);
tokens_cont(Rest, Line, {end_token,T}, Ts) ->
{done,{ok,yyrev(Ts, [T]),Line},Rest};
tokens_cont(Rest, Line, {end_token,T,Push}, Ts) ->
NewRest = Push ++ Rest,
{done,{ok,yyrev(Ts, [T]),Line},NewRest};
tokens_cont(Rest, Line, skip_token, Ts) ->
tokens(yystate(), Rest, Line, Rest, 0, Line, Ts, reject, 0);
tokens_cont(Rest, Line, {skip_token,Push}, Ts) ->
NewRest = Push ++ Rest,
tokens(yystate(), NewRest, Line, NewRest, 0, Line, Ts, reject, 0);
tokens_cont(Rest, Line, {error,S}, _Ts) ->
skip_tokens(Rest, Line, {Line,?MODULE,{user,S}}).
%%skip_tokens(InChars, Line, Error) -> {done,{error,Error,Line},Ics}.
%% Skip tokens until an end token, junk everything and return the error.
skip_tokens(Ics, Line, Error) ->
skip_tokens(yystate(), Ics, Line, Ics, 0, Line, Error, reject, 0).
%% skip_tokens(State, InChars, Line, TokenChars, TokenLen, TokenLine, Tokens,
%% AcceptAction, AcceptLen) ->
%% {more,Continuation} | {done,ReturnVal,RestChars}.
skip_tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Error, A0, Alen0) ->
case yystate(S0, Ics0, L0, Tlen0, A0, Alen0) of
{A1,Alen1,Ics1,L1} -> % Accepting end state
skip_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Error);
{A1,Alen1,[],L1,S1} -> % After an accepting state
{more,{skip_tokens,S1,L1,Tcs,Alen1,Tline,Error,A1,Alen1}};
{A1,Alen1,Ics1,L1,_S1} ->
skip_cont(Ics1, L1, yyaction(A1, Alen1, Tcs, Tline), Error);
{A1,Alen1,Tlen1,[],L1,S1} -> % After a non-accepting state
{more,{skip_tokens,S1,L1,Tcs,Tlen1,Tline,Error,A1,Alen1}};
{reject,_Alen1,_Tlen1,eof,L1,_S1} ->
{done,{error,Error,L1},eof};
{reject,_Alen1,Tlen1,_Ics1,L1,_S1} ->
skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error);
{A1,Alen1,_Tlen1,_Ics1,L1,_S1} ->
Token = yyaction(A1, Alen1, Tcs, Tline),
skip_cont(yysuf(Tcs, Alen1), L1, Token, Error)
end.
%% skip_cont(RestChars, Line, Token, Error)
%% Skip tokens until we have an end_token or error then return done
%% with the original rror.
-dialyzer({nowarn_function, skip_cont/4}).
skip_cont(Rest, Line, {token,_T}, Error) ->
skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0);
skip_cont(Rest, Line, {token,_T,Push}, Error) ->
NewRest = Push ++ Rest,
skip_tokens(yystate(), NewRest, Line, NewRest, 0, Line, Error, reject, 0);
skip_cont(Rest, Line, {end_token,_T}, Error) ->
{done,{error,Error,Line},Rest};
skip_cont(Rest, Line, {end_token,_T,Push}, Error) ->
NewRest = Push ++ Rest,
{done,{error,Error,Line},NewRest};
skip_cont(Rest, Line, skip_token, Error) ->
skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0);
skip_cont(Rest, Line, {skip_token,Push}, Error) ->
NewRest = Push ++ Rest,
skip_tokens(yystate(), NewRest, Line, NewRest, 0, Line, Error, reject, 0);
skip_cont(Rest, Line, {error,_S}, Error) ->
skip_tokens(yystate(), Rest, Line, Rest, 0, Line, Error, reject, 0).
yyrev(List) -> lists:reverse(List).
yyrev(List, Tail) -> lists:reverse(List, Tail).
yypre(List, N) -> lists:sublist(List, N).
yysuf(List, N) -> lists:nthtail(N, List).
%% yystate() -> InitialState.
%% yystate(State, InChars, Line, CurrTokLen, AcceptAction, AcceptLen) ->
%% {Action, AcceptLen, RestChars, Line} |
%% {Action, AcceptLen, RestChars, Line, State} |
%% {reject, AcceptLen, CurrTokLen, RestChars, Line, State} |
%% {Action, AcceptLen, CurrTokLen, RestChars, Line, State}.
%% Generated state transition functions. The non-accepting end state
%% return signal either an unrecognised character or end of current
%% input.
-file("src/floki_selector_lexer.erl", 291).
yystate() -> 25.
yystate(28, [39|Ics], Line, Tlen, _, _) ->
yystate(24, Ics, Line, Tlen+1, 15, Tlen);
yystate(28, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
yystate(20, Ics, Line, Tlen+1, 15, Tlen);
yystate(28, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 38 ->
yystate(20, Ics, Line, Tlen+1, 15, Tlen);
yystate(28, [C|Ics], Line, Tlen, _, _) when C >= 40 ->
yystate(20, Ics, Line, Tlen+1, 15, Tlen);
yystate(28, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,28};
yystate(27, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line};
yystate(26, Ics, Line, Tlen, _, _) ->
{9,Tlen,Ics,Line};
yystate(25, [126|Ics], Line, Tlen, Action, Alen) ->
yystate(21, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [125|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [124|Ics], Line, Tlen, Action, Alen) ->
yystate(13, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [123|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [96|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [95|Ics], Line, Tlen, Action, Alen) ->
yystate(18, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [94|Ics], Line, Tlen, Action, Alen) ->
yystate(5, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [93|Ics], Line, Tlen, Action, Alen) ->
yystate(2, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [92|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [91|Ics], Line, Tlen, Action, Alen) ->
yystate(2, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [63|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [64|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [62|Ics], Line, Tlen, Action, Alen) ->
yystate(11, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [61|Ics], Line, Tlen, Action, Alen) ->
yystate(6, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [47|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [46|Ics], Line, Tlen, Action, Alen) ->
yystate(10, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [45|Ics], Line, Tlen, Action, Alen) ->
yystate(18, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [44|Ics], Line, Tlen, Action, Alen) ->
yystate(15, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [43|Ics], Line, Tlen, Action, Alen) ->
yystate(19, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [42|Ics], Line, Tlen, Action, Alen) ->
yystate(22, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [40|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [41|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [39|Ics], Line, Tlen, Action, Alen) ->
yystate(28, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [37|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [38|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [36|Ics], Line, Tlen, Action, Alen) ->
yystate(16, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [35|Ics], Line, Tlen, Action, Alen) ->
yystate(8, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [34|Ics], Line, Tlen, Action, Alen) ->
yystate(0, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [33|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [32|Ics], Line, Tlen, Action, Alen) ->
yystate(23, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [12|Ics], Line, Tlen, Action, Alen) ->
yystate(23, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [13|Ics], Line, Tlen, Action, Alen) ->
yystate(23, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [11|Ics], Line, Tlen, Action, Alen) ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [10|Ics], Line, Tlen, Action, Alen) ->
yystate(23, Ics, Line+1, Tlen+1, Action, Alen);
yystate(25, [9|Ics], Line, Tlen, Action, Alen) ->
yystate(23, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 8 ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 14, C =< 31 ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 48, C =< 57 ->
yystate(18, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 58, C =< 60 ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 65, C =< 90 ->
yystate(18, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 97, C =< 122 ->
yystate(18, Ics, Line, Tlen+1, Action, Alen);
yystate(25, [C|Ics], Line, Tlen, Action, Alen) when C >= 127 ->
yystate(27, Ics, Line, Tlen+1, Action, Alen);
yystate(25, Ics, Line, Tlen, Action, Alen) ->
{Action,Alen,Tlen,Ics,Line,25};
yystate(24, [39|Ics], Line, Tlen, _, _) ->
yystate(24, Ics, Line, Tlen+1, 1, Tlen);
yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
yystate(20, Ics, Line, Tlen+1, 1, Tlen);
yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 38 ->
yystate(20, Ics, Line, Tlen+1, 1, Tlen);
yystate(24, [C|Ics], Line, Tlen, _, _) when C >= 40 ->
yystate(20, Ics, Line, Tlen+1, 1, Tlen);
yystate(24, Ics, Line, Tlen, _, _) ->
{1,Tlen,Ics,Line,24};
yystate(23, [62|Ics], Line, Tlen, _, _) ->
yystate(11, Ics, Line, Tlen+1, 14, Tlen);
yystate(23, [44|Ics], Line, Tlen, _, _) ->
yystate(15, Ics, Line, Tlen+1, 14, Tlen);
yystate(23, [43|Ics], Line, Tlen, _, _) ->
yystate(19, Ics, Line, Tlen+1, 14, Tlen);
yystate(23, [32|Ics], Line, Tlen, _, _) ->
yystate(23, Ics, Line, Tlen+1, 14, Tlen);
yystate(23, [12|Ics], Line, Tlen, _, _) ->
yystate(23, Ics, Line, Tlen+1, 14, Tlen);
yystate(23, [13|Ics], Line, Tlen, _, _) ->
yystate(23, Ics, Line, Tlen+1, 14, Tlen);
yystate(23, [9|Ics], Line, Tlen, _, _) ->
yystate(23, Ics, Line, Tlen+1, 14, Tlen);
yystate(23, [10|Ics], Line, Tlen, _, _) ->
yystate(23, Ics, Line+1, Tlen+1, 14, Tlen);
yystate(23, Ics, Line, Tlen, _, _) ->
{14,Tlen,Ics,Line,23};
yystate(22, [61|Ics], Line, Tlen, _, _) ->
yystate(26, Ics, Line, Tlen+1, 2, Tlen);
yystate(22, Ics, Line, Tlen, _, _) ->
{2,Tlen,Ics,Line,22};
yystate(21, [61|Ics], Line, Tlen, _, _) ->
yystate(17, Ics, Line, Tlen+1, 15, Tlen);
yystate(21, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,21};
yystate(20, [39|Ics], Line, Tlen, Action, Alen) ->
yystate(24, Ics, Line, Tlen+1, Action, Alen);
yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 ->
yystate(20, Ics, Line, Tlen+1, Action, Alen);
yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 38 ->
yystate(20, Ics, Line, Tlen+1, Action, Alen);
yystate(20, [C|Ics], Line, Tlen, Action, Alen) when C >= 40 ->
yystate(20, Ics, Line, Tlen+1, Action, Alen);
yystate(20, Ics, Line, Tlen, Action, Alen) ->
{Action,Alen,Tlen,Ics,Line,20};
yystate(19, [32|Ics], Line, Tlen, _, _) ->
yystate(19, Ics, Line, Tlen+1, 13, Tlen);
yystate(19, [12|Ics], Line, Tlen, _, _) ->
yystate(19, Ics, Line, Tlen+1, 13, Tlen);
yystate(19, [13|Ics], Line, Tlen, _, _) ->
yystate(19, Ics, Line, Tlen+1, 13, Tlen);
yystate(19, [9|Ics], Line, Tlen, _, _) ->
yystate(19, Ics, Line, Tlen+1, 13, Tlen);
yystate(19, [10|Ics], Line, Tlen, _, _) ->
yystate(19, Ics, Line+1, Tlen+1, 13, Tlen);
yystate(19, Ics, Line, Tlen, _, _) ->
{13,Tlen,Ics,Line,19};
yystate(18, [95|Ics], Line, Tlen, _, _) ->
yystate(18, Ics, Line, Tlen+1, 0, Tlen);
yystate(18, [45|Ics], Line, Tlen, _, _) ->
yystate(18, Ics, Line, Tlen+1, 0, Tlen);
yystate(18, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
yystate(18, Ics, Line, Tlen+1, 0, Tlen);
yystate(18, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
yystate(18, Ics, Line, Tlen+1, 0, Tlen);
yystate(18, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
yystate(18, Ics, Line, Tlen+1, 0, Tlen);
yystate(18, Ics, Line, Tlen, _, _) ->
{0,Tlen,Ics,Line,18};
yystate(17, Ics, Line, Tlen, _, _) ->
{5,Tlen,Ics,Line};
yystate(16, [61|Ics], Line, Tlen, _, _) ->
yystate(12, Ics, Line, Tlen+1, 15, Tlen);
yystate(16, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,16};
yystate(15, Ics, Line, Tlen, _, _) ->
{11,Tlen,Ics,Line};
yystate(14, [95|Ics], Line, Tlen, _, _) ->
yystate(14, Ics, Line, Tlen+1, 4, Tlen);
yystate(14, [45|Ics], Line, Tlen, _, _) ->
yystate(14, Ics, Line, Tlen+1, 4, Tlen);
yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
yystate(14, Ics, Line, Tlen+1, 4, Tlen);
yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
yystate(14, Ics, Line, Tlen+1, 4, Tlen);
yystate(14, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
yystate(14, Ics, Line, Tlen+1, 4, Tlen);
yystate(14, Ics, Line, Tlen, _, _) ->
{4,Tlen,Ics,Line,14};
yystate(13, [61|Ics], Line, Tlen, _, _) ->
yystate(9, Ics, Line, Tlen+1, 15, Tlen);
yystate(13, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,13};
yystate(12, Ics, Line, Tlen, _, _) ->
{8,Tlen,Ics,Line};
yystate(11, [32|Ics], Line, Tlen, _, _) ->
yystate(11, Ics, Line, Tlen+1, 12, Tlen);
yystate(11, [12|Ics], Line, Tlen, _, _) ->
yystate(11, Ics, Line, Tlen+1, 12, Tlen);
yystate(11, [13|Ics], Line, Tlen, _, _) ->
yystate(11, Ics, Line, Tlen+1, 12, Tlen);
yystate(11, [9|Ics], Line, Tlen, _, _) ->
yystate(11, Ics, Line, Tlen+1, 12, Tlen);
yystate(11, [10|Ics], Line, Tlen, _, _) ->
yystate(11, Ics, Line+1, Tlen+1, 12, Tlen);
yystate(11, Ics, Line, Tlen, _, _) ->
{12,Tlen,Ics,Line,11};
yystate(10, [95|Ics], Line, Tlen, _, _) ->
yystate(14, Ics, Line, Tlen+1, 15, Tlen);
yystate(10, [45|Ics], Line, Tlen, _, _) ->
yystate(14, Ics, Line, Tlen+1, 15, Tlen);
yystate(10, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
yystate(14, Ics, Line, Tlen+1, 15, Tlen);
yystate(10, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
yystate(14, Ics, Line, Tlen+1, 15, Tlen);
yystate(10, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
yystate(14, Ics, Line, Tlen+1, 15, Tlen);
yystate(10, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,10};
yystate(9, Ics, Line, Tlen, _, _) ->
{6,Tlen,Ics,Line};
yystate(8, [95|Ics], Line, Tlen, _, _) ->
yystate(4, Ics, Line, Tlen+1, 15, Tlen);
yystate(8, [45|Ics], Line, Tlen, _, _) ->
yystate(4, Ics, Line, Tlen+1, 15, Tlen);
yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
yystate(4, Ics, Line, Tlen+1, 15, Tlen);
yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
yystate(4, Ics, Line, Tlen+1, 15, Tlen);
yystate(8, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
yystate(4, Ics, Line, Tlen+1, 15, Tlen);
yystate(8, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,8};
yystate(7, [34|Ics], Line, Tlen, Action, Alen) ->
yystate(3, Ics, Line, Tlen+1, Action, Alen);
yystate(7, [C|Ics], Line, Tlen, Action, Alen) when C >= 0, C =< 9 ->
yystate(7, Ics, Line, Tlen+1, Action, Alen);
yystate(7, [C|Ics], Line, Tlen, Action, Alen) when C >= 11, C =< 33 ->
yystate(7, Ics, Line, Tlen+1, Action, Alen);
yystate(7, [C|Ics], Line, Tlen, Action, Alen) when C >= 35 ->
yystate(7, Ics, Line, Tlen+1, Action, Alen);
yystate(7, Ics, Line, Tlen, Action, Alen) ->
{Action,Alen,Tlen,Ics,Line,7};
yystate(6, Ics, Line, Tlen, _, _) ->
{10,Tlen,Ics,Line};
yystate(5, [61|Ics], Line, Tlen, _, _) ->
yystate(1, Ics, Line, Tlen+1, 15, Tlen);
yystate(5, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,5};
yystate(4, [95|Ics], Line, Tlen, _, _) ->
yystate(4, Ics, Line, Tlen+1, 3, Tlen);
yystate(4, [45|Ics], Line, Tlen, _, _) ->
yystate(4, Ics, Line, Tlen+1, 3, Tlen);
yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 48, C =< 57 ->
yystate(4, Ics, Line, Tlen+1, 3, Tlen);
yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 65, C =< 90 ->
yystate(4, Ics, Line, Tlen+1, 3, Tlen);
yystate(4, [C|Ics], Line, Tlen, _, _) when C >= 97, C =< 122 ->
yystate(4, Ics, Line, Tlen+1, 3, Tlen);
yystate(4, Ics, Line, Tlen, _, _) ->
{3,Tlen,Ics,Line,4};
yystate(3, [34|Ics], Line, Tlen, _, _) ->
yystate(3, Ics, Line, Tlen+1, 1, Tlen);
yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
yystate(7, Ics, Line, Tlen+1, 1, Tlen);
yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 33 ->
yystate(7, Ics, Line, Tlen+1, 1, Tlen);
yystate(3, [C|Ics], Line, Tlen, _, _) when C >= 35 ->
yystate(7, Ics, Line, Tlen+1, 1, Tlen);
yystate(3, Ics, Line, Tlen, _, _) ->
{1,Tlen,Ics,Line,3};
yystate(2, Ics, Line, Tlen, _, _) ->
{2,Tlen,Ics,Line};
yystate(1, Ics, Line, Tlen, _, _) ->
{7,Tlen,Ics,Line};
yystate(0, [34|Ics], Line, Tlen, _, _) ->
yystate(3, Ics, Line, Tlen+1, 15, Tlen);
yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 0, C =< 9 ->
yystate(7, Ics, Line, Tlen+1, 15, Tlen);
yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 11, C =< 33 ->
yystate(7, Ics, Line, Tlen+1, 15, Tlen);
yystate(0, [C|Ics], Line, Tlen, _, _) when C >= 35 ->
yystate(7, Ics, Line, Tlen+1, 15, Tlen);
yystate(0, Ics, Line, Tlen, _, _) ->
{15,Tlen,Ics,Line,0};
yystate(S, Ics, Line, Tlen, Action, Alen) ->
{Action,Alen,Tlen,Ics,Line,S}.
%% yyaction(Action, TokenLength, TokenChars, TokenLine) ->
%% {token,Token} | {end_token, Token} | skip_token | {error,String}.
%% Generated action function.
yyaction(0, TokenLen, YYtcs, TokenLine) ->
TokenChars = yypre(YYtcs, TokenLen),
yyaction_0(TokenChars, TokenLine);
yyaction(1, TokenLen, YYtcs, TokenLine) ->
TokenChars = yypre(YYtcs, TokenLen),
yyaction_1(TokenChars, TokenLine);
yyaction(2, TokenLen, YYtcs, TokenLine) ->
TokenChars = yypre(YYtcs, TokenLen),
yyaction_2(TokenChars, TokenLine);
yyaction(3, TokenLen, YYtcs, TokenLine) ->
TokenChars = yypre(YYtcs, TokenLen),
yyaction_3(TokenChars, TokenLine);
yyaction(4, TokenLen, YYtcs, TokenLine) ->
TokenChars = yypre(YYtcs, TokenLen),
yyaction_4(TokenChars, TokenLine);
yyaction(5, _, _, TokenLine) ->
yyaction_5(TokenLine);
yyaction(6, _, _, TokenLine) ->
yyaction_6(TokenLine);
yyaction(7, _, _, TokenLine) ->
yyaction_7(TokenLine);
yyaction(8, _, _, TokenLine) ->
yyaction_8(TokenLine);
yyaction(9, _, _, TokenLine) ->
yyaction_9(TokenLine);
yyaction(10, _, _, TokenLine) ->
yyaction_10(TokenLine);
yyaction(11, _, _, TokenLine) ->
yyaction_11(TokenLine);
yyaction(12, _, _, TokenLine) ->
yyaction_12(TokenLine);
yyaction(13, _, _, TokenLine) ->
yyaction_13(TokenLine);
yyaction(14, _, _, TokenLine) ->
yyaction_14(TokenLine);
yyaction(15, TokenLen, YYtcs, TokenLine) ->
TokenChars = yypre(YYtcs, TokenLen),
yyaction_15(TokenChars, TokenLine);
yyaction(_, _, _, _) -> error.
-compile({inline,yyaction_0/2}).
-file("src/floki_selector_lexer.xrl", 8).
yyaction_0(TokenChars, TokenLine) ->
{ token, { identifier, TokenLine, TokenChars } } .
-compile({inline,yyaction_1/2}).
-file("src/floki_selector_lexer.xrl", 9).
yyaction_1(TokenChars, TokenLine) ->
{ token, { quoted, TokenLine, remove_quotes (TokenChars) } } .
-compile({inline,yyaction_2/2}).
-file("src/floki_selector_lexer.xrl", 10).
yyaction_2(TokenChars, TokenLine) ->
{ token, { TokenChars, TokenLine } } .
-compile({inline,yyaction_3/2}).
-file("src/floki_selector_lexer.xrl", 11).
yyaction_3(TokenChars, TokenLine) ->
{ token, { hash, TokenLine, tail (TokenChars) } } .
-compile({inline,yyaction_4/2}).
-file("src/floki_selector_lexer.xrl", 12).
yyaction_4(TokenChars, TokenLine) ->
{ token, { class, TokenLine, tail (TokenChars) } } .
-compile({inline,yyaction_5/1}).
-file("src/floki_selector_lexer.xrl", 13).
yyaction_5(TokenLine) ->
{ token, { includes, TokenLine } } .
-compile({inline,yyaction_6/1}).
-file("src/floki_selector_lexer.xrl", 14).
yyaction_6(TokenLine) ->
{ token, { dash_match, TokenLine } } .
-compile({inline,yyaction_7/1}).
-file("src/floki_selector_lexer.xrl", 15).
yyaction_7(TokenLine) ->
{ token, { prefix_match, TokenLine } } .
-compile({inline,yyaction_8/1}).
-file("src/floki_selector_lexer.xrl", 16).
yyaction_8(TokenLine) ->
{ token, { sufix_match, TokenLine } } .
-compile({inline,yyaction_9/1}).
-file("src/floki_selector_lexer.xrl", 17).
yyaction_9(TokenLine) ->
{ token, { substring_match, TokenLine } } .
-compile({inline,yyaction_10/1}).
-file("src/floki_selector_lexer.xrl", 18).
yyaction_10(TokenLine) ->
{ token, { equal, TokenLine } } .
-compile({inline,yyaction_11/1}).
-file("src/floki_selector_lexer.xrl", 19).
yyaction_11(TokenLine) ->
{ token, { comma, TokenLine } } .
-compile({inline,yyaction_12/1}).
-file("src/floki_selector_lexer.xrl", 20).
yyaction_12(TokenLine) ->
{ token, { greater, TokenLine } } .
-compile({inline,yyaction_13/1}).
-file("src/floki_selector_lexer.xrl", 21).
yyaction_13(TokenLine) ->
{ token, { plus, TokenLine } } .
-compile({inline,yyaction_14/1}).
-file("src/floki_selector_lexer.xrl", 22).
yyaction_14(TokenLine) ->
{ token, { space, TokenLine } } .
-compile({inline,yyaction_15/2}).
-file("src/floki_selector_lexer.xrl", 23).
yyaction_15(TokenChars, TokenLine) ->
{ token, { unknown, TokenLine, TokenChars } } .
-file("/usr/local/Cellar/erlang/18.0.2/lib/erlang/lib/parsetools-2.1/include/leexinc.hrl", 290).