# WARNING: This file was generated from fasta-parser.rl using ragel. Do not edit!
const fastaparser_start  = 6
const fastaparser_first_final  = 6
const fastaparser_error  = 0
const fastaparser_en_main  = 6
const _fastaparser_nfa_targs = Int8[ 0, 0 ,  ]
const _fastaparser_nfa_offsets = Int8[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,  ]
const _fastaparser_nfa_push_actions = Int8[ 0, 0 ,  ]
const _fastaparser_nfa_pop_trans = Int8[ 0, 0 ,  ]
Ragel.@generate_read!_function(
"fastaparser",
FASTAReader,
SeqRecord,
begin
begin
if ( p == pe  )
	@goto _test_eof

end
if ( cs  == 6 )
	@goto st_case_6
elseif ( cs  == 0 )
	@goto st_case_0
elseif ( cs  == 1 )
	@goto st_case_1
elseif ( cs  == 2 )
	@goto st_case_2
elseif ( cs  == 3 )
	@goto st_case_3
elseif ( cs  == 4 )
	@goto st_case_4
elseif ( cs  == 7 )
	@goto st_case_7
elseif ( cs  == 8 )
	@goto st_case_8
elseif ( cs  == 5 )
	@goto st_case_5
end
@goto st_out
@label ctr13
begin
state.linenum += 1
end
@goto st6
@label st6
p+= 1;
if 	( p == pe  )
	@goto _test_eof6

end
@label st_case_6
if ( (data[1+(p )]) == 10 )
	begin
	@goto ctr13

end
elseif 	( (data[1+(p )]) == 32 )
	begin
	@goto st6

end
elseif 	( (data[1+(p )]) == 62 )
	begin
	@goto st1

end
end
if 	( 9 <= (data[1+(p )])&& (data[1+(p )])<= 13  )
	begin
	@goto st6

end

end
begin
	@goto st0

end
@label st_case_0
@label st0
cs = 0;
@goto _out
@label ctr17
begin
if seqtype(typeof(output)) == ReferenceSequence
		output.seq = ReferenceSequence(input.seqbuf.buffer, 1, length(input.seqbuf))
		elseif seqtype(typeof(output)) == BioSequence
		ET = predict(input.seqbuf.buffer, 1, length(input.seqbuf))
		if 	ET == typeof(output.seq)
	resize!(output.seq, length(input.seqbuf))
	encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
else
	output.seq = ET(input.seqbuf.buffer, 1, length(input.seqbuf))
end
else
			resize!(output.seq, length(input.seqbuf))
	encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
end
empty!(input.seqbuf)
Ragel.@yield 1
end
@goto st1
@label ctr21
begin
	Ragel.@append_from_anchor!(input.seqbuf)
end
begin
if seqtype(typeof(output)) == ReferenceSequence
		output.seq = ReferenceSequence(input.seqbuf.buffer, 1, length(input.seqbuf))
		elseif seqtype(typeof(output)) == BioSequence
		ET = predict(input.seqbuf.buffer, 1, length(input.seqbuf))
		if 	ET == typeof(output.seq)
	resize!(output.seq, length(input.seqbuf))
	encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
else
	output.seq = ET(input.seqbuf.buffer, 1, length(input.seqbuf))
end
else
			resize!(output.seq, length(input.seqbuf))
	encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
end
empty!(input.seqbuf)
Ragel.@yield 1
end
@goto st1
@label st1
p+= 1;
if 	( p == pe  )
	@goto _test_eof1

end
@label st_case_1
if ( (data[1+(p )])== 32  )
	begin
	@goto st0

end

end
if 	( 9 <= (data[1+(p )])&& (data[1+(p )])<= 13  )
	begin
	@goto st0

end

end
begin
	@goto ctr0

end
@label ctr0
begin
Ragel.@anchor!
end
@goto st2
@label st2
p+= 1;
if ( p == pe  )
@goto _test_eof2

end
@label st_case_2
if ( (data[1+(p )]) == 10 )
begin
@goto ctr4

end
elseif ( (data[1+(p )]) == 12 )
begin
@goto st0

end
elseif ( (data[1+(p )]) == 13 )
begin
@goto ctr5

end
elseif ( (data[1+(p )]) == 32 )
begin
@goto ctr3

end
end
if ( 9 <= (data[1+(p )])&& (data[1+(p )])<= 11  )
begin
@goto ctr3

end

end
begin
@goto st2

end
@label ctr3
begin
Ragel.@copy_from_anchor!(output.name)
end
@goto st3
@label st3
p+= 1;
if ( p == pe  )
@goto _test_eof3

end
@label st_case_3
if ( (data[1+(p )]) == 9 )
begin
@goto st3

end
elseif ( (data[1+(p )]) == 11 )
begin
@goto st3

end
elseif ( (data[1+(p )]) == 32 )
begin
@goto st3

end
end
begin
@goto ctr6

end
@label ctr6
begin
Ragel.@anchor!
end
@goto st4
@label st4
p+= 1;
if ( p == pe  )
@goto _test_eof4

end
@label st_case_4
if ( (data[1+(p )]) == 10 )
begin
@goto ctr9

end
elseif ( (data[1+(p )]) == 13 )
begin
@goto ctr10

end
end
begin
@goto st4

end
@label ctr4
begin
Ragel.@copy_from_anchor!(output.name)
end
begin
state.linenum += 1
end
@goto st7
@label ctr9
begin
Ragel.@copy_from_anchor!(output.metadata.description)
end
begin
state.linenum += 1
end
@goto st7
@label ctr11
begin
state.linenum += 1
end
@goto st7
@label ctr19
begin
Ragel.@append_from_anchor!(input.seqbuf)
end
@goto st7
@label ctr20
begin
Ragel.@append_from_anchor!(input.seqbuf)
end
begin
state.linenum += 1
end
@goto st7
@label st7
p+= 1;
if ( p == pe  )
@goto _test_eof7

end
@label st_case_7
if ( (data[1+(p )]) == 10 )
begin
@goto ctr11

end
elseif ( (data[1+(p )]) == 32 )
begin
@goto st7

end
elseif ( (data[1+(p )]) == 62 )
begin
@goto ctr17

end
end
if ( 9 <= (data[1+(p )])&& (data[1+(p )])<= 13  )
begin
@goto st7

end

end
begin
@goto ctr15

end
@label ctr15
begin
Ragel.@anchor!
end
@goto st8
@label st8
p+= 1;
if ( p == pe  )
@goto _test_eof8

end
@label st_case_8
if ( (data[1+(p )]) == 10 )
begin
@goto ctr20

end
elseif ( (data[1+(p )]) == 32 )
begin
@goto ctr19

end
elseif ( (data[1+(p )]) == 62 )
begin
@goto ctr21

end
end
if ( 9 <= (data[1+(p )])&& (data[1+(p )])<= 13  )
begin
@goto ctr19

end

end
begin
@goto st8

end
@label ctr5
begin
Ragel.@copy_from_anchor!(output.name)
end
@goto st5
@label ctr10
begin
Ragel.@copy_from_anchor!(output.metadata.description)
end
@goto st5
@label st5
p+= 1;
if ( p == pe  )
@goto _test_eof5

end
@label st_case_5
if ( (data[1+(p )])== 10  )
begin
@goto ctr11

end

end
begin
@goto st0

end
@label st_out
@label _test_eof6
cs = 6;
@goto _test_eof
@label _test_eof1
cs = 1;
@goto _test_eof
@label _test_eof2
cs = 2;
@goto _test_eof
@label _test_eof3
cs = 3;
@goto _test_eof
@label _test_eof4
cs = 4;
@goto _test_eof
@label _test_eof7
cs = 7;
@goto _test_eof
@label _test_eof8
cs = 8;
@goto _test_eof
@label _test_eof5
cs = 5;
@goto _test_eof
@label _test_eof
begin

end
if ( p == eof  )
begin
if ( cs  == 7 )
begin
if seqtype(typeof(output)) == ReferenceSequence
output.seq = ReferenceSequence(input.seqbuf.buffer, 1, length(input.seqbuf))
elseif seqtype(typeof(output)) == BioSequence
ET = predict(input.seqbuf.buffer, 1, length(input.seqbuf))
if ET == typeof(output.seq)
resize!(output.seq, length(input.seqbuf))
encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
else
output.seq = ET(input.seqbuf.buffer, 1, length(input.seqbuf))
end
else
resize!(output.seq, length(input.seqbuf))
encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
end
empty!(input.seqbuf)
Ragel.@yield 0
end

break;
elseif ( cs  == 8 )
begin
Ragel.@append_from_anchor!(input.seqbuf)
end
begin
if seqtype(typeof(output)) == ReferenceSequence
output.seq = ReferenceSequence(input.seqbuf.buffer, 1, length(input.seqbuf))
elseif seqtype(typeof(output)) == BioSequence
ET = predict(input.seqbuf.buffer, 1, length(input.seqbuf))
if ET == typeof(output.seq)
resize!(output.seq, length(input.seqbuf))
encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
else
output.seq = ET(input.seqbuf.buffer, 1, length(input.seqbuf))
end
else
resize!(output.seq, length(input.seqbuf))
encode_copy!(output.seq, 1, input.seqbuf.buffer, 1, length(input.seqbuf))
end
empty!(input.seqbuf)
Ragel.@yield 0
end

break;
end

end

end
@label _out
begin

end

end
end)
