3632 |
$self->{state} = MD_HYPHEN_STATE; |
$self->{state} = MD_HYPHEN_STATE; |
3633 |
!!!next-input-character; |
!!!next-input-character; |
3634 |
redo A; |
redo A; |
3635 |
} elsif ($self->{nc} == 0x0045) { # E |
} elsif ($self->{nc} == 0x0045 or # E |
3636 |
|
$self->{nc} == 0x0065) { # e |
3637 |
$self->{state} = MD_E_STATE; |
$self->{state} = MD_E_STATE; |
3638 |
$self->{kwd} = chr $self->{nc}; |
$self->{kwd} = chr $self->{nc}; |
3639 |
!!!next-input-character; |
!!!next-input-character; |
3640 |
redo A; |
redo A; |
3641 |
} elsif ($self->{nc} == 0x0041) { # A |
} elsif ($self->{nc} == 0x0041 or # A |
3642 |
|
$self->{nc} == 0x0061) { # a |
3643 |
$self->{state} = MD_ATTLIST_STATE; |
$self->{state} = MD_ATTLIST_STATE; |
3644 |
$self->{kwd} = chr $self->{nc}; |
$self->{kwd} = chr $self->{nc}; |
3645 |
!!!next-input-character; |
!!!next-input-character; |
3646 |
redo A; |
redo A; |
3647 |
} elsif ($self->{nc} == 0x004E) { # N |
} elsif ($self->{nc} == 0x004E or # N |
3648 |
|
$self->{nc} == 0x006E) { # n |
3649 |
$self->{state} = MD_NOTATION_STATE; |
$self->{state} = MD_NOTATION_STATE; |
3650 |
$self->{kwd} = chr $self->{nc}; |
$self->{kwd} = chr $self->{nc}; |
3651 |
!!!next-input-character; |
!!!next-input-character; |
3663 |
$self->{ct} = {type => COMMENT_TOKEN, data => ''}; ## Will be discarded. |
$self->{ct} = {type => COMMENT_TOKEN, data => ''}; ## Will be discarded. |
3664 |
redo A; |
redo A; |
3665 |
} elsif ($self->{state} == MD_E_STATE) { |
} elsif ($self->{state} == MD_E_STATE) { |
3666 |
if ($self->{nc} == 0x004E) { # N |
if ($self->{nc} == 0x004E or # N |
3667 |
|
$self->{nc} == 0x006E) { # n |
3668 |
$self->{state} = MD_ENTITY_STATE; |
$self->{state} = MD_ENTITY_STATE; |
3669 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
3670 |
!!!next-input-character; |
!!!next-input-character; |
3671 |
redo A; |
redo A; |
3672 |
} elsif ($self->{nc} == 0x004C) { # L |
} elsif ($self->{nc} == 0x004C or # L |
3673 |
|
$self->{nc} == 0x006C) { # l |
3674 |
## XML5: <!ELEMENT> not supported. |
## XML5: <!ELEMENT> not supported. |
3675 |
$self->{state} = MD_ELEMENT_STATE; |
$self->{state} = MD_ELEMENT_STATE; |
3676 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
3688 |
redo A; |
redo A; |
3689 |
} |
} |
3690 |
} elsif ($self->{state} == MD_ENTITY_STATE) { |
} elsif ($self->{state} == MD_ENTITY_STATE) { |
3691 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
3692 |
'EN' => 0x0054, # T |
undef, |
3693 |
'ENT' => 0x0049, # I |
undef, |
3694 |
'ENTI' => 0x0054, # T |
0x0054, # T |
3695 |
}->{$self->{kwd}}) { |
0x0049, # I |
3696 |
|
0x0054, # T |
3697 |
|
]->[length $self->{kwd}] or |
3698 |
|
$self->{nc} == [ |
3699 |
|
undef, |
3700 |
|
undef, |
3701 |
|
0x0074, # t |
3702 |
|
0x0069, # i |
3703 |
|
0x0074, # t |
3704 |
|
]->[length $self->{kwd}]) { |
3705 |
## Stay in the state. |
## Stay in the state. |
3706 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
3707 |
!!!next-input-character; |
!!!next-input-character; |
3708 |
redo A; |
redo A; |
3709 |
} elsif ($self->{kwd} eq 'ENTIT' and |
} elsif ((length $self->{kwd}) == 5 and |
3710 |
$self->{nc} == 0x0059) { # Y |
($self->{nc} == 0x0059 or # Y |
3711 |
$self->{ct} = {type => GENERAL_ENTITY_TOKEN, name => '', text => '', |
$self->{nc} == 0x0079)) { # y |
3712 |
|
if ($self->{kwd} ne 'ENTIT' or $self->{nc} == 0x0079) { |
3713 |
|
!!!parse-error (type => 'lowercase keyword', ## TODO: type |
3714 |
|
text => 'ENTITY', |
3715 |
|
line => $self->{line_prev}, |
3716 |
|
column => $self->{column_prev} - 4); |
3717 |
|
} |
3718 |
|
$self->{ct} = {type => GENERAL_ENTITY_TOKEN, name => '', |
3719 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
3720 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 6}; |
3721 |
$self->{state} = DOCTYPE_MD_STATE; |
$self->{state} = DOCTYPE_MD_STATE; |
3733 |
redo A; |
redo A; |
3734 |
} |
} |
3735 |
} elsif ($self->{state} == MD_ELEMENT_STATE) { |
} elsif ($self->{state} == MD_ELEMENT_STATE) { |
3736 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
3737 |
'EL' => 0x0045, # E |
undef, |
3738 |
'ELE' => 0x004D, # M |
undef, |
3739 |
'ELEM' => 0x0045, # E |
0x0045, # E |
3740 |
'ELEME' => 0x004E, # N |
0x004D, # M |
3741 |
}->{$self->{kwd}}) { |
0x0045, # E |
3742 |
|
0x004E, # N |
3743 |
|
]->[length $self->{kwd}] or |
3744 |
|
$self->{nc} == [ |
3745 |
|
undef, |
3746 |
|
undef, |
3747 |
|
0x0065, # e |
3748 |
|
0x006D, # m |
3749 |
|
0x0065, # e |
3750 |
|
0x006E, # n |
3751 |
|
]->[length $self->{kwd}]) { |
3752 |
## Stay in the state. |
## Stay in the state. |
3753 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
3754 |
!!!next-input-character; |
!!!next-input-character; |
3755 |
redo A; |
redo A; |
3756 |
} elsif ($self->{kwd} eq 'ELEMEN' and |
} elsif ((length $self->{kwd}) == 6 and |
3757 |
$self->{nc} == 0x0054) { # T |
($self->{nc} == 0x0054 or # T |
3758 |
|
$self->{nc} == 0x0074)) { # t |
3759 |
|
if ($self->{kwd} ne 'ELEMEN' or $self->{nc} == 0x0074) { |
3760 |
|
!!!parse-error (type => 'lowercase keyword', ## TODO: type |
3761 |
|
text => 'ELEMENT', |
3762 |
|
line => $self->{line_prev}, |
3763 |
|
column => $self->{column_prev} - 5); |
3764 |
|
} |
3765 |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
$self->{ct} = {type => ELEMENT_TOKEN, name => '', |
3766 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
3767 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 6}; |
3780 |
redo A; |
redo A; |
3781 |
} |
} |
3782 |
} elsif ($self->{state} == MD_ATTLIST_STATE) { |
} elsif ($self->{state} == MD_ATTLIST_STATE) { |
3783 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
3784 |
'A' => 0x0054, # T |
undef, |
3785 |
'AT' => 0x0054, # T |
0x0054, # T |
3786 |
'ATT' => 0x004C, # L |
0x0054, # T |
3787 |
'ATTL' => 0x0049, # I |
0x004C, # L |
3788 |
'ATTLI' => 0x0053, # S |
0x0049, # I |
3789 |
}->{$self->{kwd}}) { |
0x0053, # S |
3790 |
|
]->[length $self->{kwd}] or |
3791 |
|
$self->{nc} == [ |
3792 |
|
undef, |
3793 |
|
0x0074, # t |
3794 |
|
0x0074, # t |
3795 |
|
0x006C, # l |
3796 |
|
0x0069, # i |
3797 |
|
0x0073, # s |
3798 |
|
]->[length $self->{kwd}]) { |
3799 |
## Stay in the state. |
## Stay in the state. |
3800 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
3801 |
!!!next-input-character; |
!!!next-input-character; |
3802 |
redo A; |
redo A; |
3803 |
} elsif ($self->{kwd} eq 'ATTLIS' and |
} elsif ((length $self->{kwd}) == 6 and |
3804 |
$self->{nc} == 0x0054) { # T |
($self->{nc} == 0x0054 or # T |
3805 |
|
$self->{nc} == 0x0074)) { # t |
3806 |
|
if ($self->{kwd} ne 'ATTLIS' or $self->{nc} == 0x0074) { |
3807 |
|
!!!parse-error (type => 'lowercase keyword', ## TODO: type |
3808 |
|
text => 'ATTLIST', |
3809 |
|
line => $self->{line_prev}, |
3810 |
|
column => $self->{column_prev} - 5); |
3811 |
|
} |
3812 |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
$self->{ct} = {type => ATTLIST_TOKEN, name => '', |
3813 |
attrdefs => [], |
attrdefs => [], |
3814 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
3828 |
redo A; |
redo A; |
3829 |
} |
} |
3830 |
} elsif ($self->{state} == MD_NOTATION_STATE) { |
} elsif ($self->{state} == MD_NOTATION_STATE) { |
3831 |
if ($self->{nc} == { |
if ($self->{nc} == [ |
3832 |
'N' => 0x004F, # O |
undef, |
3833 |
'NO' => 0x0054, # T |
0x004F, # O |
3834 |
'NOT' => 0x0041, # A |
0x0054, # T |
3835 |
'NOTA' => 0x0054, # T |
0x0041, # A |
3836 |
'NOTAT' => 0x0049, # I |
0x0054, # T |
3837 |
'NOTATI' => 0x004F, # O |
0x0049, # I |
3838 |
}->{$self->{kwd}}) { |
0x004F, # O |
3839 |
|
]->[length $self->{kwd}] or |
3840 |
|
$self->{nc} == [ |
3841 |
|
undef, |
3842 |
|
0x006F, # o |
3843 |
|
0x0074, # t |
3844 |
|
0x0061, # a |
3845 |
|
0x0074, # t |
3846 |
|
0x0069, # i |
3847 |
|
0x006F, # o |
3848 |
|
]->[length $self->{kwd}]) { |
3849 |
## Stay in the state. |
## Stay in the state. |
3850 |
$self->{kwd} .= chr $self->{nc}; |
$self->{kwd} .= chr $self->{nc}; |
3851 |
!!!next-input-character; |
!!!next-input-character; |
3852 |
redo A; |
redo A; |
3853 |
} elsif ($self->{kwd} eq 'NOTATIO' and |
} elsif ((length $self->{kwd}) == 7 and |
3854 |
$self->{nc} == 0x004E) { # N |
($self->{nc} == 0x004E or # N |
3855 |
|
$self->{nc} == 0x006E)) { # n |
3856 |
|
if ($self->{kwd} ne 'NOTATIO' or $self->{nc} == 0x006E) { |
3857 |
|
!!!parse-error (type => 'lowercase keyword', ## TODO: type |
3858 |
|
text => 'NOTATION', |
3859 |
|
line => $self->{line_prev}, |
3860 |
|
column => $self->{column_prev} - 6); |
3861 |
|
} |
3862 |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
$self->{ct} = {type => NOTATION_TOKEN, name => '', |
3863 |
line => $self->{line_prev}, |
line => $self->{line_prev}, |
3864 |
column => $self->{column_prev} - 6}; |
column => $self->{column_prev} - 6}; |