-file("leexinc.hrl", 0). %% %% %CopyrightBegin% %% %% SPDX-License-Identifier: BSD-2-Clause %% %% Copyright (c) 2008,2009 Robert Virding. All rights reserved. %% Copyright Ericsson AB 2009-2025. All Rights Reserved. %% %% Redistribution and use in source and binary forms, with or without %% modification, are permitted provided that the following conditions %% are met: %% %% 1. Redistributions of source code must retain the above copyright %% notice, this list of conditions and the following disclaimer. %% 2. Redistributions in binary form must reproduce the above copyright %% notice, this list of conditions and the following disclaimer in the %% documentation and/or other materials provided with the distribution. %% %% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS %% "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT %% LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS %% FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE %% COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, %% INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, %% BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; %% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER %% CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT %% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN %% ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE %% POSSIBILITY OF SUCH DAMAGE. %% %% %CopyrightEnd% %% %% 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. However, the resultant scanner generated by leex is the %% property of the creator of the scanner and is not covered by that %% Copyright. -module(rdmx_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("rdmx_lexer.xrl", 35). to_token(Tag, Loc) -> {token, {Tag, Loc}}. to_token(Tag, Loc, Chars, F) -> {token, {Tag, Loc, F(Chars)}}. unwrap_quoted(Tag, Loc, Chars, Len) -> Unquoted = unescape(lists:sublist(Chars, 2, Len - 2), Loc), to_binary_token(Tag, Loc, Unquoted). to_binary_token(Tag, Loc, Chars) -> to_token(Tag, Loc, Chars, fun 'Elixir.List':to_string/1). variable_name([$$|Chars]) -> list_to_binary(Chars). unescape(String, Loc) -> unescape(String, Loc, []). unescape([], _Loc, Output) -> lists:reverse(Output); unescape([$\\, Escaped | Rest], Loc, Output) -> Char = unescape_char(Escaped, Loc), unescape(Rest, Loc, [Char|Output]); unescape([Char|Rest], Loc, Output) -> unescape(Rest, Loc, [Char|Output]). unescape_char(Char, _Loc) -> case Char of $\" -> $\"; $\' -> $\'; $s -> $\s; $t -> $\t; $r -> $\r; $n -> $\n; $\\ -> $\\; _ -> Char % No escape end. -file("leexinc.hrl", 47). format_error({illegal,S}) -> ["illegal characters ",io_lib:write_string(S)]; format_error({user,S}) -> S. %% string(InChars) -> %% string(InChars, Loc) -> %% {ok,Tokens,EndLoc} | {error,ErrorInfo,EndLoc}. %% Loc is the starting location of the token, while EndLoc is the first not scanned %% location. Location is either Line or {Line,Column}, depending on the "error_location" option. string(Ics) -> string(Ics,{1,1}). string(Ics,{L0,C0}) -> string(Ics, L0, C0, Ics, []). string(Ics, L0, C0, Tcs, Ts) -> do_string(Ics, L0, C0, Tcs, Ts). do_string([], L, C, [], Ts) -> % No partial tokens! {ok,yyrev(Ts),{L,C}}; do_string(Ics0, L0, C0, Tcs, Ts) -> case yystate(yystate(), Ics0, L0, C0, 0, reject, 0) of {A,Alen,Ics1,L1,_C1} -> % Accepting end state C2 = adjust_col(Tcs, Alen, C0), string_cont(Ics1, L1, C2, yyaction(A, Alen, Tcs, L0, C0), Ts); {A,Alen,Ics1,L1,_C1,_S1} -> % Accepting transition state C2 = adjust_col(Tcs, Alen, C0), string_cont(Ics1, L1, C2, yyaction(A, Alen, Tcs, L0, C0), Ts); {reject,_Alen,Tlen,_Ics1,_L1,_C1,_S1} -> % After a non-accepting state {error,{{L0, C0} ,?MODULE,{illegal,yypre(Tcs, Tlen+1)}},{L0, C0}}; {A,Alen,Tlen,_Ics1,L1, C1,_S1}-> Tcs1 = yysuf(Tcs, Alen), L2 = adjust_line(Tlen, Alen, Tcs1, L1), C2 = adjust_col(Tcs, Alen, C1), string_cont(Tcs1, L2, C2, yyaction(A, Alen, Tcs, L0,C0), Ts) end. %% string_cont(RestChars, Line, Col, Token, Tokens) %% Test for and remove the end token wrapper. Push back characters %% are prepended to RestChars. -dialyzer({nowarn_function, string_cont/5}). string_cont(Rest, Line, Col, {token,T}, Ts) -> do_string(Rest, Line, Col, Rest, [T|Ts]); string_cont(Rest, Line, Col, {token,T,Push}, Ts) -> NewRest = Push ++ Rest, do_string(NewRest, Line, Col, NewRest, [T|Ts]); string_cont(Rest, Line, Col, {end_token,T}, Ts) -> do_string(Rest, Line, Col, Rest, [T|Ts]); string_cont(Rest, Line, Col, {end_token,T,Push}, Ts) -> NewRest = Push ++ Rest, do_string(NewRest, Line, Col, NewRest, [T|Ts]); string_cont(Rest, Line, Col, skip_token, Ts) -> do_string(Rest, Line, Col, Rest, Ts); string_cont(Rest, Line, Col, {skip_token,Push}, Ts) -> NewRest = Push ++ Rest, do_string(NewRest, Line, Col, NewRest, Ts); string_cont(_Rest, Line, Col, {error,S}, _Ts) -> {error,{{Line, Col},?MODULE,{user,S}},{Line,Col}}. %% token(Continuation, Chars) -> %% token(Continuation, Chars, Loc) -> %% {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,CurrCol,TokenChars,TokenLen,TokenLine,TokenCol,AccAction,AccLen} token(Cont,Chars) -> token(Cont,Chars,{1,1}). token(Cont, Chars, {Line,Col}) -> do_token(Cont,Chars,Line,Col). do_token([], Chars, Line, Col) -> token(yystate(), Chars, Line, Col, Chars, 0, Line, Col, reject, 0); do_token({token,State,Line,Col,Tcs,Tlen,Tline,Tcol,Action,Alen}, Chars, _, _) -> token(State, Chars, Line, Col, Tcs ++ Chars, Tlen, Tline, Tcol, Action, Alen). %% token(State, InChars, Line, Col, TokenChars, TokenLen, TokenLine, TokenCol %% AcceptAction, AcceptLen) -> %% {more,Continuation} | {done,ReturnVal,RestChars}. %% The argument order is chosen to be more efficient. token(S0, Ics0, L0, C0, Tcs, Tlen0, Tline, Tcol, A0, Alen0) -> case yystate(S0, Ics0, L0, C0, Tlen0, A0, Alen0) of %% Accepting end state, we have a token. {A1,Alen1,Ics1,L1,C1} -> C2 = adjust_col(Tcs, Alen1, C1), token_cont(Ics1, L1, C2, yyaction(A1, Alen1, Tcs, Tline,Tcol)); %% Accepting transition state, can take more chars. {A1,Alen1,[],L1,C1,S1} -> % Need more chars to check {more,{token,S1,L1,C1,Tcs,Alen1,Tline,Tcol,A1,Alen1}}; {A1,Alen1,Ics1,L1,C1,_S1} -> % Take what we got C2 = adjust_col(Tcs, Alen1, C1), token_cont(Ics1, L1, C2, yyaction(A1, Alen1, Tcs, Tline,Tcol)); %% After a non-accepting state, maybe reach accept state later. {A1,Alen1,Tlen1,[],L1,C1,S1} -> % Need more chars to check {more,{token,S1,L1,C1,Tcs,Tlen1,Tline,Tcol,A1,Alen1}}; {reject,_Alen1,Tlen1,eof,L1,C1,_S1} -> % No token match %% Check for partial token which is error. Ret = if Tlen1 > 0 -> {error,{{Tline,Tcol},?MODULE, %% Skip eof tail in Tcs. {illegal,yypre(Tcs, Tlen1)}},{L1,C1}}; true -> {eof,{L1,C1}} end, {done,Ret,eof}; {reject,_Alen1,Tlen1,Ics1,_L1,_C1,_S1} -> % No token match Error = {{Tline,Tcol},?MODULE,{illegal,yypre(Tcs, Tlen1+1)}}, {done,{error,Error,{Tline,Tcol}},Ics1}; {A1,Alen1,Tlen1,_Ics1,L1,_C1,_S1} -> % Use last accept match Tcs1 = yysuf(Tcs, Alen1), L2 = adjust_line(Tlen1, Alen1, Tcs1, L1), C2 = C0 + Alen1, token_cont(Tcs1, L2, C2, yyaction(A1, Alen1, Tcs, Tline, Tcol)) end. %% token_cont(RestChars, Line, Col, 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/4}). token_cont(Rest, Line, Col, {token,T}) -> {done,{ok,T,{Line,Col}},Rest}; token_cont(Rest, Line, Col, {token,T,Push}) -> NewRest = Push ++ Rest, {done,{ok,T,{Line,Col}},NewRest}; token_cont(Rest, Line, Col, {end_token,T}) -> {done,{ok,T,{Line,Col}},Rest}; token_cont(Rest, Line, Col, {end_token,T,Push}) -> NewRest = Push ++ Rest, {done,{ok,T,{Line,Col}},NewRest}; token_cont(Rest, Line, Col, skip_token) -> token(yystate(), Rest, Line, Col, Rest, 0, Line, Col, reject, 0); token_cont(Rest, Line, Col, {skip_token,Push}) -> NewRest = Push ++ Rest, token(yystate(), NewRest, Line, Col, NewRest, 0, Line, Col, reject, 0); token_cont(Rest, Line, Col, {error,S}) -> {done,{error,{{Line, Col},?MODULE,{user,S}},{Line, Col}},Rest}. %% tokens(Continuation, Chars) -> %% tokens(Continuation, Chars, Loc) -> %% {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,CurrCol,TokenChars,TokenLen,TokenLine,TokenCur,Tokens,AccAction,AccLen} %% {skip_tokens,State,CurrLine,CurrCol,TokenChars,TokenLen,TokenLine,TokenCur,Error,AccAction,AccLen} tokens(Cont,Chars) -> tokens(Cont,Chars,{1,1}). tokens(Cont, Chars, {Line,Col}) -> do_tokens(Cont,Chars,Line,Col). do_tokens([], Chars, Line, Col) -> tokens(yystate(), Chars, Line, Col, Chars, 0, Line, Col, [], reject, 0); do_tokens({tokens,State,Line,Col,Tcs,Tlen,Tline,Tcol,Ts,Action,Alen}, Chars, _,_) -> tokens(State, Chars, Line, Col, Tcs ++ Chars, Tlen, Tline, Tcol, Ts, Action, Alen); do_tokens({skip_tokens,State,Line, Col, Tcs,Tlen,Tline,Tcol,Error,Action,Alen}, Chars, _,_) -> skip_tokens(State, Chars, Line, Col, Tcs ++ Chars, Tlen, Tline, Tcol, Error, Action, Alen). %% tokens(State, InChars, Line, Col, TokenChars, TokenLen, TokenLine, TokenCol,Tokens, %% AcceptAction, AcceptLen) -> %% {more,Continuation} | {done,ReturnVal,RestChars}. tokens(S0, Ics0, L0, C0, Tcs, Tlen0, Tline, Tcol, Ts, A0, Alen0) -> case yystate(S0, Ics0, L0, C0, Tlen0, A0, Alen0) of %% Accepting end state, we have a token. {A1,Alen1,Ics1,L1,C1} -> C2 = adjust_col(Tcs, Alen1, C1), tokens_cont(Ics1, L1, C2, yyaction(A1, Alen1, Tcs, Tline, Tcol), Ts); %% Accepting transition state, can take more chars. {A1,Alen1,[],L1,C1,S1} -> % Need more chars to check {more,{tokens,S1,L1,C1,Tcs,Alen1,Tline,Tcol,Ts,A1,Alen1}}; {A1,Alen1,Ics1,L1,C1,_S1} -> % Take what we got C2 = adjust_col(Tcs, Alen1, C1), tokens_cont(Ics1, L1, C2, yyaction(A1, Alen1, Tcs, Tline,Tcol), Ts); %% After a non-accepting state, maybe reach accept state later. {A1,Alen1,Tlen1,[],L1,C1,S1} -> % Need more chars to check {more,{tokens,S1,L1,C1,Tcs,Tlen1,Tline,Tcol,Ts,A1,Alen1}}; {reject,_Alen1,Tlen1,eof,L1,C1,_S1} -> % No token match %% Check for partial token which is error, no need to skip here. Ret = if Tlen1 > 0 -> {error,{{Tline,Tcol},?MODULE, %% Skip eof tail in Tcs. {illegal,yypre(Tcs, Tlen1)}},{L1,C1}}; Ts == [] -> {eof,{L1,C1}}; true -> {ok,yyrev(Ts),{L1,C1}} end, {done,Ret,eof}; {reject,_Alen1,Tlen1,_Ics1,L1,C1,_S1} -> %% Skip rest of tokens. Error = {{L1,C1},?MODULE,{illegal,yypre(Tcs, Tlen1+1)}}, skip_tokens(yysuf(Tcs, Tlen1+1), L1, C1, Error); {A1,Alen1,Tlen1,_Ics1,L1,_C1,_S1} -> Token = yyaction(A1, Alen1, Tcs, Tline,Tcol), Tcs1 = yysuf(Tcs, Alen1), L2 = adjust_line(Tlen1, Alen1, Tcs1, L1), C2 = C0 + Alen1, tokens_cont(Tcs1, L2, C2, Token, Ts) end. %% tokens_cont(RestChars, Line, Column, 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/5}). tokens_cont(Rest, Line, Col, {token,T}, Ts) -> tokens(yystate(), Rest, Line, Col, Rest, 0, Line, Col, [T|Ts], reject, 0); tokens_cont(Rest, Line, Col, {token,T,Push}, Ts) -> NewRest = Push ++ Rest, tokens(yystate(), NewRest, Line, Col, NewRest, 0, Line, Col, [T|Ts], reject, 0); tokens_cont(Rest, Line, Col, {end_token,T}, Ts) -> {done,{ok,yyrev(Ts, [T]),{Line,Col}},Rest}; tokens_cont(Rest, Line, Col, {end_token,T,Push}, Ts) -> NewRest = Push ++ Rest, {done,{ok,yyrev(Ts, [T]),{Line, Col}},NewRest}; tokens_cont(Rest, Line, Col, skip_token, Ts) -> tokens(yystate(), Rest, Line, Col, Rest, 0, Line, Col, Ts, reject, 0); tokens_cont(Rest, Line, Col, {skip_token,Push}, Ts) -> NewRest = Push ++ Rest, tokens(yystate(), NewRest, Line, Col, NewRest, 0, Line, Col, Ts, reject, 0); tokens_cont(Rest, Line, Col, {error,S}, _Ts) -> skip_tokens(Rest, Line, Col, {{Line,Col},?MODULE,{user,S}}). %% skip_tokens(InChars, Line, Col, Error) -> {done,{error,Error,{Line,Col}},Ics}. %% Skip tokens until an end token, junk everything and return the error. skip_tokens(Ics, Line, Col, Error) -> skip_tokens(yystate(), Ics, Line, Col, Ics, 0, Line, Col, Error, reject, 0). %% skip_tokens(State, InChars, Line, Col, TokenChars, TokenLen, TokenLine, TokenCol, Tokens, %% AcceptAction, AcceptLen) -> %% {more,Continuation} | {done,ReturnVal,RestChars}. skip_tokens(S0, Ics0, L0, C0, Tcs, Tlen0, Tline, Tcol, Error, A0, Alen0) -> case yystate(S0, Ics0, L0, C0, Tlen0, A0, Alen0) of {A1,Alen1,Ics1,L1, C1} -> % Accepting end state skip_cont(Ics1, L1, C1, yyaction(A1, Alen1, Tcs, Tline, Tcol), Error); {A1,Alen1,[],L1,C1, S1} -> % After an accepting state {more,{skip_tokens,S1,L1,C1,Tcs,Alen1,Tline,Tcol,Error,A1,Alen1}}; {A1,Alen1,Ics1,L1,C1,_S1} -> skip_cont(Ics1, L1, C1, yyaction(A1, Alen1, Tcs, Tline, Tcol), Error); {A1,Alen1,Tlen1,[],L1,C1,S1} -> % After a non-accepting state {more,{skip_tokens,S1,L1,C1,Tcs,Tlen1,Tline,Tcol,Error,A1,Alen1}}; {reject,_Alen1,_Tlen1,eof,L1,C1,_S1} -> {done,{error,Error,{L1,C1}},eof}; {reject,_Alen1,Tlen1,_Ics1,L1,C1,_S1} -> skip_tokens(yysuf(Tcs, Tlen1+1), L1, C1,Error); {A1,Alen1,Tlen1,_Ics1,L1,C1,_S1} -> Token = yyaction(A1, Alen1, Tcs, Tline, Tcol), Tcs1 = yysuf(Tcs, Alen1), L2 = adjust_line(Tlen1, Alen1, Tcs1, L1), skip_cont(Tcs1, L2, C1, Token, Error) end. %% skip_cont(RestChars, Line, Col, Token, Error) %% Skip tokens until we have an end_token or error then return done %% with the original rror. -dialyzer({nowarn_function, skip_cont/5}). skip_cont(Rest, Line, Col, {token,_T}, Error) -> skip_tokens(yystate(), Rest, Line, Col, Rest, 0, Line, Col, Error, reject, 0); skip_cont(Rest, Line, Col, {token,_T,Push}, Error) -> NewRest = Push ++ Rest, skip_tokens(yystate(), NewRest, Line, Col, NewRest, 0, Line, Col, Error, reject, 0); skip_cont(Rest, Line, Col, {end_token,_T}, Error) -> {done,{error,Error,{Line,Col}},Rest}; skip_cont(Rest, Line, Col, {end_token,_T,Push}, Error) -> NewRest = Push ++ Rest, {done,{error,Error,{Line,Col}},NewRest}; skip_cont(Rest, Line, Col, skip_token, Error) -> skip_tokens(yystate(), Rest, Line, Col, Rest, 0, Line, Col, Error, reject, 0); skip_cont(Rest, Line, Col, {skip_token,Push}, Error) -> NewRest = Push ++ Rest, skip_tokens(yystate(), NewRest, Line, Col, NewRest, 0, Line, Col, Error, reject, 0); skip_cont(Rest, Line, Col, {error,_S}, Error) -> skip_tokens(yystate(), Rest, Line, Col, Rest, 0, Line, Col, Error, reject, 0). -compile({nowarn_unused_function, [yyrev/1, yyrev/2, yypre/2, yysuf/2]}). 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). %% adjust_line(TokenLength, AcceptLength, Chars, Line) -> NewLine %% Make sure that newlines in Chars are not counted twice. %% Line has been updated with respect to newlines in the prefix of %% Chars consisting of (TokenLength - AcceptLength) characters. -compile({nowarn_unused_function, adjust_line/4}). adjust_line(N, N, _Cs, L) -> L; adjust_line(T, A, [$\n|Cs], L) -> adjust_line(T-1, A, Cs, L-1); adjust_line(T, A, [_|Cs], L) -> adjust_line(T-1, A, Cs, L). %% adjust_col(Chars, AcceptLength, Col) -> NewCol %% Handle newlines, tabs and unicode chars. adjust_col(_, 0, Col) -> Col; adjust_col([$\n | R], L, _) -> adjust_col(R, L-1, 1); adjust_col([$\t | R], L, Col) -> adjust_col(R, L-1, tab_forward(Col)+1); adjust_col([C | R], L, Col) when C>=0 andalso C=< 16#7F -> adjust_col(R, L-1, Col+1); adjust_col([C | R], L, Col) when C>= 16#80 andalso C=< 16#7FF -> adjust_col(R, L-1, Col+2); adjust_col([C | R], L, Col) when C>= 16#800 andalso C=< 16#FFFF -> adjust_col(R, L-1, Col+3); adjust_col([C | R], L, Col) when C>= 16#10000 andalso C=< 16#10FFFF -> adjust_col(R, L-1, Col+4). tab_forward(C) -> D = C rem tab_size(), A = tab_size()-D, C+A. tab_size() -> 8. %% yystate() -> InitialState. %% yystate(State, InChars, Line, Col, CurrTokLen, AcceptAction, AcceptLen) -> %% {Action, AcceptLen, RestChars, Line, Col} | %% {Action, AcceptLen, RestChars, Line, Col, State} | %% {reject, AcceptLen, CurrTokLen, RestChars, Line, Col, State} | %% {Action, AcceptLen, CurrTokLen, RestChars, Line, Col, State}. %% Generated state transition functions. The non-accepting end state %% return signal either an unrecognised character or end of current %% input. -file("rdmx_lexer.erl", 411). yystate() -> 17. yystate(24, [97|Ics], Line, Col, Tlen, _, _) -> yystate(16, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(24, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(24, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(24, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(24, [C|Ics], Line, Col, Tlen, _, _) when C >= 98, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(24, Ics, Line, Col, Tlen, _, _) -> {6,Tlen,Ics,Line,Col,24}; yystate(23, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 48, C =< 57 -> yystate(19, Ics, Line, Col, Tlen+1, Action, Alen); yystate(23, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,23}; yystate(22, [95|Ics], Line, Col, Tlen, Action, Alen) -> yystate(14, Ics, Line, Col, Tlen+1, Action, Alen); yystate(22, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 65, C =< 90 -> yystate(14, Ics, Line, Col, Tlen+1, Action, Alen); yystate(22, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 97, C =< 122 -> yystate(14, Ics, Line, Col, Tlen+1, Action, Alen); yystate(22, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,22}; yystate(21, [32|Ics], Line, Col, Tlen, _, _) -> yystate(21, Ics, Line, Col, Tlen+1, 8, Tlen); yystate(21, [13|Ics], Line, Col, Tlen, _, _) -> yystate(21, Ics, Line, Col, Tlen+1, 8, Tlen); yystate(21, [9|Ics], Line, Col, Tlen, _, _) -> yystate(21, Ics, Line, Col, Tlen+1, 8, Tlen); yystate(21, [10|Ics], Line, _, Tlen, _, _) -> yystate(21, Ics, Line+1, 1, Tlen+1, 8, Tlen); yystate(21, Ics, Line, Col, Tlen, _, _) -> {8,Tlen,Ics,Line,Col,21}; yystate(20, Ics, Line, Col, Tlen, _, _) -> {9,Tlen,Ics,Line,Col}; yystate(19, [101|Ics], Line, Col, Tlen, _, _) -> yystate(11, Ics, Line, Col, Tlen+1, 0, Tlen); yystate(19, [69|Ics], Line, Col, Tlen, _, _) -> yystate(11, Ics, Line, Col, Tlen+1, 0, Tlen); yystate(19, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(19, Ics, Line, Col, Tlen+1, 0, Tlen); yystate(19, Ics, Line, Col, Tlen, _, _) -> {0,Tlen,Ics,Line,Col,19}; yystate(18, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(18, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(18, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(18, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(18, Ics, Line, Col, Tlen, _, _) -> {6,Tlen,Ics,Line,Col,18}; yystate(17, [116|Ics], Line, Col, Tlen, Action, Alen) -> yystate(9, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [102|Ics], Line, Col, Tlen, Action, Alen) -> yystate(24, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [95|Ics], Line, Col, Tlen, Action, Alen) -> yystate(18, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [58|Ics], Line, Col, Tlen, Action, Alen) -> yystate(7, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [47|Ics], Line, Col, Tlen, Action, Alen) -> yystate(12, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [44|Ics], Line, Col, Tlen, Action, Alen) -> yystate(20, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [36|Ics], Line, Col, Tlen, Action, Alen) -> yystate(22, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [34|Ics], Line, Col, Tlen, Action, Alen) -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [32|Ics], Line, Col, Tlen, Action, Alen) -> yystate(21, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [13|Ics], Line, Col, Tlen, Action, Alen) -> yystate(21, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [9|Ics], Line, Col, Tlen, Action, Alen) -> yystate(21, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [10|Ics], Line, _, Tlen, Action, Alen) -> yystate(21, Ics, Line+1, 1, Tlen+1, Action, Alen); yystate(17, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 48, C =< 57 -> yystate(15, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 97, C =< 101 -> yystate(18, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 103, C =< 115 -> yystate(18, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 117, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, Action, Alen); yystate(17, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,17}; yystate(16, [108|Ics], Line, Col, Tlen, _, _) -> yystate(8, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(16, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(16, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(16, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(16, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 107 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(16, [C|Ics], Line, Col, Tlen, _, _) when C >= 109, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(16, Ics, Line, Col, Tlen, _, _) -> {6,Tlen,Ics,Line,Col,16}; yystate(15, [46|Ics], Line, Col, Tlen, _, _) -> yystate(23, Ics, Line, Col, Tlen+1, 1, Tlen); yystate(15, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(15, Ics, Line, Col, Tlen+1, 1, Tlen); yystate(15, Ics, Line, Col, Tlen, _, _) -> {1,Tlen,Ics,Line,Col,15}; yystate(14, [95|Ics], Line, Col, Tlen, _, _) -> yystate(14, Ics, Line, Col, Tlen+1, 7, Tlen); yystate(14, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(14, Ics, Line, Col, Tlen+1, 7, Tlen); yystate(14, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(14, Ics, Line, Col, Tlen+1, 7, Tlen); yystate(14, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 122 -> yystate(14, Ics, Line, Col, Tlen+1, 7, Tlen); yystate(14, Ics, Line, Col, Tlen, _, _) -> {7,Tlen,Ics,Line,Col,14}; yystate(13, [92|Ics], Line, Col, Tlen, Action, Alen) -> yystate(6, Ics, Line, Col, Tlen+1, Action, Alen); yystate(13, [34|Ics], Line, Col, Tlen, Action, Alen) -> yystate(5, Ics, Line, Col, Tlen+1, Action, Alen); yystate(13, [10|Ics], Line, _, Tlen, Action, Alen) -> yystate(13, Ics, Line+1, 1, Tlen+1, Action, Alen); yystate(13, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 0, C =< 9 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(13, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 11, C =< 33 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(13, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 35, C =< 91 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(13, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 93 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(13, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,13}; yystate(12, Ics, Line, Col, Tlen, _, _) -> {5,Tlen,Ics,Line,Col}; yystate(11, [45|Ics], Line, Col, Tlen, Action, Alen) -> yystate(4, Ics, Line, Col, Tlen+1, Action, Alen); yystate(11, [43|Ics], Line, Col, Tlen, Action, Alen) -> yystate(4, Ics, Line, Col, Tlen+1, Action, Alen); yystate(11, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 48, C =< 57 -> yystate(3, Ics, Line, Col, Tlen+1, Action, Alen); yystate(11, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,11}; yystate(10, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 3, Tlen); yystate(10, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 3, Tlen); yystate(10, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 3, Tlen); yystate(10, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 3, Tlen); yystate(10, Ics, Line, Col, Tlen, _, _) -> {3,Tlen,Ics,Line,Col,10}; yystate(9, [114|Ics], Line, Col, Tlen, _, _) -> yystate(1, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(9, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(9, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(9, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(9, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 113 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(9, [C|Ics], Line, Col, Tlen, _, _) when C >= 115, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(9, Ics, Line, Col, Tlen, _, _) -> {6,Tlen,Ics,Line,Col,9}; yystate(8, [115|Ics], Line, Col, Tlen, _, _) -> yystate(0, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(8, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(8, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(8, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(8, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 114 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(8, [C|Ics], Line, Col, Tlen, _, _) when C >= 116, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(8, Ics, Line, Col, Tlen, _, _) -> {6,Tlen,Ics,Line,Col,8}; yystate(7, Ics, Line, Col, Tlen, _, _) -> {4,Tlen,Ics,Line,Col}; yystate(6, [92|Ics], Line, Col, Tlen, Action, Alen) -> yystate(6, Ics, Line, Col, Tlen+1, Action, Alen); yystate(6, [34|Ics], Line, Col, Tlen, Action, Alen) -> yystate(2, Ics, Line, Col, Tlen+1, Action, Alen); yystate(6, [10|Ics], Line, _, Tlen, Action, Alen) -> yystate(13, Ics, Line+1, 1, Tlen+1, Action, Alen); yystate(6, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 0, C =< 9 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(6, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 11, C =< 33 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(6, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 35, C =< 91 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(6, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 93 -> yystate(13, Ics, Line, Col, Tlen+1, Action, Alen); yystate(6, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,6}; yystate(5, Ics, Line, Col, Tlen, _, _) -> {2,Tlen,Ics,Line,Col}; yystate(4, [C|Ics], Line, Col, Tlen, Action, Alen) when C >= 48, C =< 57 -> yystate(3, Ics, Line, Col, Tlen+1, Action, Alen); yystate(4, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,4}; yystate(3, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(3, Ics, Line, Col, Tlen+1, 0, Tlen); yystate(3, Ics, Line, Col, Tlen, _, _) -> {0,Tlen,Ics,Line,Col,3}; yystate(2, [92|Ics], Line, Col, Tlen, _, _) -> yystate(6, Ics, Line, Col, Tlen+1, 2, Tlen); yystate(2, [34|Ics], Line, Col, Tlen, _, _) -> yystate(5, Ics, Line, Col, Tlen+1, 2, Tlen); yystate(2, [10|Ics], Line, _, Tlen, _, _) -> yystate(13, Ics, Line+1, 1, Tlen+1, 2, Tlen); yystate(2, [C|Ics], Line, Col, Tlen, _, _) when C >= 0, C =< 9 -> yystate(13, Ics, Line, Col, Tlen+1, 2, Tlen); yystate(2, [C|Ics], Line, Col, Tlen, _, _) when C >= 11, C =< 33 -> yystate(13, Ics, Line, Col, Tlen+1, 2, Tlen); yystate(2, [C|Ics], Line, Col, Tlen, _, _) when C >= 35, C =< 91 -> yystate(13, Ics, Line, Col, Tlen+1, 2, Tlen); yystate(2, [C|Ics], Line, Col, Tlen, _, _) when C >= 93 -> yystate(13, Ics, Line, Col, Tlen+1, 2, Tlen); yystate(2, Ics, Line, Col, Tlen, _, _) -> {2,Tlen,Ics,Line,Col,2}; yystate(1, [117|Ics], Line, Col, Tlen, _, _) -> yystate(0, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(1, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(1, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(1, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(1, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 116 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(1, [C|Ics], Line, Col, Tlen, _, _) when C >= 118, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(1, Ics, Line, Col, Tlen, _, _) -> {6,Tlen,Ics,Line,Col,1}; yystate(0, [101|Ics], Line, Col, Tlen, _, _) -> yystate(10, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(0, [95|Ics], Line, Col, Tlen, _, _) -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(0, [C|Ics], Line, Col, Tlen, _, _) when C >= 48, C =< 57 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(0, [C|Ics], Line, Col, Tlen, _, _) when C >= 65, C =< 90 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(0, [C|Ics], Line, Col, Tlen, _, _) when C >= 97, C =< 100 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(0, [C|Ics], Line, Col, Tlen, _, _) when C >= 102, C =< 122 -> yystate(18, Ics, Line, Col, Tlen+1, 6, Tlen); yystate(0, Ics, Line, Col, Tlen, _, _) -> {6,Tlen,Ics,Line,Col,0}; yystate(S, Ics, Line, Col, Tlen, Action, Alen) -> {Action,Alen,Tlen,Ics,Line,Col,S}. %% yyaction(Action, TokenLength, TokenChars, TokenLine, TokenCol) -> %% {token,Token} | {end_token, Token} | skip_token | {error,String}. %% Generated action function. yyaction(0, TokenLen, YYtcs, TokenLine, TokenCol) -> TokenChars = yypre(YYtcs, TokenLen), yyaction_0(TokenChars, TokenLine, TokenCol); yyaction(1, TokenLen, YYtcs, TokenLine, TokenCol) -> TokenChars = yypre(YYtcs, TokenLen), yyaction_1(TokenChars, TokenLine, TokenCol); yyaction(2, TokenLen, YYtcs, TokenLine, TokenCol) -> TokenChars = yypre(YYtcs, TokenLen), yyaction_2(TokenChars, TokenLen, TokenLine, TokenCol); yyaction(3, TokenLen, YYtcs, TokenLine, TokenCol) -> TokenChars = yypre(YYtcs, TokenLen), yyaction_3(TokenChars, TokenLine, TokenCol); yyaction(4, _, _, TokenLine, TokenCol) -> yyaction_4(TokenLine, TokenCol); yyaction(5, _, _, TokenLine, TokenCol) -> yyaction_5(TokenLine, TokenCol); yyaction(6, TokenLen, YYtcs, TokenLine, TokenCol) -> TokenChars = yypre(YYtcs, TokenLen), yyaction_6(TokenChars, TokenLine, TokenCol); yyaction(7, TokenLen, YYtcs, TokenLine, TokenCol) -> TokenChars = yypre(YYtcs, TokenLen), yyaction_7(TokenChars, TokenLine, TokenCol); yyaction(8, _, _, _, _) -> yyaction_8(); yyaction(9, _, _, _, _) -> yyaction_9(); yyaction(_, _, _, _, _) -> error. -compile({inline,yyaction_0/3}). -file("rdmx_lexer.xrl", 22). yyaction_0(TokenChars, TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, to_token (float, TokenLoc, TokenChars, fun erlang : list_to_float / 1) . -compile({inline,yyaction_1/3}). -file("rdmx_lexer.xrl", 23). yyaction_1(TokenChars, TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, to_token (integer, TokenLoc, TokenChars, fun erlang : list_to_integer / 1) . -compile({inline,yyaction_2/4}). -file("rdmx_lexer.xrl", 24). yyaction_2(TokenChars, TokenLen, TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, unwrap_quoted (string, TokenLoc, TokenChars, TokenLen) . -compile({inline,yyaction_3/3}). -file("rdmx_lexer.xrl", 25). yyaction_3(TokenChars, TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, to_token (bool, TokenLoc, TokenChars, fun list_to_existing_atom / 1) . -compile({inline,yyaction_4/2}). -file("rdmx_lexer.xrl", 26). yyaction_4(TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, to_token (':', TokenLoc) . -compile({inline,yyaction_5/2}). -file("rdmx_lexer.xrl", 27). yyaction_5(TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, to_token ('/', TokenLoc) . -compile({inline,yyaction_6/3}). -file("rdmx_lexer.xrl", 28). yyaction_6(TokenChars, TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, to_binary_token (identifier, TokenLoc, TokenChars) . -compile({inline,yyaction_7/3}). -file("rdmx_lexer.xrl", 29). yyaction_7(TokenChars, TokenLine, TokenCol) -> TokenLoc={TokenLine,TokenCol}, to_token (var, TokenLoc, TokenChars, fun variable_name / 1) . -compile({inline,yyaction_8/0}). -file("rdmx_lexer.xrl", 30). yyaction_8() -> skip_token . -compile({inline,yyaction_9/0}). -file("rdmx_lexer.xrl", 31). yyaction_9() -> skip_token . -file("leexinc.hrl", 377).