--- /dev/null
+# Sphinx build info version 1
+# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
+config: e7cfb42cf34345cdc0457a5baa4857c7
+tags: 645f666f9bcd5a90fca523b33c5a78b7
--- /dev/null
+%!PS-Adobe-2.0
+%%Creator: dvipsk 5.526a Copyright 1986, 1993 Radical Eye Software
+%%Title: paper.dvi
+%%Pages: 16
+%%PageOrder: Ascend
+%%BoundingBox: 0 0 612 792
+%%EndComments
+%DVIPSCommandLine: dvips -o paper.ps paper
+%DVIPSParameters: dpi=300, compressed, comments removed
+%DVIPSSource: TeX output 1994.04.15:2115
+%%BeginProcSet: texc.pro
+/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N
+/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72
+mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1}
+ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale
+isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div
+hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul
+TR matrix currentmatrix dup dup 4 get round 4 exch put dup dup 5 get
+round 5 exch put setmatrix}N /@landscape{/isls true N}B /@manualfeed{
+statusdict /manualfeed true put}B /@copies{/#copies X}B /FMat[1 0 0 -1 0
+0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{/nn 8 dict N nn
+begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N string /base X
+array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N end dup{/foo
+setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{/sf 1 N /fntrx
+FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0]N df-tail}B /E{
+pop nn dup definefont setfont}B /ch-width{ch-data dup length 5 sub get}
+B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{128 ch-data dup
+length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub get 127 sub}B
+/ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data dup type
+/stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N /rc 0 N /gp
+0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup /base get 2
+index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx 0 ch-xoff
+ch-yoff ch-height sub ch-xoff ch-width add ch-yoff setcachedevice
+ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff .1 add]/id
+ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N /cp 0 N{
+rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id gp get
+/gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp add /cp
+X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add /gp X
+adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{dup
+255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 adv}
+B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 idiv
+S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string
+putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval
+adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg}
+{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{
+adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2
+chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{]
+}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup
+length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{
+cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin
+0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul
+add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore showpage
+userdict /eop-hook known{eop-hook}if}N /@start{userdict /start-hook
+known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X
+/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for
+65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0
+0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V
+{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7
+getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false}
+ifelse}{false}ifelse end{{gsave TR -.1 -.1 TR 1 1 scale rulex ruley
+false RMat{BDot}imagemask grestore}}{{gsave TR -.1 -.1 TR rulex ruley
+scale 1 1 false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave
+transform round exch round exch itransform moveto rulex 0 rlineto 0
+ruley neg rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta
+0 N /tail{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}
+B /c{-4 M}B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{
+3 M}B /k{4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p
+-1 w}B /q{p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{
+3 2 roll p a}B /bos{/SS save N}B /eos{SS restore}B end
+%%EndProcSet
+%%BeginProcSet: special.pro
+TeXDict begin /SDict 200 dict N SDict begin /@SpecialDefaults{/hs 612 N
+/vs 792 N /ho 0 N /vo 0 N /hsc 1 N /vsc 1 N /ang 0 N /CLIP 0 N /rwiSeen
+false N /rhiSeen false N /letter{}N /note{}N /a4{}N /legal{}N}B
+/@scaleunit 100 N /@hscale{@scaleunit div /hsc X}B /@vscale{@scaleunit
+div /vsc X}B /@hsize{/hs X /CLIP 1 N}B /@vsize{/vs X /CLIP 1 N}B /@clip{
+/CLIP 2 N}B /@hoffset{/ho X}B /@voffset{/vo X}B /@angle{/ang X}B /@rwi{
+10 div /rwi X /rwiSeen true N}B /@rhi{10 div /rhi X /rhiSeen true N}B
+/@llx{/llx X}B /@lly{/lly X}B /@urx{/urx X}B /@ury{/ury X}B /magscale
+true def end /@MacSetUp{userdict /md known{userdict /md get type
+/dicttype eq{userdict begin md length 10 add md maxlength ge{/md md dup
+length 20 add dict copy def}if end md begin /letter{}N /note{}N /legal{}
+N /od{txpose 1 0 mtx defaultmatrix dtransform S atan/pa X newpath
+clippath mark{transform{itransform moveto}}{transform{itransform lineto}
+}{6 -2 roll transform 6 -2 roll transform 6 -2 roll transform{
+itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll curveto}}{{
+closepath}}pathforall newpath counttomark array astore /gc xdf pop ct 39
+0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if}N
+/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1 -1
+scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 get
+ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip yflip
+not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub neg 0
+TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{noflips{TR
+pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop 90 rotate 1
+-1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg
+TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr 1 get neg
+sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr 2 get ppr
+0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4 -1 roll add
+2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S TR}if}N /cp
+{pop pop showpage pm restore}N end}if}if}N /normalscale{Resolution 72
+div VResolution 72 div neg scale magscale{DVImag dup scale}if 0 setgray}
+N /psfts{S 65781.76 div N}N /startTexFig{/psf$SavedState save N userdict
+maxlength dict begin /magscale false def normalscale currentpoint TR
+/psf$ury psfts /psf$urx psfts /psf$lly psfts /psf$llx psfts /psf$y psfts
+/psf$x psfts currentpoint /psf$cy X /psf$cx X /psf$sx psf$x psf$urx
+psf$llx sub div N /psf$sy psf$y psf$ury psf$lly sub div N psf$sx psf$sy
+scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub TR
+/showpage{}N /erasepage{}N /copypage{}N /p 3 def @MacSetUp}N /doclip{
+psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2
+roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath
+moveto}N /endTexFig{end psf$SavedState restore}N /@beginspecial{SDict
+begin /SpecialSave save N gsave normalscale currentpoint TR
+@SpecialDefaults count /ocount X /dcount countdictstack N}N /@setspecial
+{CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto
+closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx
+sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR
+}{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse
+CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury
+lineto closepath clip}if /showpage{}N /erasepage{}N /copypage{}N newpath
+}N /@endspecial{count ocount sub{pop}repeat countdictstack dcount sub{
+end}repeat grestore SpecialSave restore end}N /@defspecial{SDict begin}
+N /@fedspecial{end}B /li{lineto}B /rl{rlineto}B /rc{rcurveto}B /np{
+/SaveX currentpoint /SaveY X N 1 setlinecap newpath}N /st{stroke SaveX
+SaveY moveto}N /fil{fill SaveX SaveY moveto}N /ellipse{/endangle X
+/startangle X /yrad X /xrad X /savematrix matrix currentmatrix N TR xrad
+yrad scale 0 0 1 startangle endangle arc savematrix setmatrix}N end
+%%EndProcSet
+TeXDict begin 40258431 52099146 1000 300 300 (paper.dvi)
+@start /Fa 43 122 df<126012F0A212701210A31220A312401280040C7B830D>44
+D<126012F0A2126004047B830D>46 D<1303A3497EA2497E130BA2EB11E0A3EB20F0A249
+7E1478A2497EA33801FFFEEB001E0002131F80A248EB0780A2120C001E14C039FF803FFC
+1E1D7E9C22>65 D<B512C0380F0078141C141E140E140FA4140E141E5C14F8EBFFF0EB00
+3C140FEC0780A2EC03C0A5EC078015005C143CB512F01A1C7D9B20>I<90380FE0209038
+7018603801C00439030003E000061301000E13004814605A15201278127000F01400A800
+70142012781238A26C14407E000614806CEB01003801C00638007018EB0FE01B1E7D9C21
+>I<B512C0380F0078141C140715801403EC01C0A215E0140015F0A815E0A2140115C0EC
+0380A2EC0700141E1478B512E01C1C7D9B22>I<B6FC380F000F140380A215801400A214
+801500A3130113FF13011300A3154014001580A31401A2EC0300140FB6FC1A1C7D9B1F>
+I<B512FE380F001E14061402A214031401A214811480A3130113FF13011300A41400A77F
+EAFFF8181C7D9B1E>I<90381FC04090387030C03801C00C38030003000E1301120C001C
+13005A15401278127000F01400A6EC7FF8EC07C00070130312781238A27E120C120E0003
+13053801C008390070304090381FC0001D1E7D9C23>I<39FFF0FFF0390F000F00AC90B5
+FCEB000FAD39FFF0FFF01C1C7D9B22>I<380FFF8038007C00133CB3127012F8A21338EA
+7078EA4070EA30E0EA0F80111D7D9B18>74 D<39FFF00FF8390F0007C0EC030014025C5C
+5C1460148049C7FC13021307497E1317EB23C0EB43E01381EB00F08014788080141F80EC
+078015C015E039FFF03FFC1E1C7D9B23>I<EAFFF8EA0F8090C7FCB01404A3140CA21408
+1418143814F8B5FC161C7D9B1C>I<B46CEB3FE0000FEC3E00A2D80BC0135EA2D809E013
+9EA33908F0011EA2EB7802A3EB3C04A2EB1E08A3EB0F10A2EB07A0A3EB03C0A2EB018012
+1C3AFF8181FFE0231C7D9B29>I<B4EB1FF0390F8003809038C00100120BEA09E0EA08F0
+A21378133C133E131E130F14811307EB03C1EB01E114F113001479147D143D141FA28080
+80121CB46C7E1C1C7D9B22>I<B512E0380F0078141C80801580A51500140E5C1478EBFF
+E090C8FCACEAFFF0191C7D9B1F>80 D<B57E380F00F014388080140FA4140E5C5C14F0EB
+FF80EB01E0EB0070147880A61508A2141CEC1E1038FFF00EC7EA03E01D1D7D9B21>82
+D<3803E080EA0C19EA1005EA3003EA600112E01300A36C13007E127EEA7FE0EA3FFC6CB4
+FC00071380EA007FEB07C0EB03E0130113007EA36C13C0A238E0018038D00300EACE06EA
+81F8131E7D9C19>I<007FB512C038700F010060130000401440A200C014201280A30000
+1400B1497E3803FFFC1B1C7D9B21>I<39FFF01FF0390F000380EC0100B3A26C13021380
+00035BEA01C03800E018EB7060EB0F801C1D7D9B22>I<39FFE003FC001FC712F06C1440
+A26C6C1380A27F0003EB0100A23801E002A2EBF00600001304A2EB7808A2EB7C18EB3C10
+A26D5AA2EB1F60EB0F40A26D5AA36DC7FCA21E1D7E9B22>I<3BFFE07FF03FC03B1F000F
+800F00ED00066CEC8004A213800007496C5A1413A23A03C033E0101421A23A01E061F020
+1440A2D800F06D5AEC8078A20178EB7C80903879003CA2013D013FC7FC013E7FA2011E13
+1E011C130EA2010C130C010813042A1D7E9B2E>I<13201370A313B8A3EA011CA3EA020E
+A2487EA2EA07FF38080380A3381801C0EA380338FE0FF815157F9419>97
+D<EAFFFCEA1C07EB038014C0A414801307381FFF00A2381C038014C0EB01E0A414C01303
+EB078038FFFE0013157F9418>I<EBFC2038078260380E01E0EA1C004813600078132012
+7012F01400A5142012701278003813407E6C138038078300EA00FC13157E9419>I<EAFF
+FCEA1C07EB01C0EB00E0A21470A21478A71470A214E0A2EB01C0EB0700EAFFFC15157F94
+1A>I<B51280EA1C031300A21440A213101400A21330EA1FF0EA1C3013101420A2130014
+60144014C01301B5FC13157F9417>I<EBFC2038078260380E01E0EA1C00481360007813
+20127012F01400A3EB0FF8EB00E0A21270127812387E7E380783603800FC2015157E941B
+>103 D<38FF8FF8381C01C0A9EA1FFFEA1C01A938FF8FF815157F9419>I<EAFF80EA1C00
+B3EAFF8009157F940D>I<38FF83F8381C01E01480140013025B5B5B1330137013B8EA1D
+1C121EEA1C0E7F14801303EB01C014E014F038FF83FC16157F941A>107
+D<EAFFC0001CC7FCAC1480A3130114005B5BB5FC11157F9415>I<00FEEB0FE0001E1400
+00171317A338138027A23811C047A33810E087A2EB7107A3133AA2131CA2123839FE083F
+E01B157F941F>I<38FC03F8381E00E014401217EA138013C01211EA10E01370A2133813
+1CA2130E130714C0130313011300123800FE134015157F9419>I<EA01F8EA070EEA0C03
+001C1380383801C0007813E0EA700000F013F0A7007013E0EA7801003813C0381C0380EA
+1E0738070E00EA01F814157E941A>I<EAFFFCEA1C0FEB038014C0A51480EB0F00EA1FFC
+001CC7FCA9B47E12157F9417>I<EAFFF8EA1C0EEB0780130314C0A314801307EB0E00EA
+1FF8EA1C1C7F7FA31480148414C4EB03CC38FF80F816157F9419>114
+D<EA1F10EA30F0EA603012C01310A213007E127EEA3FC0EA1FE0EA03F0EA007813381318
+1280A21310EAC030EAF060EA8FC00D157E9413>I<387FFFF03860703000401310A20080
+1308A300001300ADEA07FF15157F9419>I<38FF83F8381C00E01440AE000C13C0000E13
+8038060100EA0386EA00FC15157F9419>I<38FF01F8383C00F0001C1340A2001E13C000
+0E1380A238070100A21383EA0382A2EA01C4A213E4EA00E8A21370A3132015157F9419>
+I<38FF87F0381E0380000E1300EA0F026C5AEA038413C8EA01D0EA00F0A21370137813BC
+EA011C7FEA020F487EEB0380000C13C0123C38FE07F815157F9419>120
+D<38FF80FE381E0078000E1320000F13407E3803808013C100011300EA00E2A21374137C
+1338A848B4FC1715809419>I E /Fb 7 118 df<EA0780EA1840EA302012601340EAFF80
+EAC000A413201340EA6180EA3E000B0E7C8D10>101 D<123E120CA41218A41230A41260
+A412C012C8A312D0126007177D9609>108 D<3830783C38498CC6384E0502EA4C06389C
+0E06EA180CA348485A15801418A23960300900140E190E7D8D1D>I<EA0780EA18C0EA30
+40EA6060A212C0A3EA80C0A2EA8180EAC1001246123C0B0E7B8D12>111
+D<EA30F0EA4B18EA4E38EA4C30EA98001218A35AA45AA20D0E7D8D0F>114
+D<EA0780EA0C40EA18E0A2EA3800121EEA1F80EA07C01200126012E0EAC180EAC300123E
+0B0E7D8D0F>I<EA3804EA2C0C124CA2EA8C181218A3EA30301332A21372EA18B4EA0F1C
+0F0E7D8D13>117 D E /Fc 1 59 df<126012F0A2126004047D830A>58
+D E /Fd 1 111 df<EA30F8EA590C124E129C12981218A2EA301813191331A2EA603213
+1C100D7F8C15>110 D E /Fe 22 121 df<EAFF80A2090280880C>45
+D<12E0A303037D820A>I<130813181330A31360A313C0A3EA0180A3EA0300A21206A35A
+A35AA35AA35AA35AA20D217E9812>I<1202120E12FEA2120EB0EAFFE0A20B167D9512>
+49 D<B51280A2380007005B130E5B133C5B137013F0485A5B1203485A90C7FC5A121E12
+1C5A12781270B51280A211177E9616>90 D<EA1FC0EA7FE0EA7070EA40381200A2EA01F8
+121FEA7E3812F012E0A2EAF078EA7FF8EA3FB80D0F7F8E11>97 D<12E0A8EAE7C0EAFFE0
+EAF870EAE038A2131CA51338A2EAF0F0EAFFE0EAE7800E177E9612>I<EA07E0EA1FF8EA
+3838EA7000A25AA512701308EA3838EA1FF8EA07E00D0F7F8E10>I<EA0F80EA1FE0EA38
+70EA7030EA6038EAE018EAFFF8A2EAE000A212601270EA3818EA1FF8EA07E00D0F7F8E10
+>101 D<EA03E01207EA0C20EA1C00A5EAFF80A2EA1C00AD0B1780960B>I<EA0F9FEA1FFF
+EA38F0EA7070A4EA38E0EA3FC0EA6F80EA60001270EA7FF0EA3FF8EA7FFCEA701EEAE00E
+A3EA783CEA3FF8EA0FE010167F8E12>I<12E0A31200A612E0AF03187E9708>105
+D<12E0B3A503177E9608>108 D<38E7E1F838EFF3FC38F87E1E38F03C0EEAE038AB170F
+7E8E1C>I<EAE7E0EAEFF0EAF878EAF03812E0AB0D0F7E8E12>I<EA07C0EA1FF0EA3838EA
+701CA2EAE00EA5EA701CA2EA3C78EA1FF0EA07C00F0F7F8E12>I<EAE7C0EAFFE0EAF870
+EAE038A2131CA51338A2EAF0F0EAFFE0EAE780EAE000A60E157E8E12>I<EAE38012EFEA
+FC005A5AA25AA9090F7E8E0C>114 D<121FEA7FC012E01300A27E127FEA3F80EA0FC0EA
+01E0128012C0EAE1C0127FEA1F000B0F7F8E0E>I<1238A4EAFFC0A2EA3800AA1340EA1F
+C013000A137F920D>I<EAE038AC13F8127FEA3F380D0F7E8E12>I<EA701CEA7838EA3870
+121CEA0EE0EA07C0EA0380A2EA07C0EA0EE0EA0C60EA1C70EA3838EA701CEAF01E0F0F80
+8E10>120 D E /Ff 34 121 df<3801F1C0120312071301120EA7EAFFF1A2EA0E01B012
+1D809C16>13 D<EAFFE0A20B0280890E>45 D<12E0A303037C820C>I<130113031306A3
+130CA31318A31330A31360A213C0A3EA0180A3EA0300A31206A25AA35AA35AA35AA35AA2
+10297E9E15>I<EA03C0EA0FF0EA1FF8EA3C3CEA381CEA700EA3EAE007ADEA700EA3EA38
+1CEA3C3CEA1FF8EA0FF0EA07E0101D7E9B15>I<5A1207123FB4FC12C71207B3A3EAFFF8
+A20D1C7C9B15>I<EA07C0EA1FF0EA3878EA701CEA601EEAE00EEAC00F124013071200A2
+130F130E131E131C133C137813F0EA01E013C0EA0380EA0700120E5A5A5AB5FCA2101C7E
+9B15>I<EA07E0EA1FF0EA3838EA701CEAE01E1240A21200A2131C133C1378EA07F013E0
+13F0EA003C131C131E130FA41280A2EAC01EEA601CEA383CEA1FF0EA07E0101D7E9B15>
+I<133C137C135C13DC1201139C1203A2EA071CA2120EA2121C123C12381278127012F0B5
+12C0A238001C00A7121B7F9A15>I<EA7FFEA2EA7000A7EA73E0EA7FF013F8EA7E3CEA7C
+1E1278130F1200A6EA401E12C0EA603CEA3878EA1FF0EA0FC0101C7E9A15>I<B5FCA2EA
+0007130E131CA213381378137013F013E01201A2EA03C0A3EA0780A413005AA6101B7E9A
+15>55 D<EA03C0EA0FF0EA1C38EA381CEA700C130E12E013061307A5130F1270EA781FEA
+3C3FEA3FF7EA1FE7EA0F86EA000EA2130C131C1318EA2030EA70F0EA3FC0EA0F80101D7E
+9B15>57 D<B512C0A200F0C7FCABB51280A200F0C7FCACB512C0A2121D7C9C19>69
+D<387FFFF0A2380001E0130314C013071480EB0F005B131E133E133C5B13F85B12015B48
+5A12075B120F90C7FC121E123E123C127C1278B512F0A2141D7E9C19>90
+D<EA0FC0EA3FF0EA7FF8EA7038EA401C1200A213FC120F123FEA781C12E0A3EAF07CEA7F
+FC13DCEA3F1C0E127E9114>97 D<12E0ABEAE3E0EAEFF0EAFFF8EAF87CEAF01CEAE01E13
+0EA6131C12F0EAF87CEAFFF8EAEFF0EAE3C00F1D7D9C15>I<EA07E0EA0FF8EA1FFCEA3C
+1CEA700413005AA612701304EA3C1CEA1FFCEA0FF8EA07E00E127E9112>I<130EABEA0F
+8EEA1FEEEA3FFEEA7C3EEA700EA212E0A612F0EA701EEA7C3EEA3FFEEA1FEEEA0F8E0F1D
+7E9C15>I<EA07C0EA1FE0EA3FF0EA7878EA7018EA601CEAFFFCA3EAE000A312701304EA
+3C1CEA3FFCEA1FF8EA07E00E127E9112>I<13FC12011203EA0700120EA7EAFFE0A2EA0E
+00B00E1D809C0D>I<3803C3C0EA0FFF5A381C3800487EA56C5AEA1FF85BEA3BC00038C7
+FCA2EA1FFC13FF481380EA700738E001C0A3EAF003387C0F80383FFF006C5AEA07F8121B
+7F9115>I<12F0A41200A71270B2041D7E9C0A>105 D<12E0AB133C137813F0EAE1E0EAE3
+C0EAE780EAEF00B4FC138012FBEAF9C0EAF1E012E013F013781338133C131E0F1D7D9C14
+>107 D<12E0B3AB031D7D9C0A>I<38E3F03F39EFF8FF80D8FFFD13C039F81F81E038F00F
+00EAE00EAD1B127D9122>I<EAE3E0EAEFF0EAFFF8EAF83CEAF01C12E0AD0E127D9115>I<
+EA03F0EA0FFC487EEA3C0F38780780EA700338E001C0A5EAF00300701380EA7807383C0F
+00EA1FFE6C5AEA03F012127F9115>I<EAE3E0EAEFF0EAFFF8EAF87CEAF01CEAE01E130E
+A6131CEAF03CEAF87CEAFFF8EAEFF0EAE3C0EAE000A80F1A7D9115>I<EAE38012E712EF
+EAFC005A5AA25AAB09127D910E>114 D<EA1FC0EA3FF0127FEAF030EAE000A27E127FEA
+3FC0EA1FE0EA00F01338A21280EAF078EAFFF0EA7FE0EA1FC00D127F9110>I<121CA6EA
+FFE0A2EA1C00AC1320EA1FF0120FEA07C00C187F970F>I<EAE01CAE137CEAFFFCEA7FDC
+EA3F1C0E127D9115>I<39E03E0380A3D870371300EB7707A213733838E38EA33818E18C
+381CC1CC001D13DCA2380D80D8000F13F8A20007137019127F911C>119
+D<3870038038780700EA3C0EEA1C1C120E6C5AEA03F06C5A5B7F487EEA0738EA0E18131C
+487E487E3870038000F013C01212809113>I E /Fg 72 126 df<126012F0AA12701200
+A4126012F0A212600414799312>33 D<EA4040EAE0E0A7EA40400B097D9312>I<EA0E38
+A4EAFFFEA2127FEA1C70A5EA7FFE12FFA2EA38E0A50F147F9312>I<EA3018EA783812FC
+1370A313E0A21278EA31C01201A2EA0380A2EA0700A3EA0E18133C137E121CA31238133C
+EA18180F1A7F9612>37 D<1207EA1F80EA19C01239A3EA3B9E133EEA3E38EA1C70A2EA1E
+E0123E1267EAE7C0EAE3C413CE12E7EA7EFCEA3C380F147F9312>I<126012F012F81278
+1218A31230A2126012C01280050C799312>I<EA01801203EA06005A5A123812301270A2
+5AA71270A21230123812187E7EEA0380120109197B9612>I<128012C012601230121812
+1C120C120EA21207A7120EA2120C121C12181230126012C0128008197C9612>I<1207A3
+EAE738EAFFF8EA7FF0EA1FC0A2EA7FF0EAFFF8EAE738EA0700A30D0E7E9012>I<EA0380
+A6EAFFFEA3EA0380A60F0F7F9112>I<126012F012F8127812181230A212E012C0050979
+8312>I<EAFFF8A30D037E8B12>I<126012F0A212600404798312>I<13181338A21370A2
+13E0A2EA01C0A3EA0380A2EA0700A2120EA25AA35AA25AA25AA25A0D1A7E9612>I<EA07
+C0EA0FE0EA1C70EA3838EA701CA2EAE00EA7131EEA701CA2EA3838EA1C70EA0FE0EA07C0
+0F147F9312>I<1206A2120E121E12FE12EE120EACEAFFE0A20B147D9312>I<EA0F80EA3F
+C0EA70E0EAE0701338A2124012001330137013E013C0EA0180EA030012065AEA18381230
+EA7FF8A20D147E9312>I<EA0FC0EA3FF0EA7838EA701C1220120013381370EA07E013F0
+EA0038131C130EA2124012E0131CEA7838EA3FF0EA0FC00F147F9312>I<12E0EAFFFEA2
+EAE0181338EA007013E013C01201EA0380A2EA0700A4120EA512040F157F9412>55
+D<EA07C0EA1FF0EA3C78EA783CEA701CA3EA3838EA0FE0EA07C0EA3C78EA701CEAE00EA4
+EA701CEA783CEA1FF0EA0FE00F147F9312>I<EA07C0EA1FF0EA3838EA7018EAE01C130C
+130EA2EA701EEA383EEA1FEEEA0FCEEA000E131CA2EA7018133813F0EA3FC0EA0F800F14
+7F9312>I<126012F0A212601200A6126012F0A21260040E798D12>I<126012F0A2126012
+00A6126012F0A212701230A2126012C012800413798D12>I<13381378EA01F0EA03E0EA
+0F80EA1F00123C12F85A7E123C121FEA0F80EA03E0EA01F0EA007813380D117E9212>I<
+EAFFFEA2127FC7FCA3EA7FFE12FFA20F097F8E12>I<124012E07E127C7EEA0F80EA07C0
+EA01E0EA00F8137813F8EA01E0EA07C0EA0F80EA3E005A12F05A12400D137E9312>I<EA
+0380EA07C0A21206A2EA0EE0A4EA0C60EA1C70A3EA1FF0A2EA3838A3EAFC7EA20F147F93
+12>65 D<EAFFE013F0EA3838131CA413381378EA3FF013F8EA381C130EA4131E133CEAFF
+F813F00F147F9312>I<EA03E6EA0FFEEA1C3EEA381EEA700EA21260EAE000A6EA600E12
+70A2EA381CEA1C38EA0FF0EA03E00F147F9312>I<EAFFFEA2EA380EA31300A213E0A212
+3FA21238A21300130EA4EAFFFEA20F147F9312>69 D<EAFFFEA2EA380EA31300A21370A2
+EA3FF0A2EA3870A21300A512FEA20F147F9312>I<EAFFE0A2EA0E00B0EAFFE0A20B147D
+9312>73 D<EAFE7E127EEA3838137013E0A2EA39C0EA3B80123FA213C0123DEA3CE01238
+1370A21338A2EA7E7E12FE0F147F9312>75 D<B4FCA21238AC1304130EA3EAFFFEA20F14
+7F9312>I<EAFC7EA2EA7C7CEA745CEA76DCA61277EA739CA2EA701CA5EAF83EA20F147F
+9312>I<EA3FE0EA7FF0EA7070EAE038AEEA7070EA7FF0EA3FE00D147E9312>79
+D<EAFFE013F8EA383C131C130EA4131C133CEA3FF813E0EA3800A612FEA20F147F9312>
+I<EAFF8013E0EA38F013781338A3137813F0EA3FE013C0EA38E01370A41377A2EAFE3E13
+1C10147F9312>82 D<EA1F30EA3FF01270EAE070A313001270127FEA3FC0EA0FE0EA00F0
+13781338126012E01330EAF070EAFFE0EACF800D147E9312>I<EA7FFE12FFEAE38EA3EA
+0380ADEA0FE0A20F147F9312>I<38FE3F80A238380E00AE6C5A6C5AEA07F06C5A111480
+9312>I<EAFC7EA2EA3838A2EA1C70A2EA0EE0A3EA07C0A2EA0380A7EA0FE0A20F147F93
+12>89 D<EA7FF812FFEAE070A213E01200EA01C0EA0380A2EA0700A2120EA25AEA381CA2
+1270A2EAFFFCA20E147E9312>I<EAFFC0A2EAE000B3A4EAFFC0A20A1A7A9612>I<12C07E
+A21270A27EA27EA37EA27EA2EA0380A2EA01C0A3EA00E0A21370A21338A213180D1A7E96
+12>I<EAFFC0A21201B3A412FFA20A1A7F9612>I<EA1FC0EA3FF0EA3838EA101C1200EA07
+FC123FEA781C12E0A3EA703C383FFF80EA1FCF110E7F8D12>97 D<12F8A21238A4EA3BE0
+EA3FF0EA3C38EA381C130C130EA4130C131CEA3C38EA3FF0EA1BC00F147F9312>I<EA07
+F0EA1FF8EA3838EA7010EA600012E0A41260EA70381238EA1FF0EA07E00D0E7E8D12>I<
+13F8A21338A4EA07B8EA1FF8EA3878EA7038126012E0A41260EA70781238EA1FFEEA0FBE
+0F147F9312>I<EA0780EA1FE0EA38701270EA603812E0EAFFF8A2EAE0001260EA703812
+38EA1FF0EA07C00D0E7E8D12>I<137E13FFEA01C7EA03821380A2EA7FFE12FFEA0380AA
+EA3FF8A21014809312>I<EA0F9EEA1FFFEA38E7EA7070A4EA38E0EA3FC01380EA7000EA
+3FE013F813FCEA701EEAE00EA3EA600CEA783CEA1FF0EA0FE010167F8D12>I<12F8A212
+38A4EA39E0EA3FF0EA3E38123C1238A8EAFE3EA20F147F9312>I<1206120FA21206C7FC
+A3127FA21207AAEAFFF0A20C157D9412>I<12F8A21238A4EA3BFCA2EA38F0EA39E0EA3B
+C0EA3F80A213C0EA3DE0123813701338EAFC7EA20F147F9312>107
+D<B4FCA21207B0EAFFF8A20D147E9312>I<EAF71CEAFFBEEA79E7A2EA71C7A838F9E780
+EAF8E3110E808D12>I<EAF9E0EAFFF0EA3E38123C1238A8EAFE3EA20F0E7F8D12>I<EA0F
+80EA3FE01238EA7070EAE038A5EAF078EA7070EA38E0123FEA0F800D0E7E8D12>I<EAFB
+E0EAFFF0EA3C38EA381C130C130EA4130C131CEA3C38EA3FF0EA3BC0EA3800A512FEA20F
+157F8D12>I<EAFC78EAFDFCEA1F9CEA1E081300121CA7EAFFC0A20E0E7E8D12>114
+D<EA1FF0123FEA607012C0EAE000127FEA3FE0EA0FF0EA0078EA601812E0EAF030EAFFE0
+EADFC00D0E7E8D12>I<1206120EA3EA7FF812FFEA0E00A7131CA3EA07F8EA01E00E127F
+9112>I<EAF8F8A2EA3838A91378EA1FFEEA0FBE0F0E7F8D12>I<EAFC7EA2EA3838A2EA1C
+70A3EA0EE0A4EA07C0A2EA03800F0E7F8D12>I<EAFEFEA2EA701CA3EA3018EA3BB8EA3F
+F8A2EA3AB81238EA1CF0A30F0E7F8D12>I<EA7C7CA2EA1CF0EA0EE0EA0FC01207EA0380
+120713C0EA0EE0EA1EF0EA1C70EAFC7EA20F0E7F8D12>I<EAFC7EA2EA3838121C1370A2
+120E136013E01206A2EA07C01203A21380A3EA7700127F127E12380F157F8D12>I<EA3F
+FC127FEA70381370EA00E0EA01C0EA0380EA0700120EEA1C1C12381270EAFFFCA20E0E7F
+8D12>I<13F81201EA0380EA0700A8120E12FCA2120E7EA8EA0380EA01F812000D1A7E96
+12>I<127812FC120E7EA8EA0380EA01F8A2EA0380EA0700A8120E12FC12780D1A7E9612>
+125 D E /Fh 37 123 df<90383FE3F83901F03F1C3903C03E3E0007137CEA0F80151C15
+00A5B612C0A2390F807C00AE397FE1FFC0A21F1D809C1C>11 D<127812FCA4127806067D
+850D>46 D<1360EA01E0120F12FF12F31203B3A2387FFF80A2111B7D9A18>49
+D<EA07F8EA1FFE38383F8038780FC0EAFC0714E01303A21278EA000714C0A2EB0F80EB1F
+00131E13385B5B38018060EA03001206000813E0381FFFC05A5AB5FCA2131B7E9A18>I<
+EA03F8EA1FFEEA3C1FEB0F80387C07C0127E127C123838000F80A2EB1E005BEA03F8EA00
+1EEB0F80EB07C0A214E01230127812FCA214C038780F80EB1F00EA1FFEEA07F8131B7E9A
+18>I<EB018013031307130F131F133F136F13CF138F1201EA030F1206120C1218123012
+6012C0B512F8A238000F80A63801FFF8A2151B7F9A18>I<B512F814FF390FC01F80EC0F
+C0140715E0A515C0EC0F80EC3F00EBFFFE9038C00F80EC07C015E0140315F0A5EC07E0A2
+EC1FC0B6120014FC1C1C7E9B22>66 D<90381FE0209038FFF8E03803F80F3807C003380F
+800148C7FC123E1560127E127C00FC1400A8007C1460127E123E15C07E390F8001803907
+C003003803F80E3800FFFCEB1FE01B1C7D9B22>I<B6FCA2380FC01F1407801580A2EBC1
+81A3EC800013C313FFA213C313C1A21560A29038C000E015C0A21401A21403EC0F80B6FC
+A21B1C7E9B1F>69 D<D8FFC0EB03FF6D5B000F15F0D80DF0130DA3D80CF81319A2017C13
+31A26D1361A26D13C1A390380F8181A2903807C301A2EB03E6A2EB01FCA3EB00F8A23AFF
+C0701FFFA2281C7E9B2D>77 D<EB3FE03801F07C3803C01E390F800F80391F0007C0001E
+1303003E14E0007E14F0007C1301A200FC14F8A8007C14F0007E1303A2003E14E0003F13
+076C14C0390F800F803903C01E003801F07C38003FE01D1C7D9B24>79
+D<B512F014FE380FC03FEC0F806E7E81A55D4A5A023EC7FCEBFFF0EBC07C80143F6E7EA6
+ED8180A2EC0FC13AFFFC07C300EC01FE211C7E9B24>82 D<3807F820381FFEE0EA3C07EA
+7801EA700012F01460A26C130012FEEAFFE0EA7FFE6C7E1480000F13C06C13E0EA007FEB
+03F01301130012C0A214E07E38F001C0EAFC0338EFFF00EA83FC141C7D9B1B>I<007FB5
+12E0A238781F81007013800060146000E0147000C01430A400001400B03807FFFEA21C1C
+7E9B21>I<EA0FF8EA1C1E383E0F80130714C0121C1200137FEA07E7EA1F07123C127C12
+F8A3EA780B383E13F8EA0FE115127F9117>97 D<B4FCA2121FA9EB3F80EBE1E0EB8070EB
+0078143CA2143EA6143CA21478EB8070381EC1E0381C3F00171D7F9C1B>I<EA03FCEA0E
+0EEA1C1F123C1278130E00F8C7FCA61278EB0180123C381C0300EA0E0EEA03F811127E91
+15>I<EB0FF0A21301A9EA01F9EA0F07EA1C03EA3C011278A212F8A61278A2123CEA1C03
+380F0FFEEA03F9171D7E9C1B>I<EA01FCEA0F07381C0380383C01C0127814E012F8A2B5
+FC00F8C7FCA31278007C1360123C6C13C0380F03803801FC0013127F9116>I<137F3801
+E3803803C7C0EA0787120FEB8380EB8000A5EAFFF8A2EA0F80AEEA7FF8A2121D809C0F>
+I<3803F8F0380E0F38121E381C0730003C1380A4001C1300EA1E0FEA0E0EEA1BF80010C7
+FC1218A2EA1FFF14C06C13E04813F0387801F838F00078A300701370007813F0381E03C0
+3807FF00151B7F9118>I<B4FCA2121FA9EB0FC0EB31E0EB40F0EB80F8A21300AB38FFE7
+FFA2181D7F9C1B>I<121E123FA4121EC7FCA6B4FCA2121FAEEAFFE0A20B1E7F9D0E>I<B4
+FCA2121FA9EB0FF8A2EB0380EB0700130C5B137013F87F13BC133E7F7F1480EB07C0EB03
+E038FFC7FCA2161D7F9C19>107 D<B4FCA2121FB3A7EAFFE0A20B1D7F9C0E>I<39FF0FC0
+7E903831E18F3A1F40F20780D980FC13C0A2EB00F8AB3AFFE7FF3FF8A225127F9128>I<
+38FF0FC0EB31E0381F40F0EB80F8A21300AB38FFE7FFA218127F911B>I<EA01FC380F07
+80381C01C0003C13E0387800F0A200F813F8A6007813F0A2383C01E0381E03C0380F0780
+3801FC0015127F9118>I<38FF3F80EBE1E0381F80F0EB0078147C143C143EA6143C147C
+1478EB80F0EBC1E0EB3F0090C7FCA6EAFFE0A2171A7F911B>I<EAFE3E1347381E8F80A3
+381F070090C7FCAAEAFFF0A211127F9114>114 D<EA1FD8EA3078EA601812E0A2EAF000
+EAFF80EA7FE013F0EA1FF8EA07FCEA007CEAC01CA212E01318EAF830EACFC00E127E9113
+>I<1203A45AA25AA2EA3FFC12FFEA1F00A9130CA4EA0F08EA0798EA03F00E1A7F9913>I<
+38FF07F8A2EA1F00AC1301120F380786FFEA01F818127F911B>I<39FF8FF8FEA2391F03
+E030A201831370000FEBF0601386D807C613C0EBCEF8EBEC790003EB7D80EBF83D0001EB
+3F00A2497E0000131EEBE00EA21F127F9122>119 D<38FFC7FCA2381F8180EA0F833807
+C700EA03EEEA01FC5B1200137C13FEEA01DFEA039F38070F80380607C0380C03E038FF07
+FCA216127F9119>I<38FFC1FCA2381F0060EB80E0000F13C013C03807C180A23803E300
+A2EA01F713F6EA00FE5BA21378A21330A21370EA706012F85BEAF9800073C7FC123E161A
+7F9119>I<383FFF80383C1F00EA303F133E485A13FC5BEA01F01203485AEBC180EA0F81
+121F1303003E1300EA7E07EA7C0FB5FC11127F9115>I E /Fi 55
+124 df<1218123CA31204A21208A21210122012401280060C779C0D>39
+D<EB01C05CA3130391C7FCA35B1306A3B612C0A2D8000CC7FCA2131C1318A313381330A3
+137013601A1A7B9620>43 D<12181238127812381208A21210A212201240A21280050C7D
+830D>I<EAFFC0A30A037D890F>I<1230127812F0126005047C830D>I<14031407140E14
+0C141C141814381430147014E014C013011480130314005B1306130E5B13181338133013
+70136013E05B1201485A90C7FC5A1206120E120C121C121812385A126012E05AA218297F
+9E15>I<133C13C6EA0183EA030312061480120E120C121C1400485AA4EA700EA4485AA3
+5BA21330485A12E0EA60C0EA7180001EC7FC111D7B9B15>I<13021306130C131C137CEA
+039CEA0038A41370A413E0A4EA01C0A4EA0380A41207EAFFF00F1C7C9B15>I<133C13C3
+38010180120214C0EA0441A21208A338108380A238110700EA0E06C65A5B5B13C048C7FC
+12061208485A13021220EA4006EA7E0CEAC7F81283EA80E0121D7C9B15>I<133EEBC180
+EA0101380200C05A1340EA0841A3EB8380EA070338000700130EEA01F8EA0038130CA213
+0EA41270485A12805B1330EA4060EA21C0001FC7FC121D7C9B15>I<EB018014C0EB0380
+A314005BA21306130E130C131C1318A25BA25B134013C6EA018E130E1202EA061C120C12
+18123FEA40F8EA803FEA0038A25BA45B136012247E9B15>I<EBC060EBFFC0481380EBFE
+0090C7FCA21202A4EA0478EA058CEA060612041208EA0007A21306130EA21270130CEAE0
+1CEA80181338EA40305BEA21C0001FC7FC131D7C9B15>I<130FEB308013C0EA01831203
+90C7FC1206120E120C121C13F0EA3B18EA3C0C12381278EA700EA3EA601C12E0A35BA25B
+EA60605BEA2180001EC7FC111D7B9B15>I<131E1361EB8180EA0180380300C0A2380601
+80A3380703001386EA03CC13F01201EA0378EA063CEA081EEA180E1230EA6006A3485AA2
+5BEA60105BEA30C0000FC7FC121D7C9B15>56 D<133C13C6EA0183EA03031206120E000C
+1380121C1400A2485AA35B130EEA181EA2EA0C6CEA079CEA001C1318133813305BEAE0C0
+A2EA81800086C7FC127C111D7B9B15>I<1206120FA212061200AA1230127812F0126008
+127C910D>I<1418A21438A21478A214B8130114381302143CEB041CA213081318131013
+20A2EB7FFCEB401C1380120113001202A2487F120C001C131EB4EBFFC01A1D7E9C1F>65
+D<903803F02090381E0C6090383002E09038E003C03801C001EA038048C7FC000E148012
+1E121C123C15005AA35AA41404A35C12705C6C5B00185B6C485AD80706C7FCEA01F81B1E
+7A9C1E>67 D<48B512E038003C00013813601540A35BA214201500495AA214C013FF3801
+C080A43803810113801402A248485AA2140C5C000E1378B55A1B1C7D9B1C>69
+D<48B512C038003C01EB38001580A35BA214201500495AA214C013FF3801C080A4D80381
+C7FC1380A348C8FCA45AEAFFF01A1C7D9B1B>I<903803F02090381E0C6090383002E090
+38E003C03801C001EA038048C7FC000E1480121E121C123C15005AA35AA2903801FFC090
+38001E00141CA400705BA27E001813786C139038070710D801F8C7FC1B1E7A9C20>I<38
+01FFC038003C001338A45BA45BA4485AA4485AA448C7FCA45AEAFFE0121C7E9B10>73
+D<3801FFE038003C001338A45BA45BA4485AA438038008A31410EA07001430146014E038
+0E03C0B5FC151C7D9B1A>76 D<D801FEEB07F8D8003E1480012EEB0F001517A21527014E
+132E154EA2158E90388E011CA21402A23901070438A21408141000025C1420A214400004
+5C14801400120C381C060139FF861FFC251C7D9B25>I<3901FC03FE39001C0070013C13
+60012E1340A301471380A3EB43809038838100A2138114C1380101C2A2EB00E2A2000213
+E41474A3481338A3000C1318001C1310EAFF801F1C7D9B1F>I<EB07F0EB1C1CEB700E49
+7E3901C00380EA0380EA0700000E14C0121E121C123CA25AA348EB0780A3EC0F00A2140E
+141E5C007013385C00785B383801C06C485AD80E0EC7FCEA03F81A1E7A9C20>I<3801FF
+FC38003C079038380380EC01C0A3EB7003A31580EBE0071500140E14383801FFE001C0C7
+FCA3485AA448C8FCA45AEAFFE01A1C7D9B1C>I<3801FFF838003C0EEB3807EC0380A3EB
+7007A3EC0F00EBE00E5C1470EBFFC0EA01C014601470A2EA0380A4380700F01540A21580
+48137839FFE07900C7121E1A1D7D9B1E>82 D<EB0F84EB304CEB403CEB8018EA01005AA2
+00061310A214001207A2EA03E013FC6CB4FC38007F80EB07C01301A21300A21220A23860
+0180A2EB03001302EAF004EACC18EA83E0161E7D9C17>I<001FB512C0381C070138300E
+0000201480126012405B1280A2000014005BA45BA45BA4485AA41203EA7FFE1A1C799B1E
+>I<397FF0FF80390F001C00000E13181410A3485BA4485BA4485BA44848C7FCA31302A2
+5BA2EA6008EA3030EA1040EA0F80191D779B1F>I<3901FF81FE39001E00F0011C136001
+1E1380EB0E011500EB0F026D5A5C1490EB03A014C01301A28013021304497EEB10701320
+EB60381340EB803C3801001C12020006131E121E39FF80FFC01F1C7E9B1F>88
+D<EA03CCEA063C120CEA181CEA383812301270A2EAE070A413E212C0A2EA61E4EA6264EA
+3C380F127B9115>97 D<123F1207A2120EA45AA4EA39C0EA3E60EA3830A2EA7038A4EAE0
+70A3136013E0EAC0C012C1EA6180EA6300123C0D1D7B9C13>I<EA01F0EA0708120CEA18
+1CEA3838EA30001270A25AA513081310EA6020EA30C0EA1F000E127B9113>I<EB1F8013
+03A2EB0700A4130EA4EA03DCEA063C120CEA181CEA383812301270A2485AA413E212C0A2
+EA61E4EA6264EA3C38111D7B9C15>I<EA01E0EA0710120CEA1808EA381012701360EA7F
+80EAE000A51308EA60101320EA30C0EA1F000D127B9113>I<EB03C0EB0670130CEB1C60
+1400A25BA53803FF8038007000A55BA5485AA5485AA390C7FCA25A12C612E65A12781425
+819C0D>I<13F3EA018FEA030FEA0607EA0E0E120C121CA2EA381CA413381230A2EA1878
+13F0EA0F701200A213E0A2EAC0C012E1EAC300127E101A7D9113>I<EA0FC01201A2485A
+A448C7FCA4EA0E78138CEA0F0E120E121CA4485AA35B00701380A21370EB7100EAE032EA
+601C111D7D9C15>I<EA01801203EA0100C7FCA7121C12261247A2128EA2120E5AA35AA2
+1271A31272A2123C091C7C9B0D>I<EA1F801203A2EA0700A4120EA45AA45AA45AA412E4
+A412681238091D7C9C0B>108 D<393C1E078039266318C0394683A0E0384703C0008E13
+80A2120EA2391C0701C0A3EC0380D8380E1388A2EC0708151039701C032039300C01C01D
+127C9122>I<EA3C3CEA2646EA4687EA4707128EA2120EA2EA1C0EA35B00381340A21338
+148038701900EA300E12127C9117>I<EA01E0EA0718EA0C0C12181238EA300E1270A2EA
+E01CA31318133813301360EA60C0EA3180EA1E000F127B9115>I<EA07873804D9803808
+E0C0A23811C0E0A21201A2380381C0A31480EA070314005B1306EA0E8C137090C7FCA25A
+A4123CB47E131A7F9115>I<EA03C4EA062CEA0C3CEA181CEA383812301270A2EAE070A4
+13E012C0A21261EA63C0123D1201A2EA0380A41207EA3FF00E1A7B9113>I<EA3C3CEA26
+C2EA4687EA4707EA8E061300120EA25AA45AA45A123010127C9112>I<EA01F0EA060812
+0C131CEA1818EA1C00121F13C0EA0FF01207EA00781338EA603012E012C0EA8060EA60C0
+EA1F000E127D9111>I<13C01201A3EA0380A4EAFFE0EA0700A3120EA45AA4EA3840A313
+80EA1900120E0B1A7D990E>I<EA1E03EA27071247A2EA870EA2120EA2485AA438383880
+A21218EB3900EA1C59EA078E11127C9116>I<381E0183382703871247148338870701A2
+120EA2381C0E02A31404EA180C131C1408001C1310380C26303807C3C018127C911C>
+119 D<EA070EEA19913810E38012203841C30013C01201A2485AA4EA07021267EAE70412
+CBEA8B08EA70F011127D9113>I<EA1E03EA27071247A2EA870EA2120EA2EA1C1CA4EA38
+38A21218A2EA1C70EA07F0EA0070A213E0EAE0C012E1EA8180EA4700123C101A7C9114>
+I<B512C012017C8B15>123 D E /Fj 38 123 df<90380FF83F90397FFDFFC03A01F81F
+E3E03903E03F87EA07C0D80F801307ED03C06EC7FCA6B612FCA2260F801FC7FCB2397FF0
+FFF0A223237FA221>11 D<1238127C12FE12FFA2127F123B1203A212071206A2120C121C
+12181270122008117CA210>39 D<1238127C12FEA3127C123807077C8610>46
+D<13181378EA01F812FFA21201B3A7387FFFE0A213207C9F1C>49
+D<EA03FCEA0FFF383C1FC0387007E0007C13F0EAFE0314F8A21301127CEA3803120014F0
+A2EB07E014C0EB0F80EB1F00133E13385BEBE018EA01C0EA0380EA0700000E1338380FFF
+F05A5A5AB5FCA215207D9F1C>I<13FE3807FFC0380F07E0381E03F0123FEB81F8A3EA1F
+0314F0120014E0EB07C0EB1F803801FE007F380007C0EB01F014F8EB00FCA2003C13FE12
+7EB4FCA314FCEA7E01007813F8381E07F0380FFFC03801FE0017207E9F1C>I<14E01301
+1303A21307130F131FA21337137713E7EA01C71387EA03071207120E120C121812381270
+12E0B512FEA2380007E0A7EBFFFEA217207E9F1C>I<00101320381E01E0381FFFC01480
+14005B13F8EA1BC00018C7FCA4EA19FCEA1FFF381E0FC0381807E01303000013F0A214F8
+A21238127C12FEA200FC13F0A2387007E0003013C0381C1F80380FFF00EA03F815207D9F
+1C>I<1470A214F8A3497EA2497EA3EB06FF80010E7FEB0C3FA201187F141F01387FEB30
+0FA201607F140701E07F90B5FCA239018001FCA200038090C7FCA20006147FA23AFFE00F
+FFF8A225227EA12A>65 D<B67E15E03907F001F86E7E157EA2157FA5157E15FE5DEC03F8
+90B55AA29038F001FCEC007E811680151F16C0A6ED3F80A2ED7F00EC01FEB612F815C022
+227EA128>I<D903FE138090381FFF819038FF01E33901F8003FD803E0131F4848130F48
+481307121F48C71203A2481401127EA200FE91C7FCA8127EED0180127F7E15036C6C1400
+120F6C6C1306D803F05B6C6C13386CB413F090381FFFC0D903FEC7FC21227DA128>I<B6
+7E15F03907F003FCEC007E81ED1F80ED0FC0ED07E0A216F01503A316F8A916F0A3ED07E0
+A2ED0FC0ED1F80ED3F00157EEC03FCB612F0158025227EA12B>I<B612FCA23807F00015
+3C151C150C150EA215061418A3150014381478EBFFF8A2EBF07814381418A21503A21400
+1506A3150EA2151E153EEC01FCB6FCA220227EA125>I<B612F8A23807F001EC00781538
+1518151CA2150CA21418A21500A214381478EBFFF8A2EBF07814381418A491C7FCA8B512
+E0A21E227EA123>I<D903FE134090391FFFC0C090387F00F1D801F8133F4848130FD807
+C01307000F1403485A48C71201A2481400127EA200FE1500A791380FFFFC127E007F9038
+001FC0A27EA26C7E6C7E6C7E6C7ED801FC133F39007F80E790381FFFC30103130026227D
+A12C>I<B512E0A2D807F0C7FCB31518A41538A21570A215F014011407B6FCA21D227EA1
+22>76 D<EB07FC90383FFF809038FC07E03903F001F848486C7E4848137E48487FA248C7
+EA1F80A24815C0007E140FA200FE15E0A9007E15C0007F141FA26C15806D133F001F1500
+6C6C137E6C6C5B6C6C485A3900FC07E090383FFF80D907FCC7FC23227DA12A>79
+D<B6FC15E03907F007F0EC01FC1400157EA2157FA5157EA215FC1401EC07F090B512E015
+0001F0C7FCADB57EA220227EA126>I<B512FEECFFC03907F007F0EC01F86E7E157E157F
+A6157E5D4A5AEC07F090B512C05D9038F00FE06E7E6E7E6E7EA81606EC00FEEDFF0CB538
+803FF8ED0FF027227EA12A>82 D<007FB61280A2397E03F80F0078140700701403006014
+0100E015C0A200C01400A400001500B3A20003B512F8A222227EA127>84
+D<B53A0FFFF01FFEA2260FF00090C712E000076E14C0A26C6C9138800180153F6D150300
+0103C01300A26C6C90387FE006156F7F6D9038C7F00CA20280EBF81C90263F81831318A2
+D91FC36D5A150114E3903A0FE600FE60A202F6EBFFE0D907FC6D5AA201035D4A133FA26D
+486DC7FCA20100141E4A130EA237227FA13A>87 D<EA07FC381FFF80383F07C0EB03E013
+0114F0121E1200A2133FEA03FDEA1FC1EA3F01127E12FCA4EA7E02EB0CF8381FF87F3807
+E03F18167E951B>97 D<EBFF80000713E0380F83F0EA1F03123E127E387C01E090C7FC12
+FCA6127C127EA2003E13306C1360380FC0E03807FF803800FE0014167E9519>99
+D<EB01FEA2EB003EABEA01FC3807FFBE380F81FE381F007E003E133E127E127C12FCA812
+7CA26C137E001E13FE380F83BE3907FF3FC0EA01FC1A237EA21F>I<13FE3807FF80380F
+87C0381E01E0003E13F0EA7C0014F812FCA2B5FCA200FCC7FCA3127CA2127E003E13186C
+1330380FC0703803FFC0C6130015167E951A>I<3803FC1E380FFF7F381F0F8F383E07CF
+383C03C0007C13E0A5003C13C0EA3E07381F0F80EBFF00EA13FC0030C7FCA21238383FFF
+806C13F06C13F84813FCEA380048133E00F0131EA40078133C007C137C383F01F8380FFF
+E00001130018217E951C>103 D<B4FCA2121FABEB07E0EB1FF8EB307CEB403CEB803EA2
+1300AE39FFE1FFC0A21A237EA21F>I<121C123E127FA3123E121CC7FCA7B4FCA2121FB2
+EAFFE0A20B247EA310>I<3AFF07F007F090391FFC1FFC3A1F303E303E01401340496C48
+7EA201001300AE3BFFE0FFE0FFE0A22B167E9530>109 D<38FF07E0EB1FF8381F307CEB
+403CEB803EA21300AE39FFE1FFC0A21A167E951F>I<13FE3807FFC0380F83E0381E00F0
+003E13F848137CA300FC137EA7007C137CA26C13F8381F01F0380F83E03807FFC03800FE
+0017167E951C>I<38FF0FE0EB3FF8381FF07CEB803E497E1580A2EC0FC0A8EC1F80A290
+38803F00EBC03EEBE0FCEB3FF8EB0FC090C8FCA8EAFFE0A21A207E951F>I<EAFE1FEB3F
+C0381E67E013C71387A2381F83C090C7FCADEAFFF0A213167E9517>114
+D<EA0FF3EA3FFFEA781FEA6007EAE003A212F000FCC7FCEA7FE013F8EA3FFEEA0FFF1201
+38000F80EAC007130312E0A238F00700EAFC0EEAEFFCEAC7F011167E9516>I<487EA412
+03A21207A2120F123FB5FCA2EA0F80ABEB8180A5EB8300EA07C3EA03FEEA00F811207F9F
+16>I<38FF01FEA2381F003EAF147E14FE380F81BE3907FF3FC0EA01FC1A167E951F>I<39
+FFE01FE0A2390F800600A2EBC00E0007130CEBE01C00031318A26C6C5AA26C6C5AA2EB7C
+C0A2137F6D5AA26DC7FCA2130EA21B167F951E>I<387FFFF0A2387C03E0387007C0EA60
+0F38E01F8000C01300133E137EC65A5B485A00031330EA07E013C0380F8070121F383F00
+60003E13E0EA7C03B5FCA214167E9519>122 D E /Fk 4 122 df<EA07E0EA1FF8EA3FFC
+EA7FFEA2B5FCA6EA7FFEA2EA3FFCEA1FF8EA07E010107E9115>15
+D<133C13E0EA01C013801203AD13005A121C12F0121C12077E1380AD120113C0EA00E013
+3C0E297D9E15>102 D<12F0121C12077E1380AD120113C0EA00E0133C13E0EA01C01380
+1203AD13005A121C12F00E297D9E15>I<12021207A61202A3EA7270EAFFF8EA7270EA02
+00A21207B11202A60D267E9C12>121 D E /Fl 12 114 df<38078010EA1FC0383FE020
+EA7FF03860304038C01080128038000900A2130AA3130CA21308A31318A35BA45BA21340
+141B7F9115>13 D<126012F0A2126004047C830C>58 D<126012F0A212701210A41220A2
+12401280040C7C830C>I<140CA2141CA2143C147C145C149C148EEB010EA213021304A2
+1308A213101320EB3FFEEB4007A21380EA0100A21202A21206121E39FF807FF01C1D7F9C
+1F>65 D<3801FFE038003C001338A45BA45BA4485AA438038002A31404EA0700140C1418
+1438000E13F0B5FC171C7E9B1C>76 D<3801FFFE39003C03C090383800E015F01570A249
+13F0A3EC01E001E013C0EC0780EC1E00EBFFF03801C03080141CA2EA0380A43807003C15
+08A2151048131E39FFE00E20C7EA07C01D1D7E9B20>82 D<EB0FC1EB3033EB400FEB8006
+1201EA0300A200061304A200071300A27FEA03F06CB4FC6C13C0EB3FE01303EB00F01470
+1430A21220A200601360A214C0148038F00300EACC06EA83F8181E7E9C19>I<EA01E3EA
+0717EA0C0F1218EA380E12301270A2485AA4EB3880A3EA607838319900EA1E0E11127E91
+16>97 D<123F1207A2120EA45AA4EA39E0EA3A30EA3C1812381270131CA3EAE038A31330
+1370136013C01261EA2300121E0E1D7E9C12>I<EA01F0EA030C120EEA1C1EEA383CEA30
+18EA7000A25AA51304EA60081310EA3060EA1F800F127E9112>I<EA381F384E61803846
+81C0EA4701128F128E120EA2381C0380A3EB070000381310A2130E142038700640383003
+8014127E9119>110 D<EA01C2EA0626EA0C1E1218EA381C12301270A2EAE038A41370A3
+EA60F0EA23E0121C1200A2EA01C0A41203EA1FF80F1A7E9113>113
+D E /Fm 77 125 df<126012F0AF12601200A4126012F0A212600419779816>33
+D<EAE038EAF078A7EAE038A2EA60300D0B7C9816>I<EA0387A6387FFFC0B512E0A23807
+0E00A3EA0E1CA4B512E0A26C13C0381C3800A613197F9816>I<13C01201A3EA07F0EA1F
+FC48B4FCEA7DCF38F1C78012E1A338F1C300EA79C0127FEA1FF0EA07FCEA01FE13CFEBC7
+80EAF1C3A3EAE1C712F13879DF00EA3FFE6C5AEA07E0EA01C0A2120011207E9C16>I<EA
+0380EA07E0120FEA1E70121CA3EB77E013E7121D380FC700138E130E121EEA3F1C127FEA
+739CEAE3F812E138E0F1C0A2EA71F9EA7FFF383F9F80381E070013197F9816>38
+D<1218123C123E121E120EA3121E121C123C127812F01260070D799816>I<13E01201EA
+07C013005A121E5A123812781270A312F05AA77E1270A312781238123C7E7E7E13C0EA01
+E012000B217A9C16>I<12E07E127C121C121E7EEA0780120313C01201A313E01200A712
+0113C0A3120313801207EA0F00121E121C127C12F05A0B217C9C16>I<EA01C0A4EA71C7
+38F9CF80387FFF00EA1FFCEA07F0A2EA1FFCEA7FFF38F9CF803871C700EA01C0A411127E
+9516>I<EA01C0A8B51280A33801C000A811137E9516>I<1238127C127EA2123E120E121E
+123C127C12F81260070B798416>I<B51280A311037E8D16>I<127012F8A3127005057884
+16>I<EB01801303A2EB0700A2130EA25BA25BA25BA25BA2485AA2485AA248C7FCA2120E
+A25AA25AA25AA25AA25A11207E9C16>I<EA03E0EA0FF8487EEA1E3CEA380EEA780FEA70
+07A238E00380A8EAF00700701300A2EA780FEA3C1E6C5AEA1FFC6C5AEA03E011197E9816
+>I<EA01801203A21207120F127F12FF12731203AEEA7FF813FC13F80E197C9816>I<EA07
+E0EA1FF8EA7FFEEA783FEAF00FEB07801303A21200A2130714005B131E5B5B5BEA03E0EA
+078048C7FC381E0380123CEA7FFFB5FC7E11197E9816>I<EA07E0EA1FFCEA7FFEEA781F
+7F7F12005BA2133EEA07FC5B7FEA001E130714801303A212F013071400EAF81FEA7FFE6C
+5AEA07E011197E9816>I<137C13FC13DC1201EA039CA2EA071C120F120E121E123C1238
+127812F0B512E0A338001C00A53801FFC0A313197F9816>I<EA3FFEA30038C7FCA7EA3B
+F0EA3FFC7FEA3C0FEA3007000013801303126012F01307EB0F006C5AEA7FFEEA1FF8EA07
+E011197E9816>I<13F8EA03FEEA0FFFEA1F0F123E123CEA78060070C7FC12F0EAF3F8EA
+EFFE12FFEAF80F38F00780A2EAE00312F0A21270EA7807EB0F006C5AEA1FFEEA0FF8EA03
+E011197E9816>I<12E0B51280A338E00F00131EEA001C5B137813705BA2485AA3485AA4
+48C7FCA7111A7E9916>I<EA07F0EA1FFC487EEA7C1F38F00780EAE003A338700700EA7C
+1FEA1FFCEA07F0EA1FFCEA3C1EEA700700F01380EAE003A3EAF00700701300EA7C1FEA3F
+FE6C5AEA07F011197E9816>I<EA03E0EA0FF8EA3FFCEA7C1EEA780F487E12E01480A213
+03EAF007A2EA780FEA3FFF13FBEA0FE3EA00071400EA300FEA780E131E137CEA7FF8EA3F
+E0EA0F8011197E9816>I<127012F8A312701200A8127012F8A312700512789116>I<1238
+127CA312381200A81238127CA3123C121C123C123812F812F012600618799116>I<EB01
+801307131FEB3E0013F8485AEA07C0485A003EC7FC12FC12F012FC123EEA0F806C7EEA01
+F06C7E133EEB1F801307130111157E9616>I<EA7FFFB51280A2C8FCA5B51280A26C1300
+110B7E9116>I<12C012F012FC123EEA0F806C7EEA01F06C7E133EEB1F801307131FEB3E
+0013F8485AEA07C0485A003EC7FC12FC12F012C011157E9616>I<EA0FE0EA3FF8EA7FFC
+EAF01E130EA2EA601EEA007C13F8EA01F0EA03E013C01380A41300C7FCA41203EA0780A2
+EA03000F197D9816>I<13E0487EA213B0A2EA03B8A31318EA071CA5EA0E0EA2EA0FFEA2
+487EEA1C07A3387F1FC000FF13E0007F13C013197F9816>65 D<3801F180EA07FF5AEA1F
+0FEA3C0712781303127000F0C7FC5AA77E387003801278A2EA3C07381F0F00EA0FFE6C5A
+EA01F011197E9816>67 D<EA7FF8EAFFFE6C7EEA1C0FEB0780EB03C01301A214E01300A8
+EB01C0A21303EB0780130F387FFF00485AEA7FF81319809816>I<387FFFC0B5FC7EEA1C
+01A490C7FCA2131CA2EA1FFCA3EA1C1CA290C7FC14E0A5EA7FFFB5FC7E13197F9816>I<
+B512E0A3EA1C00A41400A2131CA2EA1FFCA3EA1C1CA290C7FCA6B47E7F5B13197F9816>
+I<387F1FC038FFBFE0387F1FC0381C0700A7EA1FFFA3EA1C07A9387F1FC038FFBFE0387F
+1FC013197F9816>72 D<EAFFFEA3EA0380B3EAFFFEA30F197D9816>I<387F0FE038FF8F
+F0387F0FE0381C0780EB0F00130E5B133C5B5B5BEA1DF0121F7F1338EA1E1C121C7FA27F
+A2EB0380387F07E038FF8FF0387F07E01419809816>75 D<EAFFC0A3001CC7FCAE144014
+E0A4B5FCA313197F9816>I<38FC07E0EAFE0FA2383A0B80EA3B1BA513BBEA39B3A413F3
+EA38E3A21303A538FE0FE0A313197F9816>I<387E1FC038FF3FE0387F1FC0381D070013
+87A313C7A2121CA213E7A31367A21377A21337A31317EA7F1FEAFF9FEA7F0F13197F9816
+>I<EA1FFC487E487EEA780F38F00780EAE003AEEAF007A238780F00EA7FFF6C5A6C5A11
+197E9816>I<EA7FF8EAFFFE6C7E381C0F80130314C01301A313031480130F381FFF005B
+13F8001CC7FCA7127F487E6CC7FC12197F9816>I<EA7FE0EAFFF86C7EEA1C1E7F7FA45B
+131EEA1FFC5B7FEA1C1C7FA414201470A2387F07E0EAFF87387F03C014197F9816>82
+D<EA07E3EA1FFF127FEA781F487E487EA290C7FC7E1278EA7F80EA1FF0EA07FCC67E130F
+EB07801303A212E0A2EAF00738F80F00EAFFFE5BEAC7F011197E9816>I<387FFFE0B5FC
+A2EAE0E0A400001300AFEA07FC487E6C5A13197F9816>I<387F07F038FF8FF8387F07F0
+381C01C0B0380E0380A23807070013FF6C5AEA00F81519809816>I<387F1F80133F131F
+380E1E00131CEA073C1338EA03B813F012015B120012017F120313B81207131CA2EA0E0E
+A2487E387F1FC000FF13E0007F13C013197F9816>88 D<38FE0FE0EAFF1FEAFE0F381C07
+00A2EA0E0EA26C5AA3EA03B8A2EA01F0A26C5AA8EA03F8487E6C5A13197F9816>I<EAFF
+F0A3EAE000B3A8EAFFF0A30C20789C16>91 D<12C07EA21270A27EA27EA27EA27EA26C7E
+A26C7EA26C7EA21370A27FA27FA27FA27FA2EB0380A2130111207E9C16>I<EAFFF0A3EA
+0070B3A8EAFFF0A30C207F9C16>I<120C121E123C1278127012F012E0A312F012F81278
+1230070D789B16>96 D<EA1FE0EA7FF87FEA783CEA301EEA000EA2EA03FE121FEA7E0E12
+F012E0A2EAF01EEAF83E387FFFE0EA3FE7EA0F8313127E9116>I<127E12FE127E120EA4
+133EEBFF80000F13C0EB83E01301380E00F0A21470A414F0000F13E01301EB83C013FF00
+0E1300EA063C1419809816>I<EA03F8EA0FFE121FEA3C1EEA780CEA700012F05AA47EEA
+70071278EA3E0FEA1FFEEA0FFCEA03F010127D9116>I<133F5B7F1307A4EA03C7EA0FF7
+EA3FFFEA3C1F487E487EA212E0A412F05BEA781FEA7C3F383FFFE0381FF7F03807C7E014
+197F9816>I<EA03E0EA0FF8EA1FFCEA3C1EEA780EEA700712E0B5FCA3EAE000A2EA7007
+1278EA3C0FEA1FFEEA0FFCEA03F010127D9116>I<131FEB7F8013FFEA01E7EBC30013C0
+A2EA7FFFB5FCA2EA01C0ACEA3FFE487E6C5A11197F9816>I<3803E3C0380FFFE05A381E
+3CC0383C1E00EA380EA3EA3C1E6C5AEA1FFC5BEA3BE00038C7FCA2EA1FFC13FF4813C0EA
+780338F001E0EAE000A3EAF001387C07C0383FFF80380FFE00EA03F8131C7F9116>I<12
+7E12FE127E120EA4133C13FF000F138013871303A2120EA9387FC7F038FFE7F8387FC7F0
+1519809816>I<EA0180EA03C0A2EA0180C7FCA4EA7FC0A31201ACEA7FFFB5FC7E101A7D
+9916>I<EAFFC0A31201B3B51280A311197E9816>108 D<38F9C38038FFEFC0EBFFE0EA3E
+7CEA3C78EA3870AA38FE7CF8A2EB3C781512809116>I<EA7E3CEAFEFF007F1380EA0F87
+1303A2120EA9387FC7F038FFE7F8387FC7F01512809116>I<EA03E0EA0FF8487EEA3C1E
+487EEA700738E00380A5EAF00700701300EA780FEA3C1EEA1FFC6C5AEA03E011127E9116
+>I<EA7E3E38FEFF80007F13C0380F83E01301380E00F0A21470A414F0000F13E01301EB
+83C013FF000E1300133C90C7FCA6EA7FC0487E6C5A141B809116>I<EA07C7EA1FF748B4
+FCEA7C3FEA781F487E7F12E0A412F05BEA781FEA7C3FEA3FFFEA1FF7EA07C7EA0007A6EB
+3FE0EB7FF0EB3FE0141B7E9116>I<38FF0FC0EB3FE0137F3807F040EBE0005B5BA290C7
+FCA7EAFFFCA313127F9116>I<EA0FECEA3FFC127FEAF03CEAE01CA2EAF000EA7F80EA1F
+F0EA07FCEA003EEAE00EA212F0EAF81EEAFFFC13F8EAC7E00F127D9116>I<12035AA4EA
+7FFFB5FCA20007C7FCA75BEB0380A2130713873803FF005BEA00F811177F9616>I<387E
+1F80EAFE3FEA7E1FEA0E03AA1307EA0F0FEBFFF06C13F83803E3F01512809116>I<38FF
+1FE013BF131F38380380A413E33819F300A213B3EA1DB7A4EA0F1EA313127F9116>119
+D<387F1FC0133F131F380F1C00EA073CEA03B813F012016C5A12017FEA03B8EA073C131C
+EA0E0E387F1FC038FF3FE0387F1FC013127F9116>I<387F1FC038FF9FE0387F1FC0381C
+0700120E130EA212075BA2EA039CA21398EA01B8A2EA00F0A35BA3485A1279127BEA7F80
+6CC7FC123C131B7F9116>I<383FFFC05AA238700780EB0F00131EC65A5B485A485AEA07
+8048C7FC381E01C0123C1278B5FCA312127F9116>I<12E0B3AE0320779C16>124
+D E /Fn 10 58 df<121FEA3180EA60C0EA4040EAC060A8EA4040EA60C0EA3180EA1F00
+0B107F8F0F>48 D<120C123C12CC120CACEAFF8009107E8F0F>I<121FEA6180EA40C0EA
+806012C01200A213C0EA0180EA030012065AEA10201220EA7FC012FF0B107F8F0F>I<12
+1FEA2180EA60C0A2120013801201EA0F00EA00801340136012C0A2EA8040EA6080EA1F00
+0B107F8F0F>I<1203A25A5A120B121312331223124312C3EAFFE0EA0300A4EA1FE00B10
+7F8F0F>I<EA2080EA3F00122C1220A3122FEA3080EA2040EA0060A312C0EA80C0EA6180
+EA1F000B107F8F0F>I<EA0780EA1840EA30C0126013005A12CFEAF080EAE040EAC060A3
+1240EA60C0EA3080EA1F000B107F8F0F>I<1240EA7FE013C0EA8080A2EA010012025AA2
+120C1208A21218A50B117E900F>I<121FEA3180EA60C0A3EA7180EA3F00120FEA3380EA
+61C0EAC060A3EA4040EA6080EA1F000B107F8F0F>I<121FEA3180EA60C0EAC0401360A3
+EA40E01221EA1E6012001340EA60C01380EA4300123E0B107F8F0F>I
+E /Fo 66 124 df<EBFCF83807839CEA0E07001C13081400A5B512E0381C0700AC38FF1F
+E01617809615>11 D<13FCEA0782EA0E07121C130290C7FCA4B5FCEA1C07AC38FF1FE013
+17809614>I<13FFEA0707120E121CA6B5FCEA1C07AC38FFBFE01317809614>I<12011202
+1204120C1218A21230A212701260A312E0AA1260A312701230A21218A2120C1204120212
+0108227D980E>40 D<12801240122012301218A2120CA2120E1206A31207AA1206A3120E
+120CA21218A2123012201240128008227E980E>I<126012F0A212701210A21220A21240
+A2040A7D830A>44 D<EAFF80A2090280870C>I<126012F0A2126004047D830A>I<130813
+181330A31360A313C0A3EA0180A3EA0300A21206A35AA35AA35AA35AA35AA20D217E9812
+>I<12035AB4FC1207B1EA7FF00C157E9412>49 D<EA0F80EA30E0EA4070EA8030EAC038
+12E0124012001370A2136013C0EA0180EA03001206EA0C081208EA1018EA3FF0127F12FF
+0D157E9412>I<EA0FE0EA3030EA6018EA701CA21200131813381360EA07E0EA00301318
+130C130EA212E0A2EAC00CEA4018EA3030EA0FE00F157F9412>I<1330A2137013F01201
+1370120212041208121812101220124012C0EAFFFEEA0070A5EA03FE0F157F9412>I<EA
+2030EA3FE013C0EA24001220A4EA2F80EA30E0EA2070EA00301338A2124012E0A2EA8030
+EA4060EA20C0EA1F000D157E9412>I<EA01F0EA0608EA080CEA181C1230EA7000126012
+E0EAE3E0EAEC30EAF018130CEAE00EA31260A2EA300C1318EA1830EA07C00F157F9412>
+I<1240EA7FFE13FC13F8EAC008EA80101320EA00401380A2EA0100A25A12021206A2120E
+A512040F167E9512>I<EA07C0EA1830EA30181260EAE00CA2130EA3EA601E1230EA186E
+EA0F8EEA000E130C131CEA7018A2EA6030EA20C0EA1F800F157F9412>57
+D<B512FCA2C8FCA6B512FCA2160A7E8C1B>61 D<13101338A3135CA3138EA3EA0107A200
+031380EA0203A23807FFC0EA0401A2380800E0A21218003813F038FE03FE17177F961A>
+65 D<EAFFFE381C0380EB00E014601470A414E0EB01C0381FFF8014C0381C00E0147014
+301438A4147014E0EB01C0B5120015177F9619>I<EBFC1038038330380E00B048137048
+1330123000701310126012E01400A51410126012700030132012386C13406C1380380383
+00EA00FC14177E9619>I<B5FC381C01C0EB00E0143014381418141C140C140EA7140C14
+1CA2143814301460EB01C0B5120017177F961B>I<B512E0EA1C00146014201410A3EB04
+00A3130CEA1FFCEA1C0C13041408A2130014181410A2143014F0B5FC15177F9618>I<B5
+12E0EA1C00146014201410A3EB0400A3130CEA1FFCEA1C0C1304A390C7FCA6EAFFC01417
+7F9617>I<EB7E0838038198380600584813384813185A00701308A25A1400A4EB03FEEB
+00381270A212307E7E7E380380D838007F0817177E961C>I<EAFFE0EA0E00B3A3EAFFE0
+0B177F960D>73 D<38FF80FE381C0078146014401480EB0100130613085B13381378139C
+EA1D0E121EEA1C07EB0380EB01C0A2EB00E014701478147C38FF80FF18177F961B>75
+D<EAFFC0001CC7FCAD1420A31460A2144014C01303B5FC13177F9616>I<00FEEB03F800
+1E14C000171305A338138009A23811C011A33810E021A2EB7041A3EB3881A2EB1D01A213
+0EA2123839FE040FF81D177F9620>I<00FC13FE001E1338001F13101217EA1380EA11C0
+A2EA10E013701338A2131C130E130F1307EB0390EB01D0A2EB00F014701430123800FE13
+1017177F961A>I<13FCEA0303380E01C0381C00E0481370003013300070133800601318
+00E0131CA700701338A200301330003813706C13E0380E01C038030300EA00FC16177E96
+1B>I<EAFFFE381C0380EB00C014601470A4146014C0EB0380381FFE00001CC7FCAAB47E
+14177F9618>I<EAFFFC381C0380EB00C014E01470A414E014C0EB0380381FFE00381C07
+80EB01C0EB00E0A514E1A2147238FF803C18177F961A>82 D<EA0FC4EA302CEA601CEA40
+0CEAC004A3EAE0001270127FEA3FE0EA0FF8EA01FCEA001C130E13061280A3EAC004EAE0
+08EAD810EA87E00F177E9614>I<387FFFF83860381800401308A200801304A300001300
+AF3807FFC016177F9619>I<38FF80FE383C0038001C1310A26C1320A26C1340A3380380
+80A213C100011300A2EA00E2A213F61374A21338A3131017177F961A>86
+D<38FF83FC381F01E0380E00807EEB8100EA0382EA01C213E4EA00E81378A21338137C13
+5E138EEA0187EB0780EA0203380601C0000413E0EA0C00001C13F038FF03FE17177F961A
+>88 D<12FCA212C0B3AB12FCA206217D980A>91 D<12FCA2120CB3AB12FCA2062180980A
+>93 D<EA1FC0EA38601330EA10381200EA03F8EA1E3812301270EAE039A21379EA70FFEA
+1F1E100E7F8D12>97 D<12FC121CA813F8EA1F06EA1C031480130114C0A4148013031400
+EA1B0EEA10F81217809614>I<EA07F0EA18381230EA7010EA600012E0A41260EA700812
+30EA1830EA07C00D0E7F8D10>I<137E130EA8EA07CEEA1C3EEA300E1270126012E0A412
+601270EA301EEA182E3807CFC012177F9614>I<EA0FC0EA1860EA3030EA7038EAE018EA
+FFF8EAE000A31260EA7008EA3010EA1830EA07C00D0E7F8D10>I<EA03E0EA0670120EEA
+1C201300A5EAFF80EA1C00ACEAFF800C1780960B>I<EA0F9EEA18E3EA3060EA7070A3EA
+3060EA18C0EA2F80EA20001260EA3FE013F813FCEA600EEAC006A3EA600CEA3838EA0FE0
+10157F8D12>I<12FC121CA8137CEA1D8EEA1E07121CAA38FF9FE01317809614>I<121812
+3CA212181200A5127C121CAC12FF081780960A>I<1203EA0780A2EA0300C7FCA5EA1F80
+1203AF1243EAE30012E7127C091D82960B>I<12FC121CA8EB3F80EB1C00131813205B13
+C0EA1FE0EA1CF0137013787F7FA238FF3FC01217809613>I<12FC121CB3A3EAFF800917
+80960A>I<38FC7C1F391D8E6380391E0781C0001C1301AA39FF9FE7F81D0E808D1E>I<EA
+FC7CEA1D8EEA1E07121CAA38FF9FE0130E808D14>I<EA07C0EA1830EA3018EA600CA2EA
+E00EA5EA701CEA3018EA1830EA07C00F0E7F8D12>I<EAFCF8EA1F0EEA1C031480130114
+C0A414801303EB0700EA1F0EEA1CF890C7FCA5B47E1214808D14>I<EA07C2EA1C26EA38
+1EEA700E126012E0A412601270EA301EEA1C2EEA07CEEA000EA5EB7FC012147F8D13>I<
+EAFCF0EA1D38121EEA1C101300A9EAFF800D0E808D0E>I<EA1F40EA60C0EAC040A2EAE0
+00B4FCEA7F80EA1FC0EA01E0EA8060A212C0EAE0C0EA9F000B0E7F8D0E>I<1208A31218
+A21238EAFF80EA3800A71340A4EA1C80EA0F000A147F930E>I<EAFC3FEA1C07AA5BEA0E
+173803E7E0130E808D14>I<EAFE1FEA3C0E130CEA1C08A2EA0E10A2EA0720A2EA03C0A3
+EA0180A2100E7F8D13>I<38FCFE7C383838381410381C3C20A2134C380E4E40A2138638
+078780A2130300031300A2160E7F8D19>I<EAFE3FEA3C18EA1C10EA0E20EA074013C0EA
+0380EA01C0EA02E0EA04F0EA0870EA1838EA383CEAFC7F100E7F8D13>I<EAFE1FEA3C0E
+130CEA1C08A2EA0E10A2EA0720A2EA03C0A3EA0180A21300A212E2A212A4127810147F8D
+13>I<EAFFF0EAC0E01280EA81C0EA83801287EA0700120EEA1E08121CEA3818EA701013
+30EAFFF00D0E7F8D10>I<B512801101808812>I E /Fp 1 4 df<120CA2EACCC012EDEA
+7F80EA0C00EA7F80EAEDC012CCEA0C00A20A0B7D8B10>3 D E /Fq
+10 58 df<120FEA30C0EA6060A2EA4020EAC030A9EA4020EA6060A2EA30C0EA0F000C13
+7E9211>48 D<120C121C12EC120CAFEAFFC00A137D9211>I<121FEA60C01360EAF07013
+301260EA0070A2136013C012011380EA02005AEA08101210EA2020EA7FE012FF0C137E92
+11>I<EA0FC0EA3070EA7038A31200133013E0EA0FC0EA007013381318131C126012F013
+18EAE038EA6070EA1FC00E137F9211>I<136013E0A2EA016012021206120C1208121012
+20126012C0EAFFFCEA0060A5EA03FC0E137F9211>I<EA6060EA7FC01380EA44001240A3
+124FEA70C0EA40E0EA00601370A212E0A21360EA40E0EA21C0EA1F000C137E9211>I<EA
+07C0EA0C20EA10701220EA6000A25A12CFEAD0C0EAE060EAC0201330A31240EA6020EA20
+60EA10C0EA0F000C137E9211>I<1240EA7FFC13F8EA401012801320EA00401380EA0100
+A25A12021206A2120EA512040E147E9311>I<EA0FC0EA1070EA20181260A21270EA3C30
+EA3F60EA0F8013E0EA31F0EA6078EAC01C130CA3EA6018EA3030EA0FC00E137F9211>I<
+120FEA3080EA6040EA4060EAC0201330A31240EA6070EA30B0EA0F30120013201360EAE0
+401380EA4100123E0C137E9211>I E /Fr 76 124 df<EB7E1F3901C1B180390303E3C0
+000713C3000EEBC180903801C000A6B512FC380E01C0B0387F87FC1A1D809C18>11
+D<137E3801C180EA0301380703C0120EEB018090C7FCA5B512C0EA0E01B0387F87F8151D
+809C17>I<EB7FC0EA01C1EA03031207EA0E01A7B5FCEA0E01B0387FCFF8151D809C17>I<
+90383F07E03901C09C18380380F0D80701133C000E13E00100131892C7FCA5B612FC390E
+00E01CB03A7FC7FCFF80211D809C23>I<EA6060EAF0F0EAF8F8EA6868EA0808A3EA1010
+A2EA2020EA4040EA80800D0C7F9C15>34 D<126012F012F812681208A31210A212201240
+1280050C7C9C0C>39 D<13401380EA0100120212065AA25AA25AA212701260A312E0AC12
+60A312701230A27EA27EA27E12027EEA008013400A2A7D9E10>I<7E12407E7E12187EA2
+7EA27EA213801201A313C0AC1380A312031300A21206A25AA25A12105A5A5A0A2A7E9E10
+>I<1306ADB612E0A2D80006C7FCAD1B1C7E9720>43 D<126012F0A212701210A41220A2
+12401280040C7C830C>I<EAFFE0A20B0280890E>I<126012F0A2126004047C830C>I<EA
+03C0EA0C30EA1818EA300CA2EA700EEA6006A2EAE007ADEA6006A2EA700EEA300CA2EA18
+18EA0C30EA07E0101D7E9B15>48 D<12035A123F12C71207B3A4EA0F80EAFFF80D1C7C9B
+15>I<EA07C0EA1830EA201CEA400C130EEAF00F12F81307A21270EA000F130EA2131CA2
+13381370136013C0EA0180EA0300EA0601120C1218EA1002EA3FFE127F12FF101C7E9B15
+>I<EA07E0EA1830EA201CA2EA781E130E131E1238EA001CA2131813301360EA07E0EA00
+30131CA2130E130FA2127012F8A3EAF00EEA401C1220EA1830EA07E0101D7E9B15>I<13
+0CA2131C133CA2135C13DC139CEA011C120312021204120C1208121012301220124012C0
+B512C038001C00A73801FFC0121C7F9B15>I<EA300CEA3FF813F013C0EA2000A6EA23E0
+EA2430EA2818EA301CEA200E1200130FA3126012F0A3EA800EEA401E131CEA2038EA1870
+EA07C0101D7E9B15>I<13F0EA030CEA0604EA0C0EEA181E1230130CEA7000A21260EAE3
+E0EAE430EAE818EAF00C130EEAE0061307A51260A2EA7006EA300E130CEA1818EA0C30EA
+03E0101D7E9B15>I<1240387FFF801400A2EA4002485AA25B485AA25B1360134013C0A2
+12015BA21203A41207A66CC7FC111D7E9B15>I<EA03E0EA0C30EA1008EA200C13061260
+A31270EA780CEA3E08EA3FB0EA1FE0EA07F013F8EA18FCEA307EEA601E130FEAC0071303
+A4EA60021304EA300CEA1C10EA07E0101D7E9B15>I<EA03C0EA0C30EA1818EA300C1270
+EA600EEAE006A21307A51260EA700F1230EA1817EA0C27EA07C7EA0006A2130EEA300C12
+781318EA7010EA2030EA30C0EA0F80101D7E9B15>I<126012F0A212601200AA126012F0
+A2126004127C910C>I<126012F0A212601200AA126012F0A212701210A41220A2124012
+80041A7C910C>I<1306A3130FA3EB1780A3EB23C0A3EB41E0A3EB80F0A200017FEB0078
+EBFFF83803007C0002133CA20006133E0004131EA2000C131F121E39FF80FFF01C1D7F9C
+1F>65 D<B512C0380F00F01438143C141C141EA4141C143C1478EB01F0EBFFE0EB007814
+3C141E140E140FA5141EA2143C1478B512E0181C7E9B1D>I<90381F8080EBE061380180
+1938070007000E13035A14015A00781300A2127000F01400A8007014801278A212386CEB
+0100A26C13026C5B380180083800E030EB1FC0191E7E9C1E>I<B512C0380F00F0143C14
+0E80A2EC038015C01401A215E0A815C0A21403158014071500140E5C1470B512C01B1C7E
+9B20>I<B512FC380F003C140C1404A214061402A213021400A3130613FE13061302A314
+0113001402A31406A2140C143CB512FC181C7E9B1C>I<B512F8380F007814181408A214
+0C1404A213021400A3130613FE13061302A490C7FCA77FEAFFF8161C7E9B1B>I<90381F
+8080EBE0613801801938070007000E13035A14015A00781300A2127000F01400A6ECFFF0
+EC0F80007013071278A212387EA27E6C130B380180113800E06090381F80001C1E7E9C21
+>I<39FFF3FFC0390F003C00ACEBFFFCEB003CAD39FFF3FFC01A1C7E9B1F>I<EAFFF0EA0F
+00B3A8EAFFF00C1C7F9B0F>I<EA1FFFEA00F81378B3127012F8A3EAF0F0EA40E0EA21C0
+EA1F00101D7F9B15>I<EAFFF8EA0F8090C7FCB01408A31418A2141014301470EB01F0B5
+FC151C7E9B1A>76 D<B46CEBFF80000FECF800A2390BC00178A33809E002A23808F004A3
+EB7808A3EB3C10A3EB1E20A3EB0F40A2EB0780A3EB0300121C3AFF8307FF80211C7E9B26
+>I<B4EB7FC0390F800E001404EA0BC0EA09E0A2EA08F013F81378133CA2131E130FA2EB
+078414C41303EB01E4A2EB00F4147CA2143CA2141C140C121C38FF80041A1C7E9B1F>I<
+EB3F80EBE0E03803803848487E000E7F487F003C148000381303007814C0A20070130100
+F014E0A8007014C000781303A200381480003C1307001C14006C130E6C5B6C6C5A3800E0
+E0EB3F801B1E7E9C20>I<B51280380F00E01478143C141C141EA5141C143C147814E0EB
+FF8090C7FCACEAFFF0171C7E9B1C>I<B5FC380F01E0EB007880141C141EA4141C143C5C
+EB01E001FFC7FCEB03C0EB00E0801478A61510A21438EC3C2038FFF01CC7EA07C01C1D7E
+9B1F>82 D<3807E080EA1C19EA3005EA7003EA600112E01300A36C13007E127CEA7FC0EA
+3FF8EA1FFEEA07FFC61380130FEB07C0130313011280A300C01380A238E00300EAD002EA
+CC0CEA83F8121E7E9C17>I<007FB512C038700F010060130000401440A200C014201280
+A300001400B1497E3803FFFC1B1C7F9B1E>I<39FFF07FC0390F000E001404B3A26C5B13
+8000035B12016C6C5AEB70C0011FC7FC1A1D7E9B1F>I<39FFE00FF0391F0003C06CEB01
+8015006D5A00071302A26C6C5AA36C6C5AA213F000005BA2EBF830EB7820A26D5AA36D5A
+A2131F6DC7FCA21306A31C1D7F9B1F>I<3AFFE0FFE0FF3A1F001F003C001E011E13186C
+011F1310A3D807801420EC2780A2D803C01440EC43C0A213E00001903881E080A33A00F1
+00F100A3017913FA017A137AA2013E137C013C133CA301181318A3281D7F9B2B>I<397F
+F0FFC0390FC03E0038078018EA03C0EBE01000015BEBF06000001340EB7880137D013DC7
+FC7F131F7F80A2EB13C0EB23E01321EB41F0EBC0F8EB80783801007C48133C00027F0006
+131F001FEB3F8039FFC0FFF01C1C7F9B1F>I<12FEA212C0B3B312FEA207297C9E0C>91
+D<EA0808EA1010EA2020EA4040A2EA8080A3EAB0B0EAF8F8EA7878EA30300D0C7A9C15>
+I<12FEA21206B3B312FEA20729809E0C>I<EA1FC0EA3070EA78387F12301200A2EA01FC
+EA0F1C12381270126000E01340A3EA603C38304E80381F870012127E9115>97
+D<12FC121CAA137CEA1D86EA1E03381C018014C0130014E0A614C013011480381E0300EA
+1906EA10F8131D7F9C17>I<EA07E0EA0C30EA18781230EA7030EA600012E0A61260EA70
+041230EA1808EA0C30EA07C00E127E9112>I<133F1307AAEA03E7EA0C17EA180F487E12
+70126012E0A61260127012306C5AEA0C373807C7E0131D7E9C17>I<EA03E0EA0C30EA18
+18EA300CEA700EEA600612E0EAFFFEEAE000A41260EA70021230EA1804EA0C18EA03E00F
+127F9112>I<13F8EA018CEA071E1206EA0E0C1300A6EAFFE0EA0E00B0EA7FE00F1D809C
+0D>I<EB03803803C4C0EA0C38001C138038181800EA381CA4EA1818EA1C38EA0C30EA13
+C00010C7FC12307EEA1FF813FF1480EA3003386001C0EAC000A33860018038300300EA1C
+0EEA07F8121C7F9215>I<12FC121CAA137C1387EA1D03001E1380121CAD38FF9FF0141D
+7F9C17>I<1218123CA21218C7FCA712FC121CB0EAFF80091D7F9C0C>I<13C0EA01E0A2EA
+00C01300A7EA0FE01200B3A21260EAF0C012F1EA6180EA3E000B25839C0D>I<12FC121C
+AAEB3FC0EB0F00130C13085B5B5B13E0121DEA1E70EA1C781338133C131C7F130F148038
+FF9FE0131D7F9C16>I<12FC121CB3A9EAFF80091D7F9C0C>I<39FC7E07E0391C83883839
+1D019018001EEBE01C001C13C0AD3AFF8FF8FF8021127F9124>I<EAFC7CEA1C87EA1D03
+001E1380121CAD38FF9FF014127F9117>I<EA03F0EA0E1CEA1806487E00701380EA6001
+00E013C0A600601380EA700300301300EA1806EA0E1CEA03F012127F9115>I<EAFC7CEA
+1D86EA1E03381C018014C0130014E0A6EB01C0A21480381E0300EA1D06EA1CF890C7FCA7
+B47E131A7F9117>I<EA03C1EA0C33EA180BEA300FEA7007A212E0A612601270EA300F12
+18EA0C37EA07C7EA0007A7EB3FE0131A7E9116>I<EAFCE0EA1D30EA1E78A2EA1C301300
+ACEAFFC00D127F9110>I<EA1F90EA3070EA4030EAC010A212E0EAF800EA7F80EA3FE0EA
+0FF0EA00F8EA8038131812C0A2EAE010EAD060EA8FC00D127F9110>I<1204A4120CA212
+1C123CEAFFE0EA1C00A91310A5120CEA0E20EA03C00C1A7F9910>I<38FC1F80EA1C03AD
+1307120CEA0E1B3803E3F014127F9117>I<38FF07E0383C0380381C0100A2EA0E02A26C
+5AA3EA0388A213D8EA01D0A2EA00E0A3134013127F9116>I<39FF3FCFE0393C0F038038
+1C07011500130B000E1382A21311000713C4A213203803A0E8A2EBC06800011370A2EB80
+30000013201B127F911E>I<387F8FF0380F03801400EA0702EA0384EA01C813D8EA00F0
+1370137813F8139CEA010E1202EA060738040380381E07C038FF0FF81512809116>I<38
+FF07E0383C0380381C0100A2EA0E02A26C5AA3EA0388A213D8EA01D0A2EA00E0A31340A2
+5BA212F000F1C7FC12F31266123C131A7F9116>I<EA7FFCEA70381260EA407013F013E0
+EA41C012031380EA0700EA0F04120E121CEA3C0CEA380812701338EAFFF80E127F9112>
+I<B512F01401808B15>I E /Fs 40 122 df<49B4FC011F13C090387F81E0EBFC013901
+F807F01203EA07F0A4EC01C091C8FCA3EC3FF8B6FCA33807F003B3A33A7FFF3FFF80A321
+2A7FA925>12 D<130E131E137EEA07FE12FFA212F81200B3AB387FFFFEA317277BA622>
+49 D<EBFF80000713F04813FC381E03FE393800FF80007C133F00FE14C06C131F15E014
+0FA2127E003C131FC7FC15C0A2EC3F801500147E5C5C495A495AEB078049C7FC131E4913
+E013705B3901C001C0EA0380EA0600000FB5FC5A5A5AB61280A31B277DA622>I<EB7F80
+3803FFF04813FC380F80FE381F007FEA3F80EC3F80A3121F1300C7EA7F00A2147E5C495A
+EB07F0EBFFC0A2EB01F8EB007E801580EC1FC0A215E0A2123C127EB4FCA215C0143F4814
+80007CEB7F00003F13FE6CB45A000713F0C613801B277DA622>I<140E141E143E147E14
+FEA213011303EB077E130EA2131C1338137013E0A2EA01C0EA0380EA0700120EA25A5A5A
+5AB612F8A3C7EAFE00A890387FFFF8A31D277EA622>I<00181303381F801FEBFFFE5C5C
+5C14C091C7FC001CC8FCA7EB7FC0381DFFF8381F80FC381E003F1208C7EA1F8015C0A215
+E0A21218127C12FEA315C05A0078EB3F80A26CEB7F00381F01FE6CB45A000313F0C61380
+1B277DA622>I<EB07F8EB3FFE90B5FC3901FC07803903F00FC03807C01FEA0F80121F13
+0048EB0F8091C7FC127EA3EAFE02EB1FF0EB3FFCEB603EEB801F00FF14809038000FC0A2
+4814E0A4127EA4123E003F14C07EEC1F80D80F8013003807E07E6CB45A6C5B38003FC01B
+277DA622>I<1238123E003FB512F0A34814E015C0158015003870000EA25C485B5C5CEA
+00015C495A130791C7FC5B5B131E133EA2137E137CA213FCA41201A76C5A13701C297CA8
+22>I<EC0780A24A7EA34A7EA24A7EA3EC77F8A2ECF7FC14E3A2903801C1FEA201037F14
+80A249486C7EA24980010E133FA2496D7EA2013FB57EA39039700007F8A201F080491303
+A248486D7EA2000381D8FFFE013F13FCA32E297EA833>65 D<91387FE003903907FFFC07
+011FEBFF0F90397FF00F9F9039FF0001FFD801FC7F4848147F4848143F4848141F485A16
+0F485A1607127FA290C9FC5AA97E7F1607123FA26C7E160E6C7E6C6C141C6C6C143C6C6C
+14786CB4EB01F090397FF007C0011FB512800107EBFE009038007FF028297CA831>67
+D<B612FCEDFF8016E03A03FC001FF8ED03FCED00FE167FEE3F80EE1FC0A2EE0FE0A2EE07
+F0A417F8AA17F0A3EE0FE0A217C0161FEE3F80EE7F005EED03FCED1FF8B75A168003FCC7
+FC2D297EA834>I<B712E0A33903FC001FED07F01501A215001670A3913801C0781638A3
+02031300A2140F90B5FCA3EBFC0F1403A20201130EA3161C91C7FCA3163C1638167816F8
+15011503151FB712F0A327297EA82C>I<B712C0A33903FC003FED0FE015031501A21500
+A316F0913801C070A316001403A2140F90B5FCA3EBFC0F1403A21401A491C8FCA9B512FC
+A324297EA82A>I<91387FE003903907FFFC07011FEBFF0F90397FF00F9F9039FF0001FF
+D801FC7F484880484880484880485A82485A82127FA290CAFC5AA892B512F87E7F030013
+00123FA26C7EA26C7E6C7E6C7E6C7E6CB45B90387FF007011FB5129F0107EBFE0F903900
+7FF0032D297CA835>I<B512FCA33801FE00B3B1B512FCA316297FA819>73
+D<B612E015FE6F7E3A03FC003FE0ED0FF06F7E6F7E150182A65E4B5A1507ED0FE0ED3FC0
+90B500FEC7FCA29039FC00FF80ED3FC06F7E6F7E6F7EA9170EA21503923801FC1CB538F0
+00FEEE7FF8EE0FE02F297EA832>82 D<01FF13C0000313E1000F13F9381F80FF383F003F
+003E130F481307A200FC1303A214017EA26C90C7FC13C0EA7FFCEBFFE06C13F86C13FE80
+000714806C14C0C6FC010F13E0EB007FEC1FF0140F140700E01303A46C14E0A26C13076C
+14C0B4EB0F80EBE01F00E3B5120000E113FC38C01FF01C297CA825>I<B500E0B539E01F
+FFC0A32803FC0003FCC7EA7000A26D6E14F0000102015DA26D6E13016C60A26D6C486D48
+5AA26E48EBC007013F023F91C7FCA2DAE00F6D5A011FD90E1F130EA26D6C486C6C5AA217
+F8902707F838075BA2DAFC78EBFC780103D970031370A2DAFEF0EBFEF00101D9E0015BA2
+6D6C486C6C5AA36E486D5AA36EC76CC8FCA3021E141EA242297FA845>87
+D<3803FF80000F13F0381F01FC383F80FE147F801580EA1F00C7FCA4EB3FFF3801FC3FEA
+0FE0EA1F80EA3F00127E5AA4145F007E13DF393F839FFC381FFE0F3803F8031E1B7E9A21
+>97 D<EAFFE0A3120FACEBE1FE9038E7FF809038FE07E09038F803F09038F001F89038E0
+00FCA2157EA2157FA8157EA315FCA29038F001F89038F803F090389C0FE090380FFF8039
+0E01FC00202A7EA925>I<EB3FF03801FFFC3803F03E380FC07FEA1F80EA3F00A248133E
+007E90C7FCA212FEA7127EA2127F6CEB03801380001FEB0700380FE00E3803F83C3801FF
+F838003FC0191B7E9A1E>I<EC7FF0A31407ACEB3F873801FFF73807F03F380FC00F381F
+8007EA3F00A2127EA312FEA8127EA27EA2381F800F380FC01F3907E07FFF3801FFE73800
+7F87202A7EA925>I<EB3FC03801FFF03803E07C380F803E001F7F130048EB0F80127E15
+C0A200FE1307A2B6FCA248C8FCA3127EA2127F6CEB01C07E390F8003803907C007003803
+F01E3800FFFCEB3FE01A1B7E9A1F>I<EB07F8EB3FFCEB7E3E3801FC7FEA03F813F01207
+143E1400A7B512C0A33807F000B3A3387FFF80A3182A7EA915>I<90387F80F03901FFE3
+F83907C0FE1C390F807C7C381F003E151048EB3F00A66C133EA26C6C5A6C6C5A3805FFE0
+380C7F8048C8FC121CA2121E381FFFF814FF6C14C06C14E06C14F0120F383E000748EB01
+F8481300A4007CEB01F0A2003FEB07E0390FC01F806CB5120038007FF01E287E9A22>I<
+EAFFE0A3120FAC147E9038E1FF809038E30FC001E413E0EBE80701F813F013F0A213E0B0
+39FFFE3FFFA3202A7DA925>I<1207EA0F80EA1FC0EA3FE0A3EA1FC0EA0F80EA0700C7FC
+A7EAFFE0A3120FB3A3EAFFFEA30F2B7EAA12>I<EAFFE0A3120FACEC3FF8A3EC0700140E
+143C5C5CEBE1E0EBE3C0EBE780EBEFC0EBFFE0A2EBF7F0EBE3F8EBC1FCA2EBC0FE147FA2
+EC3F80EC1FC0A239FFFC7FFCA31E2A7EA923>107 D<EAFFE0A3120FB3B2EAFFFEA30F2A
+7EA912>I<26FFC07FEB1FC0903AC1FFC07FF0903AC307E0C1F8D80FC49038F101FC9039
+C803F20001D801FE7F01D05BA201E05BB03CFFFE3FFF8FFFE0A3331B7D9A38>I<38FFC0
+7E9038C1FF809038C30FC0D80FC413E0EBC80701D813F013D0A213E0B039FFFE3FFFA320
+1B7D9A25>I<EB3FE03801FFFC3803F07E390FC01F80391F800FC0393F0007E0A2007EEB
+03F0A300FE14F8A8007E14F0A26CEB07E0A2391F800FC0390FC01F803907F07F003801FF
+FC38003FE01D1B7E9A22>I<38FFE1FE9038E7FF809038FE0FE0390FF803F09038F001F8
+01E013FC140015FEA2157FA8157E15FEA215FC140101F013F89038F803F09038FC0FE090
+38EFFF809038E1FC0001E0C7FCA9EAFFFEA320277E9A25>I<38FFC3E0EBC7F8EBCC7C38
+0FD8FE13D0A213F0EBE07C1400B0B5FCA3171B7E9A1B>114 D<3803FE30380FFFF0EA3E
+03EA7800127000F01370A27E00FE1300EAFFE06CB4FC14C06C13E06C13F0000713F8C6FC
+EB07FC130000E0137C143C7E14387E6C137038FF01E038E7FFC000C11300161B7E9A1B>
+I<1370A413F0A312011203A21207381FFFE0B5FCA23807F000AD1470A7000313E03801F8
+C0EA00FFEB3F0014267FA51A>I<39FFE07FF0A3000F1307B2140FA2000713173903F067
+FF3801FFC738007F87201B7D9A25>I<3BFFFC7FFC1FFCA33B0FE00FE001C02607F007EB
+0380A201F8EBF0070003160015F82601FC0F130EA29039FE1FFC1E0000011C131C15FE90
+39FF387E3C017F1438EC787F6D486C5AA29138E01FF0011F5CA26D486C5AA36D486C5AA2
+2E1B7F9A31>119 D<39FFFC1FFEA33907F00780D803F813006C6C5AEBFE1E00005BEB7F
+78EB3FF85C6D5A130F6D7E80130F497EEB3DFEEB38FFEB787F9038F03F80D801E013C039
+03C01FE0EB800F39FFF03FFFA3201B7F9A23>I<39FFFE07FFA33907F000E0A2EBF80100
+0314C0A23901FC0380A2EBFE07000014006D5AEB7F0EA2EB3F9CA214FC6D5AA26D5AA213
+075CA26D5AA25CA21307003890C7FC127CEAFE0EA25B5BEA7C70EA3FE0EA0F8020277F9A
+23>I E /Ft 14 123 df<EA03CCEA0E2EEA181C123812301270EAE038A4EAC072A3EA60
+F2EA6134EA1E180F107C8F14>97 D<EA01E0EA0618120CEA1838EA3010EA7000126012E0
+A413081310EA6020EA30C0EA1F000D107C8F12>99 D<EB1F801303A3EB0700A4130EA2EA
+03CEEA0E2EEA181C123812301270485AA4EAC072A3EA60F2EA6134EA1E18111A7C9914>
+I<EA01E0EA0E18EA1C08123812701310EAFFE0EAE000A41308EA60101320EA30C0EA1F00
+0D107C8F12>I<13F338038B8038060700120E120C121CEA380EA4EA301CA3EA183C5BEA
+07B8EA0038A25B1260EAE0E0EAC1C0007FC7FC11177E8F12>103
+D<1203120712061200A61238124C124E128E129CA2121C1238A212701272A212E212E412
+64123808197C980C>105 D<121F1207A3120EA4121CA41238A41270A412E4A412E81230
+081A7D990A>108 D<EA307CEA5986EA9E07A2129CA2EA380EA35B00701380A21338EB39
+00EAE019EA600E11107C8F16>110 D<EA01F0EA0618EA0C0CEA180E12301270126012E0
+A2130C131C13181330EA6060EA30C0EA1F000F107C8F14>I<EA030F380590C0EA09E0EB
+C060A3380380E0A4380701C0148013031400EA0E8E137890C7FCA25AA4B4FC1317808F14
+>I<EA03E0EA04301208EA18701360EA1C00EA1F8013C0EA0FE01200136012E0A2EA80C0
+EA4180EA3E000C107D8F10>115 D<1206120EA45AA2EAFFC0EA1C005AA45AA412E1A312
+E212E412380A177C960D>I<EA3806EA4C07EA4E0E128E129CA2EA1C1C1238A3EA7039A3
+EA3079EA389AEA0F0C10107C8F15>I<EA0382EA07C4EA0FFCEA10081310EA00201340EA
+0180EA03001204EA08081210EA2018EA7FF0EA43E0EA81C00F107E8F10>122
+D E /Fu 54 124 df<13FCEA0182EA0703EA0607EA0E0290C7FCA5B5FCEA0E07AE387F0F
+E0131A809915>12 D<90387E1F803901C17040390703C0600006EB80E0000E14401500A5
+B612E0380E0380AE397F8FE3FC1E1A809920>14 D<1380EA010012025A120C120812185A
+A35AA412E0AA1260A47EA37E1208120C12047E7EEA008009267D9B0F>40
+D<7E12407E7E12181208120C7EA37EA41380AA1300A41206A35A1208121812105A5A5A09
+267E9B0F>I<126012F0A212701210A31220A212401280040B7D830B>44
+D<EAFFC0A20A0280880D>I<126012F0A2126004047D830B>I<EA0F80EA1060EA2030EA40
+38EA803CEAC01C12E01240EA003C1338A21370136013C0EA018013001202EA0404120812
+10EA3008EA3FF8127F12FF0E187E9713>50 D<EA0F80EA10E0EA2070EA6078EA70381220
+EA00781370A2136013C0EA0F80EA00E013701338133CA212E0A212C0EA40381370EA30E0
+EA0F800E187E9713>I<1330A2137013F0A2EA0170120312021204120C12081210123012
+20124012C0B5FCEA0070A6EA07FF10187F9713>I<1240EA7FFE13FCA2EA4008EA8010A2
+1320EA0040A213801201A213005AA45AA612020F197E9813>55 D<126012F0A212601200
+A8126012F0A2126004107D8F0B>58 D<126012F0A212601200A8126012F0A212701210A3
+1220A21240128004177D8F0B>I<130CA3131EA2133F1327A2EB4380A3EB81C0A348C67E
+A213FF38020070A20006137800041338A2487FA2001C131EB4EBFFC01A1A7F991D>65
+D<EB3F023801C0C63803002E000E131E48130E14065A007813021270A200F01300A60070
+1302A21278003813047E14087E000313303801C0C038003F00171A7E991C>67
+D<B5FC380E01C0EB00E014301438141CA2140EA2140FA8140EA2141E141C1438A21470EB
+01C0B51200181A7E991D>I<B512F0380E00701430141014181408A3EB0400A3130CEA0F
+FCEA0E0C1304A3EB0004A21408A3141814381470B512F0161A7E991A>I<EB3F023801C0
+C63803002E000E131E48130E14065A007813021270A200F090C7FCA5903801FFC0397000
+0E00A2127812387EA27E000313163801C06638003F821A1A7E991E>71
+D<38FFE7FF380E0070AB380FFFF0380E0070AC38FFE7FF181A7E991D>I<EAFFE0EA0E00
+B3A6EAFFE00B1A7F990E>I<39FFE07F80390E001E00141814105C5C5C49C7FC13025B5B
+131C132E134E1387380F0380120E6D7E6D7EA21470A28080143E39FFE0FF80191A7E991E
+>75 D<EAFFF0000EC7FCB01420A314601440A214C01303B5FC131A7E9918>I<B5FC380E
+03C0EB00E01470A21478A41470A214E0EB03C0380FFF00000EC7FCABEAFFE0151A7E991A
+>80 D<EAFFFC380E0780EB01C06D7E80A55C495AEB0780D80FFCC7FCEA0E067F6D7E80A3
+80A31580EB00F0EC710038FFE03E191A7E991C>82 D<EA0FC2EA1836EA200EEA600612C0
+1302A3EAE0001270127EEA3FE0EA1FF8EA07FCEA003E130E130713031280A3EAC0021306
+EAE004EAD818EA87E0101A7E9915>I<007FB5FC38701C0700401301A200C01480008013
+00A300001400B13803FFE0191A7F991C>I<3AFF83FF0FF03A3C007801C0001CEC0080A2
+6CEC0100A2149C6C1402A2EB010EA2D803815BEB8207A2D801C25B9038C40388A2D800E4
+1390A29038E801D0017813E0A2EB7000A201305B01201340241A7F9927>87
+D<12FEA212C0B3AF12FEA207257D9B0B>91 D<12FEA21206B3AF12FEA20725809B0B>93
+D<EA3F80EA70C013E0EA20701200A2EA07F0EA1C701230127012E01371A213F1EA71FBEA
+1E3C10107E8F13>97 D<12FC121CA913F8EA1F0EEA1E07381C0380130114C0A6EB038014
+00EA1E07EA1B0CEA10F0121A7F9915>I<EA07F8EA0C1C1238EA3008EA70005AA61270EA
+3004EA3808EA0C18EA07E00E107F8F11>I<137E130EA9EA03CEEA0C3EEA380E12301270
+12E0A612601270EA381EEA1C2E3807CFC0121A7F9915>I<EA07C0EA1C30EA30181270EA
+600C12E0EAFFFCEAE000A41260EA3004EA3808EA0C18EA07E00E107F8F11>I<EA01F0EA
+0318EA0738EA0E101300A6EAFFC0EA0E00AEEA7FE00D1A80990C>I<EA0FCEEA1873EA30
+30EA7038A4EA3030EA1860EA2FC0EA200012601270EA3FF013FCEA1FFEEA600FEAC003A4
+EA6006EA381CEA07E010187F8F13>I<12FC121CA913F8EA1D0CEA1E0EA2121CAB38FF9F
+C0121A7F9915>I<1218123CA21218C7FCA612FC121CAEEAFF80091A80990A>I<EA0180EA
+03C0A2EA0180C7FCA6EA0FC01201B21241EAE180EAE300127E0A2182990C>I<12FC121C
+A9EB3F80EB1E00131813105B5BEA1DC0EA1FE0121C1370137813387F131E131F38FF3FC0
+121A7F9914>I<12FC121CB3A6EAFF80091A80990A>I<38FC7C1F391D8E6380391E0781C0
+A2001C1301AB39FF9FE7F81D107F8F20>I<EAFCF8EA1D0CEA1E0EA2121CAB38FF9FC012
+107F8F15>I<EA07E0EA1C38EA300CEA700EEA6006EAE007A6EA6006EA700EEA381CEA1C
+38EA07E010107F8F13>I<EAFCF8EA1F0EEA1E07381C0380A2EB01C0A6EB03801400EA1E
+07EA1F0CEA1CF090C7FCA6B47E12177F8F15>I<EAFCE0EA1D70121E1320EA1C00ABEAFF
+C00C107F8F0F>114 D<EA1F20EA60E0EA402012C0A2EAF000127FEA3FC0EA1FE0EA00F0
+EA8070133012C01320EAF040EA8F800C107F8F0F>I<1204A3120CA2121C123CEAFFC0EA
+1C00A81320A5EA0E40EA03800B177F960F>I<EAFC7EEA1C0EAC131EEA0C2E3807CFC012
+107F8F15>I<38FF1F80383C0600EA1C04A2EA1E0CEA0E08A26C5AA21390EA03A0A2EA01
+C0A36C5A11107F8F14>I<39FF3F9F80393C0E070000381306381C16041317001E130C38
+0E23081488000F13983807419014D03803C1E01380A200015BEB004019107F8F1C>I<38
+FF3F80383C1C00EA1C18EA0E106C5A13606C5A12017F1203EA0270487E1208EA181CEA38
+1E38FC3FC012107F8F14>I<38FF1F80383C0600EA1C04A2EA1E0CEA0E08A26C5AA21390
+EA03A0A2EA01C0A36C5AA248C7FCA212E112E212E4127811177F8F14>I<B512C0120180
+8913>123 D E /Fv 16 118 df<1303497EA3497EA2EB1BE0A3EB31F0A2EB60F8A2EBE0
+FCEBC07CA248487EEBFFFE487FEB001FA20006EB0F80A2000E14C039FFC07FFCA21E1A7F
+9921>65 D<EAFFFCA2EA0F80AE140CA3141CA21438147814F8B5FCA2161A7E991B>76
+D<B512E014F8380F807E80801580A51500143E5CEBFFF80180C7FCAAEAFFF8A2191A7E99
+1E>80 D<EA0FF0EA1C3CEA3E1E130E130F121C120013FFEA0FCFEA3E0F127C12F8A31317
+387C27E0EA1FC313117F9015>97 D<12FEA2121EA7137F381FC3C0EB00E0001E13F01478
+A2147CA51478A214F0001F13E0381D83C038187F00161A7F9919>I<EA03FCEA0F0EEA1C
+1F123C1278130E00F8C7FCA51278A2383C0180381C0300EA0F06EA03FC11117F9014>I<
+EA03F0EA0E1C487EEA3C071278148012F8A2B5FC00F8C7FCA21278A2383C0180381C0300
+EA0E06EA03FC11117F9014>101 D<3807E3C0381C3CE0EA381C38781EC01400A4EA381C
+6C5AEA27E00020C7FCA21230EA3FFE381FFF8014C0EA700338E000E0A4387001C0383C07
+803807FC0013197F9016>103 D<123C127EA4123CC7FCA4127EA2121EADEAFF80A2091B
+7F9A0D>105 D<39FE1F01F0903863C63C391E81C81C391F01F01EA2001E13E0AA3AFFCF
+FCFFC0A222117F9025>109 D<EAFE1FEB63C0EA1E81381F01E0A2121EAA38FFCFFCA216
+117F9019>I<EA03F8EA0E0E383C0780EA3803007813C0A200F813E0A6007813C0EA7C07
+003C1380380E0E00EA03F813117F9016>I<EAFC78139CEA1D3EA2121E131C1300A9EAFF
+C0A20F117F9012>114 D<EA1FB0EA2070EA403012C0A2EAF000EAFF80EA7FE0EA3FF812
+07EA003CEAC00CA212E01308EAF830EACFE00E117F9011>I<1206A4120EA2121EEA3FF0
+12FFEA1E00A81318A5EA0F30EA03E00D187F9711>I<38FE0FE0A2EA1E01AB1303A2380F
+05FCEA03F916117F9019>I E /Fw 1 4 df<1202A3EAC218EAF278EA3AE0EA0F80A2EA3A
+E0EAF278EAC218EA0200A30D0E7E8E12>3 D E /Fx 34 122 df<127012F812FCA21274
+1204A41208A21210A212201240060F7C840E>44 D<127012F8A3127005057C840E>46
+D<13801203120F12F31203B3A9EA07C0EAFFFE0F217CA018>49 D<13021306130EA2131E
+A2132E134EA2138EA2EA010E1202A21204A212081210A21220A212401280B512F838000E
+00A7131F3801FFF015217FA018>52 D<00101380381E0700EA1FFF5B13F8EA13E00010C7
+FCA613F8EA130EEA1407381803801210380001C0A214E0A4127012F0A200E013C01280EA
+4003148038200700EA1006EA0C1CEA03F013227EA018>I<EA01F0EA060C487EEA180738
+3803801270A238F001C0A314E0A5127013031238EA1805120CEA0619EA03E1380001C0A3
+EB0380A200301300EA78071306EA700CEA20186C5AEA0FC013227EA018>57
+D<497EA3497EA3EB05E0A2EB0DF01308A2497E1478A2497EA3497EA3497EA290B5FC3901
+000780A24814C000021303A24814E01401A2000CEB00F0A2003EEB01F839FF800FFF2023
+7EA225>65 D<B512F8380F800E0007EB0780EC03C015E0140115F0A515E01403EC07C0EC
+0F80EC3E00EBFFFE9038800780EC03C0EC01E015F0140015F8A6EC01F0A2EC03E0EC07C0
+000FEB0F00B512FC1D227EA123>I<903807E0109038381830EBE0063901C00170390380
+00F048C7FC000E1470121E001C1430123CA2007C14101278A200F81400A812781510127C
+123CA2001C1420121E000E14407E6C6C13803901C001003800E002EB381CEB07E01C247D
+A223>I<B512F0380F801E00071307EC03C01401EC00E015F01578A2157C153CA3153EA9
+153CA2157C1578A215F015E01401EC03C0EC0700000F131EB512F81F227EA125>I<9038
+07F00890383C0C18EBE0023901C001B839038000F848C71278481438121E15185AA2007C
+14081278A200F81400A7EC1FFF0078EB00F81578127C123CA27EA27E7E6C6C13B86C7E39
+00E0031890383C0C08903807F00020247DA226>71 D<B512F0380F803C0007130FEC0780
+15C0140315E0A615C014071580EC0F00143CEBFFF00180C7FCAE487EEAFFFC1B227EA121
+>80 D<3803F020380C0C60EA1802383001E0EA70000060136012E0A21420A36C1300A212
+78127FEA3FF0EA1FFE6C7E0003138038003FC0EB07E01301EB00F0A214707EA46C1360A2
+6C13C07E38C8018038C60700EA81FC14247DA21B>83 D<39FFFC07FF390FC000F86C4813
+701520B3A5000314407FA2000114806C7E9038600100EB3006EB1C08EB03F020237EA125
+>85 D<3BFFF03FFC03FE3B1F8007E000F86C486C4813701720A26C6C6C6C1340A32703C0
+02F01380A33B01E004780100A33A00F0083C02A39039F8183E06903978101E04A2137C90
+393C200F08A390391E400790A390390F8003E0A36D486C5AA36D5C010213002F237FA132
+>87 D<EA0FE0EA1838EA3C0C130EEA18071200A313FFEA07C7EA1E07123C1278127000F0
+1308A3130FEA7817383C2390380FC1E015157E9418>97 D<120E12FE121E120EAB131FEB
+61C0EB8060380F0030000E1338143C141C141EA7141C143C1438000F1370380C8060EB41
+C038083F0017237FA21B>I<EA01FEEA0703380C0780121C383803000078C7FC127012F0
+A712700078134012386C1380380C0100EA0706EA01F812157E9416>I<14E0130F130113
+00ABEA01F8EA0704EA0C02EA1C01EA38001278127012F0A7127012781238EA1801EA0C02
+38070CF03801F0FE17237EA21B>I<EA01FCEA0707380C0380381C01C01238007813E0EA
+700012F0B5FC00F0C7FCA512700078132012386C13406C138038070300EA00FC13157F94
+16>I<133C13C6EA018F1203130FEA0700A9EAFFF8EA0700B21380EA7FF8102380A20F>I<
+121C123EA3121CC7FCA8120E12FE121E120EB1EAFFC00A227FA10E>105
+D<120E12FE121E120EB3ADEAFFE00B237FA20E>108 D<390E1FC07F3AFE60E183803A1E
+807201C03A0F003C00E0A2000E1338AF3AFFE3FF8FFE27157F942A>I<380E1F8038FE60
+C0381E80E0380F0070A2120EAF38FFE7FF18157F941B>I<EA01FCEA0707380C01803818
+00C0003813E0481370A200F01378A700701370007813F0003813E0381C01C0380E038038
+070700EA01FC15157F9418>I<EA0E1F38FE61C0380E8060380F0070000E1338143C141C
+141EA7143CA21438000F1370380E80E0EB41C0EB3F0090C7FCA9EAFFE0171F7F941B>I<
+EA0E3CEAFE46EA1E8FEA0F0F13061300120EAD120FEAFFF010157F9413>114
+D<EA0F88EA3078EA601812C01308A212E0EAF000EA7F80EA3FE0EA0FF0EA01F8EA003CEA
+801C130CA212C01308EAE018EAD030EA8FC00E157E9413>I<1202A41206A3120E121E12
+3EEAFFF8EA0E00AB1304A6EA07081203EA01F00E1F7F9E13>I<000E137038FE07F0EA1E
+00000E1370AD14F0A238060170380382783800FC7F18157F941B>I<38FFC1FE381E0078
+000E13301420A26C1340A238038080A33801C100A2EA00E2A31374A21338A3131017157F
+941A>I<39FF8FF8FF391E01E03C001CEBC018120EECE010A239070260201470A2390384
+30401438A23901C81880141CA23900F00D00140FA2EB6006A320157F9423>I<38FFC1FE
+381E0078000E13301420A26C1340A238038080A33801C100A2EA00E2A31374A21338A313
+10A25BA35B12F05B12F10043C7FC123C171F7F941A>121 D E /Fy
+20 124 df<EB7F803801FFF0380701F8380C007E48131F00107F48148048EB07C0A2EC03
+E012B012F87EA31278C7FCEC07C0A21580140F15005C141E5C5C14705C495A495A49C7FC
+130E130C5B5B5B491320485A48C7FC000614405A12084814C0003FB5FC481480B6FCA21B
+2F7DAE21>50 D<1403A34A7EA24A7EA3EC17E01413A2EC23F01421A2EC40F8A3EC807CA2
+0101137EEC003EA20102133F81A2496D7EA3496D7EA2011880011FB5FCA29039200003F0
+1501A249801500A249147CA348C87EA248153F825AD81F80EC3F80D8FFE0903803FFFCA2
+2E327EB132>65 D<91383FE001903901FFF803903807F01E90391F800307013EC7128701
+78144F49142F4848141F4848140F485A000F150790C8FC481503121E123E003C1501127C
+A30078150012F8AB1278127C1601A2123C123E121E001F15027E6D1406000715046C6C14
+086C7E6C6C141001781420013E14C090391F800380903907F00F00903801FFFC9038003F
+E028337CB130>67 D<B712E0A23907E0000F00031401ED00F016701630A21610A41608A3
+15801600A41401A2140790B5FCA2EBE0071401A21400A31602A215001604A4160CA21608
+1618A216381678ED01F80007EC0FF0B7FCA227317CB02D>69 D<DA1FE013809138FFFC01
+903807F00F90390F800183013EC712C3017814274914174848140F485A48481407160348
+C8FC481501121E123E123C1600127CA20078160012F8AA92380FFFFC1278007C9138001F
+C0EE0F80123CA2123E121E121F7E6C7E7F12036C7E6C6C1417137C6D1463D90F8013C390
+3907F00781903900FFFE00DA1FF013002E337CB134>71 D<D8FFF0ED7FF8A200071700D8
+02F815BEA3017CEC013EA26D1402A36D1404A36D6C1308A36D6C1310A36D6C1320A26D6C
+1340A36D6C1380A391387C0100A3EC3E02A36E5AA2EC0F88A3EC07D0A3EC03E0A300076D
+5AD80F80157FD8FFF891380FFFF8EC008035317CB03D>77 D<B6FC15F03907E001FC0003
+EB003EED0F806F7E6F7E150182150082A65E15015E4B5A4B5A4BC7FC153CEC01F090B5C8
+FC9038E001F0EC007C151E6F7E1507826F7EAB1708A21501A2486C903800F010B56C1370
+EE3860C9EA0F802D327CB031>82 D<90387F80203801FFE03907C07860380F001C001EEB
+06E048130300381301007813001270156012F0A21520A37E1500127C127E7E13C0EA1FF8
+6CB47E6C13F86C7FC613FF010F1380010013C0EC1FE01407EC03F01401140015F8A26C14
+78A57E15706C14F015E07E6CEB01C000ECEB038000C7EB070038C1F01E38807FFCEB0FF0
+1D337CB125>I<D8FFFEEC07FFA2D807F0EC01F86C48EC00E017C07F00011680A26C6CEC
+0100A27F017C1402A2017E1406013E1404A26D5CA280010F5CA26D6C5BA28001035CA26E
+13C001015CA26D6C48C7FCA214FCEC7C02A26E5AA2143F6E5AA21598EC0F90A2EC07E0A3
+6E5AA26E5AA330327FB032>86 D<13FE380303C0380C00E00010137080003C133C003E13
+1C141EA21208C7FCA3EB0FFEEBFC1EEA03E0EA0F80EA1F00123E123C127C481404A3143E
+A21278007C135E6CEB8F08390F0307F03903FC03E01E1F7D9E21>97
+D<EB3F80EBE06038038018380700045A001E131E001C133E123C127C14080078130012F8
+A91278127CA2003C13017E14027E6C1304380380183800E060EB3F80181F7D9E1D>99
+D<EB3F80EBE0E0380380383807003C000E7F121E001C7F123C127C00781480140712F8A2
+B6FC00F8C8FCA61278127C123C15807E000EEB0100000F1302EA07803801C00C3800F030
+EB1FC0191F7E9E1D>101 D<120FEA1F80A4EA0F00C7FCABEA078012FFA2120F1207B3A6
+EA0FC0EAFFF8A20D307EAF12>105 D<EA078012FFA2120F1207B3B3A7EA0FC0EAFFFCA2
+0E327EB112>108 D<380780FE39FF83078090388C03C0390F9001E0EA07A06E7E13C0A2
+5BB3A2486C487E3AFFFC1FFF80A2211F7E9E25>110 D<EB1FC0EBF0783801C01C380700
+07481480001EEB03C0001C1301003C14E0A248EB00F0A300F814F8A8007814F0007C1301
+003C14E0A26CEB03C0A26CEB07803907800F003801C01C3800F078EB1FC01D1F7E9E21>
+I<380783E038FF8C18EB907C120FEA07A0EBC0381400A35BB3487EEAFFFEA2161F7E9E19
+>114 D<3801FC10380E0330381800F048137048133012E01410A37E6C1300127EEA3FF0
+6CB4FC6C13C0000313E038003FF0EB01F813006C133CA2141C7EA27E14186C1338143000
+CC136038C301C03880FE00161F7E9E1A>I<1340A513C0A31201A212031207120F381FFF
+E0B5FC3803C000B01410A80001132013E000001340EB78C0EB1F00142C7FAB19>I<B712
+802101809321>123 D E end
+%%EndProlog
+%%BeginSetup
+%%Feature: *Resolution 300dpi
+TeXDict begin
+
+%%EndSetup
+%%Page: 1 1
+1 0 bop 284 369 a Fy(RE2C)21 b({)h(A)f(More)h(V)-6 b(ersatile)23
+b(Scanner)e(Generator)472 490 y Fx(P)o(eter)15 b(Bum)o(bulis)209
+b(Donald)17 b(D.)f(Co)o(w)o(an)272 548 y(Computer)g(Science)e
+(Departmen)o(t)h(and)i(Computer)e(Systems)g(Group)692
+606 y(Univ)o(ersit)o(y)e(of)k(W)l(aterlo)q(o)1175 588
+y Fw(\003)782 704 y Fx(April)e(15,)i(1994)849 895 y Fv(Abstract)120
+960 y Fu(It)f(is)g(usually)j(claimed)f(that)e(lexical)j(analysis)f
+(routines)g(are)e(still)i(co)q(ded)f(b)o(y)f(hand,)i(despite)g(the)e
+(widespread)62 1005 y(a)o(v)n(ailabil)q(i)q(t)o(y)h(of)d(scanner)i
+(generators,)f(for)f(e\016ciency)i(reasons.)23 b(While)16
+b(e\016ciency)g(is)f(a)f(consideration)q(,)j(there)e(exist)62
+1051 y(freely)k(a)o(v)n(ailable)j(scanner)d(generators)g(suc)o(h)g(as)g
+(GLA)f([7])g(that)g(can)h(generate)g(scanners)h(that)e(are)h(faster)f
+(than)62 1097 y(most)g(hand-co)q(ded)h(ones.)30 b(Ho)o(w)o(ev)o(er,)18
+b(most)g(generated)g(scanners)g(are)g(tailored)h(for)e(a)g(particular)j
+(en)o(vironmen)o(t,)62 1142 y(and)c(retargetting)h(these)e(scanners)i
+(to)e(other)h(en)o(vironmen)o(ts,)h(if)f(p)q(ossible,)h(is)f(usually)i
+(complex)f(enough)f(to)f(mak)o(e)62 1188 y(a)h(hand-co)q(ded)h(scanner)
+f(more)g(app)q(ealing.)26 b(In)16 b(this)g(pap)q(er)g(w)o(e)f(describ)q
+(e)i(RE2C,)e(a)g(scanner)i(generator)f(that)f(not)62
+1234 y(only)e(generates)f(scanners)h(whic)o(h)f(are)g(faster)f(\(and)h
+(usually)i(smaller\))f(than)f(those)g(pro)q(duced)h(b)o(y)f(an)o(y)g
+(other)g(scanner)62 1279 y(generator)i(kno)o(wn)g(to)f(the)g(authors,)g
+(includin)q(g)j(GLA,)c(but)i(also)g(adapt)f(easily)i(to)e(an)o(y)h(en)o
+(vironmen)o(t.)62 1371 y(Categories)19 b(and)f(Sub)r(ject)g
+(Descriptors:)27 b(D.3.2)17 b([)p Fv(Programming)j(Languages)p
+Fu(]:)25 b(Language)19 b(Classi\014cations)i({)62 1416
+y Ft(sp)n(e)n(cialize)n(d)11 b(applic)n(atio)o(n)g(languages)o
+Fu(;)f(D.3.4)j([)p Fv(Programming)h(Languages)p Fu(]:)j(Pro)q(cessors)
+62 1508 y(General)e(T)m(erms:)h(Algorithms,)e(Languages,)h(P)o
+(erformance)62 1599 y(Additional)h(Key)d(W)m(ords)h(and)g(Phrases:)j
+(Lexical)e(analysis,)g(scanner)f(generator)-42 1736 y
+Fs(1)67 b(In)n(tro)r(duction)-42 1827 y Fr(Lexical)14
+b(analysis)g(routines)h(are)g(still)f(often)g(co)q(ded)i(b)o(y)e(hand)g
+(despite)i(the)f(widespread)g(a)o(v)n(ailabilit)o(y)c(of)j(scanner)i
+(gener-)-42 1877 y(ators.)k(F)m(or)14 b(example,)e(while)i(most)f(Unix)
+h(systems)g(ha)o(v)o(e)g(a)g(scanner)i(generator)f(installed)f(\(t)o
+(ypically)f(LEX)h([15)o(])g(or)g(\015ex)-42 1927 y([16]\),)d(few)i
+(Unix)f(applications)f(use)i(a)f(mec)o(hanically)e(generated)k
+(scanner.)19 b(One)13 b(commonly)c(cited)k(reason)g(for)e(not)i(using)
+-42 1977 y(LEX-generated)k(scanners)f(is)f(p)q(erformance:)20
+b(they)15 b(can)g(b)q(e)g(10)g(times)f(slo)o(w)o(er)g(than)h(equiv)n
+(alen)o(t)f(hand-co)q(ded)i(scanners)-42 2026 y([13].)h(As)d(a)g
+(result,)g(there)h(has)f(b)q(een)h(considerable)f(researc)o(h)i(in)o
+(to)d(impro)o(ving)e(the)j(p)q(erformance)g(of)f(mec)o(hanically)e
+(gen-)-42 2076 y(erated)17 b(scanners)f([16)o(,)f(7,)f(9].)21
+b(GLA)15 b([7)o(],)g(one)g(suc)o(h)h(scanner)g(generator,)g(can)f(pro)q
+(duce)h(scanners)h(that)e(are)h(faster)f(than)-42 2126
+y(most)h(hand-co)q(ded)h(scanners.)29 b(Ho)o(w)o(ev)o(er,)17
+b(the)h(use)f(of)f(hand-co)q(ded)i(scanners)g(is)f(still)f(prev)n(alen)
+o(t.)27 b(One)17 b(p)q(ossibilit)o(y)f(is)-42 2176 y(that)e(this)g(is)g
+(due)h(to)e(the)i(di\016cult)o(y)e(of)g(adapting)g(the)h(generated)i
+(scanners)f(to)f(sp)q(eci\014c)h(applications.)21 2226
+y(Most)g(scanner)g(generators)h(are)f(tailored)f(to)g(a)h(particular)f
+(en)o(vironmen)o(t.)19 b(In)14 b(fact,)g(the)i(trend)f(in)f(recen)o(t)i
+(y)o(ears)f(has)-42 2276 y(b)q(een)i(to)e(in)o(tegrate)g(scanner)i
+(generators)f(with)f(compiler)f(to)q(olkits.)21 b(F)m(or)15
+b(example,)f(GLA)h(is)g(part)g(of)g(the)g(Eli)g(compiler)-42
+2325 y(construction)k(system)f([8)o(],)g(and)g(Rex)f([9])g(is)h(part)g
+(of)f(the)h(GMD)f(T)m(o)q(olb)q(o)o(x)g(for)g(Compiler)f(Construction)
+1688 2310 y Fq(1)1707 2325 y Fr(.)30 b(Scanners)p -42
+2362 780 2 v 4 2389 a Fp(\003)22 2401 y Fo(P)o(ermission)9
+b(to)j(cop)o(y)e(without)h(fee)g(all)g(or)g(part)g(of)g(this)g
+(material)e(is)j(gran)o(ted)d(pro)o(vided)h(that)g(the)h(copies)f(are)h
+(not)g(made)f(or)i(distributed)-42 2440 y(for)g(direct)e(commercial)f
+(adv)n(an)o(tage,)g(the)i(A)o(CM)j(cop)o(yrigh)o(t)9
+b(notice)i(and)g(the)g(title)g(of)h(the)f(publication)e(and)i(its)g
+(date)g(app)q(ear,)f(and)h(notice)g(is)-42 2480 y(giv)o(en)g(that)g
+(cop)o(ying)f(is)i(b)o(y)f(p)q(ermission)e(of)j(the)f(Asso)q(ciation)f
+(for)h(Computing)f(Mac)o(hinery)m(.)15 b(T)m(o)d(cop)o(y)f(otherwise,)f
+(or)i(to)f(republish,)f(requires)-42 2519 y(a)k(fee)f(and/or)f(sp)q
+(eci\014c)g(p)q(ermission.)19 b(Cop)o(yrigh)o(t)12 b(1994)h(b)o(y)g
+(the)g(Asso)q(ciation)f(for)h(Computing)e(Mac)o(hinery)m(,)h(Inc.)22
+b(T)m(o)14 b(app)q(ear)e(in)h(LOPLAS)-42 2558 y(2\(1{4\).)5
+2586 y Fn(1)22 2598 y Fo(Also)f(kno)o(wn)e(as)i(Co)q(c)o(ktail)e
+(\(Compiler-Compi)o(ler-)o(T)m(o)q(olb)q(o)n(x)f(Karlsruhe\).)923
+2748 y Fr(1)p eop
+%%Page: 2 2
+2 1 bop -42 195 a Fr(generated)21 b(b)o(y)d(these)i(to)q(ols)f(assume)f
+(the)i(existence)g(of)e(a)h(library)f(of)g(supp)q(ort)h(mo)q(dules)f
+(for)h(error)g(handling,)g(input)-42 245 y(bu\013ering,)c(sym)o(b)q(ol)
+d(table)i(managemen)o(t,)d(and)j(similar)e(functions.)18
+b(While)c(these)h(supp)q(ort)g(mo)q(dules)e(simplify)f(the)i(task)-42
+295 y(of)c(implemen)o(ting)c(a)k(compiler)f(or)h(in)o(terpreter,)i
+(they)e(mak)o(e)f(adaptation)g(to)h(other)g(purp)q(oses)i(more)d
+(di\016cult.)16 b(Adaptation)-42 345 y(to)e(other)h(en)o(vironmen)o(ts)
+e(is)h(also)f(made)g(more)g(di\016cult)g(b)q(ecause)j(often)e
+(assumptions)f(are)i(made)d(ab)q(out)i(the)h(input)f(and)-42
+394 y(restrictions)j(are)e(placed)g(on)g(tok)o(ens)g(in)g(order)g(to)g
+(ac)o(hiev)o(e)g(b)q(etter)i(p)q(erformance.)k(RE2C)14
+b(go)q(es)i(to)f(the)g(other)h(extreme:)-42 444 y(it)e(concen)o(trates)
+i(solely)d(on)h(generating)g(co)q(de)h(for)e(matc)o(hing)f(regular)i
+(expressions.)21 494 y(RE2C)f(is)h(successful)h(at)f(its)g(task:)k(not)
+13 b(only)g(do)q(es)i(it)e(pro)q(duce)i(scanners)h(whic)o(h)e(are)g
+(faster)g(than)g(those)g(created)i(b)o(y)-42 544 y(other)g(scanner)h
+(generators)f(but,)f(surprisingly)m(,)f(they)i(are)g(usually)e(smaller)
+f(as)j(w)o(ell.)21 b(F)m(urther,)15 b(RE2C)g(do)q(es)h(not)f(mak)o(e)
+-42 594 y(an)o(y)i(assumptions)e(ab)q(out)h(the)h(input)g(or)f(place)h
+(an)o(y)f(restrictions)i(on)e(tok)o(ens.)26 b(T)m(o)16
+b(a)g(large)g(degree,)i(the)g(p)q(erformance)-42 643
+y(and)d(\015exibilit)o(y)d(of)i(RE2C-generated)h(scanners)h(is)f(due)f
+(to)h(a)f(no)o(v)o(el)f(metho)q(d)h(for)g(determining)f(when)i(to)f
+(re\014ll)g(a)g(bu\013er)-42 693 y(whic)o(h)g(a)o(v)o(oids)f(the)i
+(complications)c(in)o(tro)q(duced)k(b)o(y)f(the)g(sen)o(tinel)h(metho)q
+(d)e([1)o(].)21 743 y(The)e(follo)o(wing)d(sections)j(of)f(this)h(pap)q
+(er)g(describ)q(e)i(RE2C)d(scanner)i(sp)q(eci\014cations,)f(discuss)h
+(ho)o(w)e(these)i(sp)q(eci\014cations)-42 793 y(are)21
+b(con)o(v)o(erted)g(in)o(to)f(scanners,)j(and)d(giv)o(e)f(p)q
+(erformance)h(results)h(ac)o(hiev)o(ed)g(b)o(y)f(our)g(implemen)o
+(tatio)o(n)d(\(including)j(a)-42 843 y(comparison)13
+b(with)g(GLA\).)-42 980 y Fs(2)67 b(Scanner)24 b(Sp)r(eci\014cations)
+-42 1071 y Fr(An)14 b(RE2C)g(source)h(\014le)f(consists)h(of)e(C[14)o
+(])g(or)h(C++[4])842 1056 y Fq(2)874 1071 y Fr(co)q(de)g(in)o(terlea)o
+(v)o(ed)g(with)g(commen)o(ts)e(of)h(the)i(form)d Fm(/*!re2c)20
+b Fl(:)7 b(:)g(:)-42 1121 y Fm(*/)15 b Fr(con)o(taining)f(scanner)i(sp)
+q(eci\014cations.)23 b(These)16 b(sp)q(eci\014cations)g(are)g(replaced)
+g(with)e(generated)j(co)q(de)e(that)g(is)g(in)o(v)o(ok)o(ed)-42
+1170 y(simply)d(b)o(y)i(\\falling)d(in)o(to")i(the)i(commen)o(ts)d(as)i
+(illustrated)g(in)f(Figure)h(1)g(and)f(in)h(App)q(endix)g(A)1481
+1155 y Fq(3)1500 1170 y Fr(.)469 1254 y Fm(#define)20
+b(YYCURSOR)42 b(p)469 1304 y(unsigned)20 b(char)h(*scan)p
+887 1304 14 2 v 14 w(uint\(unsigned)e(char)i(*p\))p Fk(f)469
+1353 y Fm(/*!re2c)556 1403 y([0-9]+)195 b Fk(f)p Fm(return)20
+b(p;)p Fk(g)556 1453 y Fm([\\)o(000-\\)o(377])87 b Fk(f)p
+Fm(return)20 b(NULL;)p Fk(g)469 1503 y Fm(*/)469 1553
+y Fk(g)681 1634 y Fr(Figure)14 b(1:)k(A)c(simple)f(scanner.)21
+1733 y(A)i(scanner)h(sp)q(eci\014cation)f(tak)o(es)g(the)g(form)e(of)h
+(a)h(list)f(of)g(rules,)h(eac)o(h)g(rule)g(consisting)g(of)f(a)g
+(regular)h(expression)h([10)o(])-42 1783 y(and)g(an)g(action)f
+(expressed)k(in)c(executable)i(co)q(de.)25 b(Figure)16
+b(2)g(illustrates)g(a)g(trivial)e(RE2C)h(scanner)j(sp)q(eci\014cation)e
+(that)-42 1833 y(will)c(b)q(e)h(used)h(as)f(an)f(example)g(throughout)g
+(this)h(pap)q(er.)36 b(Eac)o(h)14 b(call)d(to)i(the)g(co)q(de)h
+(generated)g(from)d(a)h(sp)q(eci\014cation)i(will)416
+1926 y Fm("print")201 b Fk(f)22 b Fm(return)e(PRINT;)49
+b(/*)21 b(rule)g(5)h(*/)f Fk(g)416 1975 y Fm([a-z])o(+)224
+b Fk(f)22 b Fm(return)e(ID;)115 b(/*)21 b(rule)g(4)h(*/)f
+Fk(g)416 2025 y Fm([0-9])o(+)224 b Fk(f)22 b Fm(return)e(DEC;)93
+b(/*)21 b(rule)g(3)h(*/)f Fk(g)416 2075 y Fm("0x")g([0-9a-f])n(+)50
+b Fk(f)22 b Fm(return)e(HEX;)93 b(/*)21 b(rule)g(2)h(*/)f
+Fk(g)416 2125 y Fm([\\000-\\)o(377])114 b Fk(f)22 b Fm(return)e(ERR;)93
+b(/*)21 b(rule)g(1)h(*/)f Fk(g)108 2214 y Fr(Figure)15
+b(2:)20 b(Sample)13 b(sp)q(eci\014cation.)22 b Fm([)p
+Fl(a)p Fm(-)p Fl(b)p Fm(])14 b Fr(matc)o(hes)h(an)o(y)f(c)o(haracter)i
+(b)q(et)o(w)o(een)g Fl(a)f Fr(and)g Fl(b)p Fr(,)f(inclusiv)o(ely)m(.)
+108 2264 y(The)i(last)f(rule,)g(for)g(example,)e(will)h(matc)o(h)g(an)o
+(y)g(eigh)o(t)h(bit)g(c)o(haracter.)23 b(Rules)15 b(are)g(listed)h(in)e
+(order)i(of)108 2314 y(precedence)q(.)-42 2414 y(\014rst)d(determine)g
+(the)f(longest)h(p)q(ossible)f(pre\014x)h(of)f(the)h(remaining)d(input)
+i(that)g(matc)o(hes)g(one)g(of)g(the)h(regular)f(expressions)-42
+2463 y(and)i(will)f(then)h(execute)i(the)e(action)g(in)f(the)i(\014rst)
+g(applicable)e(rule.)p -42 2498 780 2 v 5 2525 a Fn(2)22
+2537 y Fo(Retargetting)8 b(RE2C)k(to)f(a)h(di\013eren)o(t)d(language)g
+(is)i(straigh)o(tforw)o(ard.)5 2564 y Fn(3)22 2576 y
+Fo(RE2C-generated)e(scanners)g(require)h(no)h(additional)d(supp)q(ort)i
+(co)q(de.)923 2748 y Fr(2)p eop
+%%Page: 3 3
+3 2 bop 138 1062 a @beginspecial 53 @llx 268 @lly 435
+@urx 486 @ury 3820 @rwi @setspecial
+%%BeginDocument: scanner.eps
+
+
+
+
+
+
+
+
+
+
+
+/AutoFlatness false def
+
+% -------------- POSTSCRIPT PROLOG FOR CORELDRAW 3.X ------
+
+% Copyright 1992 Corel Corporation. All rights reserved.
+
+/wCorelDict 300 dict def wCorelDict begin/bd{bind def}bind def
+
+/ld{load def}bd/xd{exch def}bd/_ null def
+
+/$c 0 def/$m 0 def/$y 0 def/$k 0 def/$t 1 def
+
+/$n _ def/$o 0 def/$fil 0 def/$bkg false def
+
+/$C 0 def/$M 0 def/$Y 0 def/$K 0 def/$T 1 def
+
+/$N _ def/$O 0 def/$PF false def/$ctm matrix currentmatrix def
+
+/$ptm matrix def/$ttm matrix def/$stm matrix def
+
+/$fst 128 def/$pad 0 def/$rox 0 def/$roy 0 def
+
+currentscreen/@dsp xd/$dsp/@dsp def/$dsa xd
+
+/$dsf xd/$sdf false def/$SDF false def/$Scra 0.0 def
+
+/$sv 0 def/@cp/closepath ld/@gs/gsave ld/@gr/grestore ld
+
+/@np/newpath ld/@sv{/$sv save def}bd/@rs{$sv restore}bd
+
+/@ss{exch $Scra add exch load setscreen}bd
+
+AutoFlatness{/$cpx ([Error: PathTooComplex; OffendingCommand: AnyPaintingOperator]\n) def
+
+/@err1{$cpx print flush newpath}bd/@ifl{dup currentflat exch sub 10 gt
+
+{@err1 exit}{currentflat 2 add setflat}ifelse}bd
+
+/@fill/fill ld/fill{currentflat{{@fill}stopped{@ifl}{exit}ifelse
+
+}bind loop setflat}bd/@eofill/eofill ld/eofill{currentflat{{@eofill}
+
+stopped{@ifl}{exit}ifelse}bind loop setflat}bd
+
+/@clip/clip ld/clip{currentflat{{@clip}stopped{initclip @ifl}{exit
+
+}ifelse}bind loop setflat}bd/@eoclip/eoclip ld
+
+/eoclip{currentflat{{@eoclip}stopped{initclip @ifl}{exit}ifelse
+
+}bind loop setflat}bd/@stroke/stroke ld/stroke{currentflat{{@stroke}
+
+stopped{@ifl}{exit}ifelse}bind loop setflat}bd}if
+
+/InRange{3 -1 roll 2 copy le{pop}{exch pop}ifelse
+
+2 copy ge{pop}{exch pop}ifelse}bd/wDstChck{2 1 roll dup 3 -1 roll
+
+eq{1 add}if}bd/@dot{dup mul exch dup mul add 1 exch sub 2 div}bd
+
+/@lin{exch pop abs 1 exch sub}bd/@MN{2 copy le{pop}{exch pop}ifelse}bd
+
+/setcmykcolor where{pop}{/setcmykcolor{4 1 roll
+
+3{3 index add 1 @MN 1 exch sub 3 1 roll}repeat
+
+setrgbcolor pop}bd}ifelse/setoverprint{/$op xd}bd
+
+/currentoverprint{$op}bd/setsepcolor{1 exch sub setgray}bd
+
+/checksepcolor{1 exch sub dup setgray 1 eq exch 1 eq and not}bd
+
+/setprocesscolor{ColorSeparationMode 0 eq{setcmykcolor}{
+
+0 4 $ink sub index exch pop 5 1 roll 4{pop}repeat
+
+setsepcolor}ifelse}bd/findcmykcustomcolor{5 array astore}bd
+
+/setcustomcolor where{pop}{/setcustomcolor{ColorSeparationMode 0 eq{
+
+exch aload pop pop 4{4 index mul 4 1 roll}repeat
+
+5 -1 roll pop setcmykcolor}{exch aload pop
+
+CurrentInkName eq{4 index}{0}ifelse 6 1 roll
+
+5{pop}repeat setsepcolor}ifelse}bd}ifelse/colorimage where{pop}{
+
+/colorimage{pop pop pop pop pop{currentfile $dat readhexstring pop pop}
+
+repeat pop}bd}ifelse/@tc{dup 1 ge{pop}{4{dup
+
+6 -1 roll mul exch}repeat pop}ifelse}bd/@scc{1 eq setoverprint
+
+dup _ eq{pop setprocesscolor pop}{findcmykcustomcolor
+
+exch setcustomcolor}ifelse ColorSeparationMode 0 eq{true}{
+
+currentgray 1 eq currentoverprint and not}ifelse}bd
+
+/@sft{/$tx $tllx $pxf add dup $tllx gt{$pwid sub}if def
+
+/$ty $tury $pyf sub dup $tury lt{$phei add}if def}bd
+
+/@stb{pathbbox/$ury xd/$urx xd/$lly xd/$llx xd}bd
+
+/@ep{{cvx exec}forall}bd/@tp{@sv/$in true def
+
+2 copy dup $lly le{/$in false def}if $phei sub $ury ge{/$in false def}if
+
+dup $urx ge{/$in false def}if $pwid add $llx le{/$in false def}if
+
+$in{@np 2 copy m $pwid 0 rl 0 $phei neg rl $pwid neg 0 rl
+
+0 $phei rl clip @np $pn cvlit load aload pop
+
+7 -1 roll 5 index sub 7 -1 roll 3 index sub translate
+
+/$ctm matrix currentmatrix def @ep pop pop pop pop}{pop pop}ifelse
+
+@rs}bd/@th{@sft 0 1 $tly 1 sub{dup $psx mul $tx add{
+
+dup $llx gt{$pwid sub}{exit}ifelse}loop exch $phei mul $ty exch sub
+
+0 1 $tlx 1 sub{$pwid mul 3 copy 3 -1 roll add exch
+
+@tp pop}for pop pop}for}bd/@tv{@sft 0 1 $tlx 1 sub{dup $pwid mul $tx add
+
+exch $psy mul $ty exch sub{dup $ury lt{$phei add}{exit}ifelse}loop
+
+0 1 $tly 1 sub{$phei mul 3 copy sub @tp pop}for
+
+pop pop}for}bd/@pf{@gs $ctm setmatrix $pm concat
+
+@stb eoclip Bburx Bbury $pm itransform/$tury xd/$turx xd
+
+Bbllx Bblly $pm itransform/$tlly xd/$tllx xd
+
+/$wid $turx $tllx sub def/$hei $tury $tlly sub def
+
+@gs $vectpat{1 0 0 0 0 _ $o @scc{eofill}if}{$t $c $m $y $k $n $o @scc{
+
+$tllx $tlly translate $wid $hei scale <00> 8 1 false [ 8 0 0 1 0 0 ]{}imagemask
+
+/$bkg true def}if}ifelse @gr $wid 0 gt $hei 0 gt and{
+
+$pn cvlit load aload pop/$pd xd 3 -1 roll sub/$phei xd
+
+exch sub/$pwid xd/$tlx $wid $pwid div ceiling 1 add def
+
+/$tly $hei $phei div ceiling 1 add def $psx 0 eq{@tv}{@th}ifelse}if
+
+@gr @np/$bkg false def}bd/@dlt{ColorSeparationMode 0 eq{
+
+/$dc $toc $tot mul $frc $frt mul dup/$c xd sub $fst 1 sub div def
+
+/$dm $tom $tot mul $frm $frt mul dup/$m xd sub $fst 1 sub div def
+
+/$dy $toy $tot mul $fry $frt mul dup/$y xd sub $fst 1 sub div def
+
+/$dk $tok $tot mul $frk $frt mul dup/$k xd sub $fst 1 sub div def
+
+true}{$frt $frc $frm $fry $frk $frn $o @scc
+
+dup{/$frk 1 currentgray sub def}{/$frk 0 def}ifelse
+
+$tot $toc $tom $toy $tok $ton $o @scc dup{/$tok 1 currentgray sub def}{
+
+/$tok 0 def}ifelse or dup{/$c 0 def/$m 0 def/$y 0 def/$k $frk def
+
+/$dc 0 def/$dm 0 def/$dy 0 def/$dk $tok $frk sub $fst 1 sub div def}if
+
+}ifelse}bd/@ftl{1 index 4 index sub dup $pad mul dup/$pdw xd
+
+2 mul sub $fst div/$wid xd 2 index sub/$hei xd
+
+pop translate $c $m $y $k 4 copy ColorSeparationMode 0 ne
+
+{1 exch sub setgray pop pop pop}{setcmykcolor}ifelse
+
+0 0 moveto 0 $hei lineto $pdw $hei lineto $pdw 0 lineto 0 0 lineto fill
+
+$pdw 0 translate $fst{4 copy ColorSeparationMode 0 ne
+
+{1 exch sub setgray pop pop pop}{setcmykcolor}ifelse
+
+0 0 moveto 0 $hei lineto $wid $hei lineto $wid 0 lineto 0 0 lineto fill
+
+$wid 0 translate $dk add 4 1 roll $dy add 4 1 roll
+
+$dm add 4 1 roll $dc add 4 1 roll}repeat $dk sub 4 1 roll
+
+$dy sub 4 1 roll $dm sub 4 1 roll $dc sub 4 1 roll
+
+ColorSeparationMode 0 ne{1 exch sub setgray pop pop pop}
+
+{setcmykcolor}ifelse 0 0 moveto 0 $hei lineto $pdw $hei lineto $pdw 0 lineto 0 0 lineto fill
+
+}bd/@ftr{1 index 4 index sub dup $rox mul/$row xd
+
+2 div 1 index 4 index sub dup $roy mul/$roh xd
+
+2 div 2 copy dup mul exch dup mul add sqrt
+
+$row dup mul $roh dup mul add sqrt add dup/$hei xd $fst div/$wid xd
+
+4 index add $roh add exch 5 index add $row add
+
+exch translate pop pop pop pop currentflat dup 5 mul setflat
+
+$c $m $y $k 4 copy ColorSeparationMode 0 ne
+
+{1 exch sub setgray pop pop pop}{setcmykcolor}ifelse
+
+$wid 0 moveto 0 0 $hei 0 360 arc fill 1.0 $pad 2 mul sub dup scale
+
+$fst{4 copy ColorSeparationMode 0 ne{1 exch sub setgray pop pop pop}
+
+{setcmykcolor}ifelse $wid 0 moveto 0 0 $hei 0 360 arc fill
+
+/$hei $hei $wid sub def $dk add 4 1 roll $dy add 4 1 roll
+
+$dm add 4 1 roll $dc add 4 1 roll}repeat pop pop pop pop
+
+setflat}bd/@ff{@gs @dlt{$ctm setmatrix eoclip
+
+newpath Bbllx Bblly moveto Bbllx Bbury lineto
+
+Bburx Bbury lineto Bburx Bblly lineto $fan rotate
+
+pathbbox newpath $fty 1 eq{@ftr}{@ftl}ifelse}if
+
+@gr @np}bd/@Pf{@sv ColorSeparationMode 0 eq $ink 3 eq or{0 J 0 j [] 0 d
+
+$t $c $m $y $k $n $o @scc pop $ctm setmatrix
+
+72 1000 div dup matrix scale dup concat dup Bburx exch Bbury exch itransform
+
+ceiling cvi/Bbury xd ceiling cvi/Bburx xd Bbllx exch Bblly exch itransform
+
+floor cvi/Bblly xd floor cvi/Bbllx xd $Prm aload pop
+
+$Psn load exec}{1 setgray eofill}ifelse @rs
+
+@np}bd/g{1 exch sub/$k xd/$c 0 def/$m 0 def/$y 0 def/$t 1 def/$n _ def/$fil 0 def
+
+}bd/G{1 exch sub/$K xd/$C 0 def/$M 0 def/$Y 0 def/$T 1 def/$N _ def}bd
+
+/k{/$k xd/$y xd/$m xd/$c xd/$t 1 def/$n _ def/$fil 0 def}bd
+
+/K{/$K xd/$Y xd/$M xd/$C xd/$T 1 def/$N _ def}bd
+
+/x{/$t xd/$n xd/$k xd/$y xd/$m xd/$c xd/$fil 0 def}bd
+
+/X{/$T xd/$N xd/$K xd/$Y xd/$M xd/$C xd}bd
+
+/d/setdash ld/i{dup 0 ne{setflat}{pop}ifelse}bd
+
+/j/setlinejoin ld/J/setlinecap ld/M/setmiterlimit ld
+
+/w/setlinewidth ld/O{/$o xd}bd/R{/$O xd}bd
+
+/c/curveto ld/C/c ld/v{4 -2 roll 2 copy 6 -2 roll curveto}bd
+
+/V/v ld/y{2 copy curveto}bd/Y/y ld/l/lineto ld
+
+/L/l ld/rl/rlineto ld/m/moveto ld/n/newpath ld
+
+/N/newpath ld/F{matrix currentmatrix $sdf{$scf $sca $scp @ss}if
+
+$fil 1 eq{@pf}{$fil 2 eq{@ff}{$fil 3 eq{@Pf}{$t $c $m $y $k $n $o @scc
+
+{eofill}{@np}ifelse}ifelse}ifelse}ifelse $sdf{$dsf $dsa $dsp @ss}if
+
+setmatrix}bd/f{@cp F}bd/S{matrix currentmatrix
+
+$ctm setmatrix $SDF{$SCF $SCA $SCP @ss}if $T $C $M $Y $K $N $O @scc{
+
+matrix currentmatrix $ptm concat stroke setmatrix}{@np}ifelse
+
+$SDF{$dsf $dsa $dsp @ss}if setmatrix}bd/s{@cp
+
+S}bd/B{@gs F @gr S}bd/b{@cp B}bd/W{eoclip}bd
+
+/p{/$pm xd 7{pop}repeat/$pyf xd/$pxf xd/$pn xd
+
+/$fil 1 def}bd/P{11{pop}repeat}bd/u{}bd/U{}bd
+
+/A{pop}bd/q/@gs ld/Q/@gr ld/E{5 array astore
+
+exch cvlit exch def}bd/`{}bd/~{}bd/@{}bd/&{}bd
+
+/CorelDrawReencodeVect [ 16#82/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl
+
+16#88/circumflex/perthousand/Scaron/guilsinglleft/OE
+
+16#91/quoteleft/quoteright/quotedblleft/quotedblright/bullet/endash/emdash
+
+16#98/tilde/trademark/scaron/guilsinglright/oe
+
+16#9F/Ydieresis 16#A1/exclamdown/cent/sterling/currency/yen/brokenbar/section
+
+16#a8/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/minus/registered/macron
+
+16#b0/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph/periodcentered
+
+16#b8/cedilla/onesuperior/ordmasculine/guillemotright/onequarter/onehalf/threequarters/questiondown
+
+16#c0/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla
+
+16#c8/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex/Idieresis
+
+16#d0/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply
+
+16#d8/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls
+
+16#e0/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla
+
+16#e8/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis
+
+16#f0/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide
+
+16#f8/oslash/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis
+
+] def/@cc{currentfile $dat readhexstring pop}bd
+
+/@sm{/$ctm $ctm currentmatrix def}bd/@E{/Bbury xd/Bburx xd
+
+/Bblly xd/Bbllx xd}bd/@c{@cp}bd/@p{/$fil 1 def
+
+1 eq/$vectpat xd/$pm xd/$psy xd/$psx xd/$pyf xd/$pxf xd
+
+/$pn xd}bd/@P{/$fil 3 def/$Psn xd array astore
+
+/$Prm xd}bd/@k{/$fil 2 def/$roy xd/$rox xd/$pad xd
+
+/$fty xd/$fan xd $fty 1 eq{/$fan 0 def}if/$tok xd/$toy xd/$tom xd/$toc xd
+
+/$frk xd/$fry xd/$frm xd/$frc xd/$frn _ def/$frt 1 def/$ton _ def/$tot 1 def
+
+}bd/@x{/$fil 2 def/$roy xd/$rox xd/$pad xd
+
+/$fty xd/$fan xd/$tot xd/$ton xd/$tok xd/$toy xd/$tom xd/$toc xd
+
+/$frt xd/$frn xd/$frk xd/$fry xd/$frm xd/$frc xd}bd
+
+/@ii{concat 3 index 3 index m 3 index 1 index l
+
+2 copy l 1 index 3 index l 3 index 3 index l
+
+clip pop pop pop pop}bd/@i{@sm @gs @ii 6 index 1 ne{/$frg true def
+
+pop pop}{1 eq{$T $C $M $Y $K $N $O @scc/$frg xd}{/$frg false def
+
+}ifelse 1 eq{@gs $ctm setmatrix $t $c $m $y $k $n $o @scc{eofill}if
+
+@gr}if}ifelse/$frg $frg $bkg or def @np/$ury xd/$urx xd/$lly xd/$llx xd
+
+/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul 8 div ceiling cvi string def
+
+$frg{$SDF{$SCF $SCA $SCP @ss}if $llx $lly translate
+
+$urx $llx sub $ury $lly sub scale $wid $hei abs
+
+$bts 1 eq{false}{$bts}ifelse [ $wid 0 0 $hei neg 0
+
+$hei 0 gt{$hei}{0}ifelse]/@cc load $bts 1 eq{imagemask}{image}ifelse
+
+$SDF{$dsf $dsa $dsp @ss}if}{$hei abs{@cc pop}repeat}ifelse
+
+@gr $ctm setmatrix}def/@M{@sv}bd/@N{/@cc{}def
+
+1 eq{12 -1 roll neg 12 1 roll @I}{13 -1 roll neg 13 1 roll
+
+@i}ifelse @rs}bd/@I{@sm @gs @ii @np/$ury xd/$urx xd/$lly xd/$llx xd
+
+/$ncl xd/$bts xd/$hei xd/$wid xd/$dat $wid $bts mul $ncl mul 8 div ceiling cvi string def
+
+$llx $lly translate $urx $llx sub $ury $lly sub scale
+
+$wid $hei abs $bts [ $wid 0 0 $hei neg 0 $hei 0 gt{$hei}{0}ifelse]
+
+/@cc load false $ncl colorimage @gr $ctm setmatrix}bd
+
+/z{exch findfont exch scalefont setfont}bd
+
+/ZB{9 dict dup begin 4 1 roll/FontType 3 def
+
+/FontMatrix xd/FontBBox xd/Encoding 256 array def
+
+0 1 255{Encoding exch/.notdef put}for/CharStrings 256 dict def
+
+CharStrings/.notdef{}put/Metrics 256 dict def
+
+Metrics/.notdef 3 -1 roll put/BuildChar{exch
+
+dup/$char exch/Encoding get 3 index get def
+
+dup/Metrics get $char get aload pop setcachedevice
+
+begin Encoding exch get CharStrings exch get
+
+end exec}def end definefont pop}bd/ZBAddChar{findfont begin
+
+dup 4 1 roll dup 6 1 roll Encoding 3 1 roll put
+
+CharStrings 3 1 roll put Metrics 3 1 roll put
+
+end}bd/Z{findfont dup maxlength 2 add dict exch
+
+dup{1 index/FID ne{3 index 3 1 roll put}{pop pop}ifelse}forall
+
+pop dup dup/Encoding get 256 array copy dup/$fe xd
+
+/Encoding exch put dup/Fontname 3 index put
+
+3 -1 roll dup length 0 ne{0 exch{dup type 0 type eq{exch pop}{
+
+$fe exch 2 index exch put 1 add}ifelse}forall
+
+pop}if dup 256 dict dup/$met xd/Metrics exch put
+
+dup/FontMatrix get 0 get 1000 mul 1 exch div
+
+3 index length 256 eq{0 1 255{dup $fe exch get
+
+dup/.notdef eq{pop pop}{5 index 3 -1 roll get
+
+2 index mul $met 3 1 roll put}ifelse}for}if
+
+pop definefont pop pop}bd/@ftx{{currentpoint 3 -1 roll
+
+(0) dup 3 -1 roll 0 exch put dup @gs true charpath
+
+$ctm setmatrix @@txt @gr @np stringwidth pop 3 -1 roll add exch moveto
+
+}forall}bd/@ft{matrix currentmatrix exch $sdf{$scf $sca $scp @ss}if
+
+$fil 1 eq{/@@txt/@pf ld @ftx}{$fil 2 eq{/@@txt/@ff ld @ftx}{$fil 3 eq
+
+{/@@txt/@Pf ld @ftx}{$t $c $m $y $k $n $o @scc{show}{pop}ifelse}ifelse
+
+}ifelse}ifelse $sdf{$dsf $dsa $dsp @ss}if setmatrix}bd
+
+/@st{matrix currentmatrix exch $SDF{$SCF $SCA $SCP @ss}if
+
+$T $C $M $Y $K $N $O @scc{{currentpoint 3 -1 roll
+
+(0) dup 3 -1 roll 0 exch put dup @gs true charpath
+
+$ctm setmatrix $ptm concat stroke @gr @np stringwidth pop 3 -1 roll add exch moveto
+
+}forall}{pop}ifelse $SDF{$dsf $dsa $dsp @ss}if
+
+setmatrix}bd/@te{@ft}bd/@tr{@st}bd/@ta{dup
+
+@gs @ft @gr @st}bd/@t@a{dup @gs @st @gr @ft}bd
+
+/@tm{/$textsave save def @sm concat}bd/e{/t{@te}def}bd
+
+/r{/t{@tr}def}bd/o{/t{pop}def}bd/a{/t{@ta}def}bd
+
+/@a{/t{@t@a}def}bd/t{@te}def/T{@np $ctm setmatrix
+
+/$ttm matrix def $textsave restore}bd/@t{/$stm $stm currentmatrix def
+
+3 1 roll moveto $ttm concat t $stm setmatrix}def
+
+/@n{/$ttm exch matrix rotate def}bd/@s{}bd
+
+/@l{}bd/@B{@gs S @gr F}bd/@b{@cp @B}bd/@w{matrix rotate/$ptm xd
+
+matrix scale $ptm dup concatmatrix/$ptm xd
+
+1 eq{$ptm exch dup concatmatrix/$ptm xd}if
+
+1 w}bd/@g{1 eq dup/$sdf xd{/$scp xd/$sca xd
+
+/$scf xd}if}bd/@G{1 eq dup/$SDF xd{/$SCP xd
+
+/$SCA xd/$SCF xd}if}bd/@D{3 copy @ss/$dsp xd
+
+/$dsa xd/$dsf xd}bd/@j{@sv @np}bind def/@J{@rs}bind def
+
+/@sep{/ColorSeparationMode where{pop}{/ColorSeparationMode 0 def
+
+/CurrentInkName (Composite) def}ifelse ColorSeparationMode 0 eq{
+
+/CurrentInkName (Composite) def}if/CurrentInkName where{pop}{
+
+/CurrentInkName (Composite) def}ifelse CurrentInkName (Composite) eq
+
+{/$ink -1 def}{CurrentInkName (Cyan) eq{/$ink 0 def}{
+
+CurrentInkName (Magenta) eq{/$ink 1 def}{CurrentInkName (Yellow) eq
+
+{/$ink 2 def}{CurrentInkName (Black) eq{/$ink 3 def}{/$ink 4 def
+
+}ifelse}ifelse}ifelse}ifelse}ifelse}bd @sep
+
+/@whi{@gs -72000 dup moveto -72000 72000 lineto
+
+72000 dup lineto 72000 -72000 lineto closepath 1 setgray fill
+
+@gr}bd/@neg{ [{1 exch sub}/exec cvx currenttransfer/exec cvx] cvx settransfer
+
+@whi}bd/@reg{[] 0 d 0 setgray .3 setlinewidth
+
+2 copy 5.4 0 360 arc closepath 2 copy moveto 9 0 rlineto
+
+2 copy moveto -9 0 rlineto 2 copy moveto 0 9 rlineto
+
+moveto 0 -9 rlineto stroke}bd/leftbracket{(\050)}def
+
+/rightbracket{(\051)}def
+
+
+
+
+
+11.4737 setmiterlimit
+
+1.00 setflat
+
+/$fst 128 def
+
+[ 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 229
+
+229 291 457 457 732 543 182 275 275 322 480 229 275 229 229 457
+
+457 457 457 457 457 457 457 457 457 229 229 480 480 480 457 836
+
+543 543 592 592 543 504 639 592 229 408 543 457 686 592 639 543
+
+639 592 543 504 592 543 771 543 543 504 229 229 229 387 457 275
+
+457 457 408 457 457 229 457 457 182 182 408 182 686 457 457 457
+
+457 275 408 229 457 408 592 408 408 408 275 213 275 480 750 750
+
+750 750 457 275 818 457 457 275 818 750 275 818 750 750 750 750
+
+182 182 275 275 229 457 818 275 818 750 275 771 750 750 750 750
+
+275 457 457 457 457 148 457 275 605 299 457 480 750 605 750 750
+
+750 750 750 275 750 441 750 275 750 299 457 750 750 750 504 543
+
+543 543 543 543 543 818 592 543 543 543 543 229 229 229 229 750
+
+592 639 639 639 639 639 750 639 592 592 592 592 543 750 504 457
+
+457 457 457 457 457 732 408 457 457 457 457 229 229 229 229 750
+
+457 457 457 457 457 457 750 504 457 457 457 457 408 750 408 ]
+
+CorelDrawReencodeVect /_Helvetica-Narrow /Helvetica-Narrow Z
+
+[ 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 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600
+
+600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 ]
+
+CorelDrawReencodeVect /_Courier /Courier Z
+
+
+
+
+@sv
+
+/$ctm matrix currentmatrix def
+
+@sv
+
+
+106.13 392.62 110.02 399.38 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 106 392] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (0) @t
+
+T
+
+
+160.70 392.69 163.30 399.31 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 160 392] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (1) @t
+
+T
+
+
+214.06 392.69 217.94 399.24 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 214 392] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (2) @t
+
+T
+
+
+268.06 392.54 271.94 399.24 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 268 392] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (3) @t
+
+T
+
+
+321.98 392.47 325.94 399.10 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 322 392] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (4) @t
+
+T
+
+
+375.98 392.40 379.94 399.10 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 376 392] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (5) @t
+
+T
+
+
+159.98 446.69 163.94 453.38 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 160 446] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (6) @t
+
+T
+
+
+106.06 338.83 110.09 345.38 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 106 338] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (7) @t
+
+T
+
+
+159.98 338.62 163.94 345.46 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 160 338] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (8) @t
+
+T
+
+
+106.13 284.62 110.02 291.46 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 106 284] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (9) @t
+
+T
+
+
+157.97 284.69 166.10 291.53 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 158 285] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (10) @t
+
+T
+
+
+104.54 446.69 111.53 453.31 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 104 446] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 125.00 z
+
+0 0 (11) @t
+
+T
+
+
+112.54 440.93 114.55 445.97 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 112 440] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (1) @t
+
+T
+
+
+166.46 278.93 169.49 283.97 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 166 278] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (2) @t
+
+T
+
+
+112.46 332.86 115.49 337.90 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 112 332] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (3) @t
+
+T
+
+
+166.46 332.86 169.49 337.90 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 166 332] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (3) @t
+
+T
+
+
+328.46 386.93 331.56 391.97 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 328 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (4) @t
+
+T
+
+
+274.46 386.93 277.56 391.97 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 274 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (4) @t
+
+T
+
+
+220.46 386.93 223.56 391.97 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 220 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (4) @t
+
+T
+
+
+166.46 386.93 169.56 391.97 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 166 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (4) @t
+
+T
+
+
+166.46 440.93 169.56 445.97 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 166 440] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (4) @t
+
+T
+
+
+382.46 386.78 385.56 391.90 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 382 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Helvetica-Narrow 97.00 z
+
+0 0 (5) @t
+
+T
+
+
+94.54 382.54 121.61 409.46 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.07 409.46 m
+
+115.49 409.46 121.61 403.42 121.61 396.00 c
+
+121.61 388.58 115.49 382.54 108.07 382.54 c
+
+100.66 382.54 94.54 388.58 94.54 396.00 c
+
+94.54 403.42 100.66 409.46 108.07 409.46 c
+
+@c
+
+S
+
+
+94.54 274.54 121.61 301.46 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.07 301.46 m
+
+115.49 301.46 121.61 295.42 121.61 288.00 c
+
+121.61 280.58 115.49 274.54 108.07 274.54 c
+
+100.66 274.54 94.54 280.58 94.54 288.00 c
+
+94.54 295.42 100.66 301.46 108.07 301.46 c
+
+@c
+
+S
+
+
+94.54 328.61 121.61 355.54 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.07 355.54 m
+
+115.49 355.54 121.61 349.49 121.61 342.07 c
+
+121.61 334.66 115.49 328.61 108.07 328.61 c
+
+100.66 328.61 94.54 334.66 94.54 342.07 c
+
+94.54 349.49 100.66 355.54 108.07 355.54 c
+
+@c
+
+S
+
+
+95.83 329.98 120.17 354.31 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.00 354.31 m
+
+114.62 354.31 120.17 348.91 120.17 342.14 c
+
+120.17 335.45 114.62 329.98 108.00 329.98 c
+
+101.30 329.98 95.83 335.45 95.83 342.14 c
+
+95.83 348.91 101.30 354.31 108.00 354.31 c
+
+@c
+
+S
+
+
+148.46 328.54 175.54 355.46 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+162.00 355.46 m
+
+169.42 355.46 175.54 349.42 175.54 342.00 c
+
+175.54 334.58 169.42 328.54 162.00 328.54 c
+
+154.58 328.54 148.46 334.58 148.46 342.00 c
+
+148.46 349.42 154.58 355.46 162.00 355.46 c
+
+@c
+
+S
+
+
+149.76 329.90 174.10 354.24 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+161.93 354.24 m
+
+168.55 354.24 174.10 348.84 174.10 342.07 c
+
+174.10 335.38 168.55 329.90 161.93 329.90 c
+
+155.23 329.90 149.76 335.38 149.76 342.07 c
+
+149.76 348.84 155.23 354.24 161.93 354.24 c
+
+@c
+
+S
+
+
+148.46 436.54 175.54 463.46 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+162.00 463.46 m
+
+169.42 463.46 175.54 457.42 175.54 450.00 c
+
+175.54 442.58 169.42 436.54 162.00 436.54 c
+
+154.58 436.54 148.46 442.58 148.46 450.00 c
+
+148.46 457.42 154.58 463.46 162.00 463.46 c
+
+@c
+
+S
+
+
+149.76 437.90 174.10 462.24 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+161.93 462.24 m
+
+168.55 462.24 174.10 456.84 174.10 450.07 c
+
+174.10 443.38 168.55 437.90 161.93 437.90 c
+
+155.23 437.90 149.76 443.38 149.76 450.07 c
+
+149.76 456.84 155.23 462.24 161.93 462.24 c
+
+@c
+
+S
+
+
+94.54 436.54 121.61 463.46 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.07 463.46 m
+
+115.49 463.46 121.61 457.42 121.61 450.00 c
+
+121.61 442.58 115.49 436.54 108.07 436.54 c
+
+100.66 436.54 94.54 442.58 94.54 450.00 c
+
+94.54 457.42 100.66 463.46 108.07 463.46 c
+
+@c
+
+S
+
+
+95.83 437.90 120.17 462.24 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.00 462.24 m
+
+114.62 462.24 120.17 456.84 120.17 450.07 c
+
+120.17 443.38 114.62 437.90 108.00 437.90 c
+
+101.30 437.90 95.83 443.38 95.83 450.07 c
+
+95.83 456.84 101.30 462.24 108.00 462.24 c
+
+@c
+
+S
+
+
+148.46 382.54 175.54 409.46 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+162.00 409.46 m
+
+169.42 409.46 175.54 403.42 175.54 396.00 c
+
+175.54 388.58 169.42 382.54 162.00 382.54 c
+
+154.58 382.54 148.46 388.58 148.46 396.00 c
+
+148.46 403.42 154.58 409.46 162.00 409.46 c
+
+@c
+
+S
+
+
+149.76 383.90 174.10 408.24 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+161.93 408.24 m
+
+168.55 408.24 174.10 402.84 174.10 396.07 c
+
+174.10 389.38 168.55 383.90 161.93 383.90 c
+
+155.23 383.90 149.76 389.38 149.76 396.07 c
+
+149.76 402.84 155.23 408.24 161.93 408.24 c
+
+@c
+
+S
+
+
+148.54 274.61 175.61 301.54 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+162.07 301.54 m
+
+169.49 301.54 175.61 295.49 175.61 288.07 c
+
+175.61 280.66 169.49 274.61 162.07 274.61 c
+
+154.66 274.61 148.54 280.66 148.54 288.07 c
+
+148.54 295.49 154.66 301.54 162.07 301.54 c
+
+@c
+
+S
+
+
+149.83 275.98 174.17 300.31 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+162.00 300.31 m
+
+168.62 300.31 174.17 294.91 174.17 288.14 c
+
+174.17 281.45 168.62 275.98 162.00 275.98 c
+
+155.30 275.98 149.83 281.45 149.83 288.14 c
+
+149.83 294.91 155.30 300.31 162.00 300.31 c
+
+@c
+
+S
+
+
+202.46 382.46 229.54 409.39 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+216.00 409.39 m
+
+223.42 409.39 229.54 403.34 229.54 395.93 c
+
+229.54 388.51 223.42 382.46 216.00 382.46 c
+
+208.58 382.46 202.46 388.51 202.46 395.93 c
+
+202.46 403.34 208.58 409.39 216.00 409.39 c
+
+@c
+
+S
+
+
+203.76 383.83 228.10 408.17 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+215.93 408.17 m
+
+222.55 408.17 228.10 402.77 228.10 396.00 c
+
+228.10 389.30 222.55 383.83 215.93 383.83 c
+
+209.23 383.83 203.76 389.30 203.76 396.00 c
+
+203.76 402.77 209.23 408.17 215.93 408.17 c
+
+@c
+
+S
+
+
+256.46 382.39 283.54 409.32 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+270.00 409.32 m
+
+277.42 409.32 283.54 403.27 283.54 395.86 c
+
+283.54 388.44 277.42 382.39 270.00 382.39 c
+
+262.58 382.39 256.46 388.44 256.46 395.86 c
+
+256.46 403.27 262.58 409.32 270.00 409.32 c
+
+@c
+
+S
+
+
+257.76 383.76 282.10 408.10 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+269.93 408.10 m
+
+276.55 408.10 282.10 402.70 282.10 395.93 c
+
+282.10 389.23 276.55 383.76 269.93 383.76 c
+
+263.23 383.76 257.76 389.23 257.76 395.93 c
+
+257.76 402.70 263.23 408.10 269.93 408.10 c
+
+@c
+
+S
+
+
+310.46 382.32 337.54 409.25 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+324.00 409.25 m
+
+331.42 409.25 337.54 403.20 337.54 395.78 c
+
+337.54 388.37 331.42 382.32 324.00 382.32 c
+
+316.58 382.32 310.46 388.37 310.46 395.78 c
+
+310.46 403.20 316.58 409.25 324.00 409.25 c
+
+@c
+
+S
+
+
+311.76 383.69 336.10 408.02 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+323.93 408.02 m
+
+330.55 408.02 336.10 402.62 336.10 395.86 c
+
+336.10 389.16 330.55 383.69 323.93 383.69 c
+
+317.23 383.69 311.76 389.16 311.76 395.86 c
+
+311.76 402.62 317.23 408.02 323.93 408.02 c
+
+@c
+
+S
+
+
+364.46 382.25 391.54 409.18 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+378.00 409.18 m
+
+385.42 409.18 391.54 403.13 391.54 395.71 c
+
+391.54 388.30 385.42 382.25 378.00 382.25 c
+
+370.58 382.25 364.46 388.30 364.46 395.71 c
+
+364.46 403.13 370.58 409.18 378.00 409.18 c
+
+@c
+
+S
+
+
+365.76 383.62 390.10 407.95 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+377.93 407.95 m
+
+384.55 407.95 390.10 402.55 390.10 395.78 c
+
+390.10 389.09 384.55 383.62 377.93 383.62 c
+
+371.23 383.62 365.76 389.09 365.76 395.78 c
+
+365.76 402.55 371.23 407.95 377.93 407.95 c
+
+@c
+
+S
+
+
+121.54 395.86 148.54 396.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+121.54 396.00 m
+
+147.17 396.00 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+144.00 398.52 m
+
+147.96 396.00 L
+
+144.00 393.48 L
+
+S
+
+@J
+
+
+175.54 395.86 202.54 396.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+175.54 396.00 m
+
+201.17 396.00 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+198.00 398.52 m
+
+201.96 396.00 L
+
+198.00 393.48 L
+
+S
+
+@J
+
+
+229.54 395.86 256.54 396.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+229.54 396.00 m
+
+255.17 396.00 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+252.00 398.52 m
+
+255.96 396.00 L
+
+252.00 393.48 L
+
+S
+
+@J
+
+
+283.54 395.86 310.54 396.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+283.54 396.00 m
+
+309.17 396.00 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+306.00 398.52 m
+
+309.96 396.00 L
+
+306.00 393.48 L
+
+S
+
+@J
+
+
+337.54 395.86 364.54 396.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+337.54 396.00 m
+
+363.17 396.00 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+360.00 398.52 m
+
+363.96 396.00 L
+
+360.00 393.48 L
+
+S
+
+@J
+
+
+125.57 268.56 143.86 284.98 @E
+
+
+[0.07198 0.00000 0.00000 0.07199 125 278] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (0) @t
+
+120 0 (-) @t
+
+180 0 (9) @t
+
+0 -125 (a) @t
+
+60 -125 (-) @t
+
+120 -125 (f) @t
+
+180 -125 (\135) @t
+
+T
+
+
+121.54 287.86 148.54 288.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+121.54 288.00 m
+
+147.17 288.00 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+144.00 290.52 m
+
+147.96 288.00 L
+
+144.00 285.48 L
+
+S
+
+@J
+
+
+121.54 341.86 148.54 342.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+121.54 342.00 m
+
+147.17 342.00 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+144.00 344.52 m
+
+147.96 342.00 L
+
+144.00 339.48 L
+
+S
+
+@J
+
+
+107.86 301.54 108.14 328.54 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.00 328.54 m
+
+108.00 302.90 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+110.52 306.14 m
+
+108.00 302.18 L
+
+105.48 306.14 L
+
+S
+
+@J
+
+
+107.86 355.54 108.14 382.54 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.00 382.54 m
+
+108.00 356.90 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+110.52 360.14 m
+
+108.00 356.18 L
+
+105.48 360.14 L
+
+S
+
+@J
+
+
+107.86 409.54 108.14 436.54 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+108.00 409.54 m
+
+108.00 435.17 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+105.41 432.00 m
+
+108.00 435.96 L
+
+110.59 432.00 L
+
+S
+
+@J
+
+
+117.00 405.00 153.00 441.00 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+117.00 405.00 m
+
+152.06 440.06 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+147.96 439.63 m
+
+152.64 440.64 L
+
+151.70 436.03 L
+
+S
+
+@J
+
+
+117.00 351.00 153.00 387.00 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+117.00 387.00 m
+
+152.06 351.94 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+151.63 356.04 m
+
+152.64 351.43 L
+
+148.03 352.44 L
+
+S
+
+@J
+
+
+166.39 341.93 196.63 377.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+173.38 346.82 m
+
+177.48 347.47 182.59 350.42 186.77 354.60 c
+
+193.75 361.58 196.63 370.22 193.18 373.68 c
+
+189.72 377.14 181.08 374.33 174.10 367.34 c
+
+169.92 363.17 166.90 358.06 166.39 353.95 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+169.34 356.90 m
+
+166.39 353.30 L
+
+164.30 357.62 L
+
+S
+
+@J
+
+
+166.39 450.72 196.63 485.93 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+173.38 455.62 m
+
+177.48 456.26 182.59 459.22 186.77 463.39 c
+
+193.75 470.38 196.63 479.02 193.18 482.47 c
+
+189.72 485.93 181.08 483.12 174.10 476.14 c
+
+169.92 471.96 166.90 466.85 166.39 462.74 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+169.34 465.70 m
+
+166.39 462.10 L
+
+164.30 466.42 L
+
+S
+
+@J
+
+
+166.39 287.93 196.63 323.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+173.38 292.82 m
+
+177.48 293.47 182.59 296.42 186.77 300.60 c
+
+193.75 307.58 196.63 316.22 193.18 319.68 c
+
+189.72 323.14 181.08 320.33 174.10 313.34 c
+
+169.92 309.17 166.90 304.06 166.39 299.95 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+169.34 302.90 m
+
+166.39 299.30 L
+
+164.30 303.62 L
+
+S
+
+@J
+
+
+166.61 396.00 198.00 450.00 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+182.30 396.00 m
+
+190.94 396.00 198.00 408.17 198.00 423.00 c
+
+198.00 437.83 190.94 450.00 182.30 450.00 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+185.54 447.41 m
+
+181.58 450.00 L
+
+185.54 452.59 L
+
+S
+
+@J
+
+
+220.61 396.00 252.00 450.00 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+236.30 396.00 m
+
+244.94 396.00 252.00 408.17 252.00 423.00 c
+
+252.00 437.83 244.94 450.00 236.30 450.00 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+239.54 447.41 m
+
+235.58 450.00 L
+
+239.54 452.59 L
+
+S
+
+@J
+
+
+274.61 396.00 306.00 450.00 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+290.30 396.00 m
+
+298.94 396.00 306.00 408.17 306.00 423.00 c
+
+306.00 437.83 298.94 450.00 290.30 450.00 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+293.54 447.41 m
+
+289.58 450.00 L
+
+293.54 452.59 L
+
+S
+
+@J
+
+
+328.61 396.00 360.00 450.00 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+344.30 396.00 m
+
+352.94 396.00 360.00 408.17 360.00 423.00 c
+
+360.00 437.83 352.94 450.00 344.30 450.00 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+347.54 447.41 m
+
+343.58 450.00 L
+
+347.54 452.59 L
+
+S
+
+@J
+
+
+382.54 396.00 413.93 450.00 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+398.23 396.00 m
+
+406.87 396.00 413.93 408.17 413.93 423.00 c
+
+413.93 437.83 406.87 450.00 398.23 450.00 C
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+401.47 447.41 m
+
+397.51 450.00 L
+
+401.47 452.59 L
+
+S
+
+@J
+
+
+391.54 395.86 398.23 396.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+391.54 396.00 m
+
+398.23 396.00 L
+
+S
+
+
+175.54 449.86 398.23 450.14 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+398.23 450.00 m
+
+175.54 450.00 L
+
+S
+
+
+139.46 385.27 144.43 391.03 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 139 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (p) @t
+
+T
+
+
+188.93 386.93 193.90 390.96 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 188 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (r) @t
+
+T
+
+
+242.93 386.93 247.61 392.76 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 242 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (i) @t
+
+T
+
+
+296.93 386.93 301.97 391.03 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 296 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (n) @t
+
+T
+
+
+350.93 386.86 355.82 392.18 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 350 386] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (t) @t
+
+T
+
+
+98.93 364.39 103.46 370.22 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 98 364] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (0) @t
+
+T
+
+
+98.93 310.46 103.97 314.42 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 98 310] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (x) @t
+
+T
+
+
+125.50 331.78 146.66 338.76 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 125 332] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (0) @t
+
+120 0 (-) @t
+
+180 0 (9) @t
+
+240 0 (\135) @t
+
+T
+
+
+134.50 367.78 155.66 374.76 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 134 368] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (1) @t
+
+120 0 (-) @t
+
+180 0 (9) @t
+
+240 0 (\135) @t
+
+T
+
+
+134.28 416.74 166.46 424.73 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 134 418] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (a) @t
+
+120 0 (-) @t
+
+180 0 (z) @t
+
+240 0 (\135) @t
+
+300 0 (\134) @t
+
+360 0 (p) @t
+
+T
+
+
+197.28 417.31 229.46 424.73 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 197 418] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (a) @t
+
+120 0 (-) @t
+
+180 0 (z) @t
+
+240 0 (\135) @t
+
+300 0 (\134) @t
+
+360 0 (r) @t
+
+T
+
+
+251.28 417.31 283.18 424.73 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 251 418] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (a) @t
+
+120 0 (-) @t
+
+180 0 (z) @t
+
+240 0 (\135) @t
+
+300 0 (\134) @t
+
+360 0 (i) @t
+
+T
+
+
+305.28 417.31 337.54 424.73 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 305 418] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (a) @t
+
+120 0 (-) @t
+
+180 0 (z) @t
+
+240 0 (\135) @t
+
+300 0 (\134) @t
+
+360 0 (n) @t
+
+T
+
+
+359.28 417.31 391.39 424.73 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 359 418] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (a) @t
+
+120 0 (-) @t
+
+180 0 (z) @t
+
+240 0 (\135) @t
+
+300 0 (\134) @t
+
+360 0 (t) @t
+
+T
+
+
+413.50 417.31 434.66 424.15 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 413 418] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (a) @t
+
+120 0 (-) @t
+
+180 0 (z) @t
+
+240 0 (\135) @t
+
+T
+
+
+193.03 475.78 214.20 482.62 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 193 476] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (a) @t
+
+120 0 (-) @t
+
+180 0 (z) @t
+
+240 0 (\135) @t
+
+T
+
+
+193.03 367.78 214.20 374.76 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 193 368] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (0) @t
+
+120 0 (-) @t
+
+180 0 (9) @t
+
+240 0 (\135) @t
+
+T
+
+
+192.74 313.78 227.45 320.76 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 193 314] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (0) @t
+
+120 0 (-) @t
+
+180 0 (9) @t
+
+240 0 (a) @t
+
+300 0 (-) @t
+
+360 0 (f) @t
+
+420 0 (\135) @t
+
+T
+
+
+52.70 412.56 107.21 429.41 @E
+
+
+[0.07199 0.00000 0.00000 0.07199 53 422] @tm
+
+ 0 O 0 @g
+
+0.00 0.00 0.00 1.00 k
+
+e
+
+/_Courier 125.00 z
+
+0 0 (\133) @t
+
+60 0 (\134) @t
+
+120 0 (0) @t
+
+180 0 (0) @t
+
+240 0 (0) @t
+
+300 0 (-) @t
+
+360 0 (\134) @t
+
+420 0 (3) @t
+
+480 0 (7) @t
+
+540 0 (7) @t
+
+600 0 (\135) @t
+
+660 0 (\134) @t
+
+0 -125 (\133) @t
+
+60 -125 (0) @t
+
+120 -125 (-) @t
+
+180 -125 (9) @t
+
+240 -125 (a) @t
+
+300 -125 (-) @t
+
+360 -125 (z) @t
+
+420 -125 (\135) @t
+
+T
+
+
+54.00 391.54 94.54 401.83 @E
+
+0 J 0 j [] 0 d 0 R 0 @G
+
+0.00 0.00 0.00 1.00 K
+
+0 0.22 0.22 0.00 @w
+
+
+54.00 396.65 m
+
+55.51 398.16 56.52 401.83 58.54 401.18 c
+
+62.50 399.89 63.29 392.18 67.54 392.18 c
+
+71.71 392.18 72.29 401.18 76.54 401.18 c
+
+80.71 401.18 81.50 393.55 85.54 392.18 c
+
+87.48 391.54 88.27 396.58 90.00 396.65 C
+
+93.17 396.65 L
+
+S
+
+@j
+
+0.00 0.00 0.00 1.00 K
+
+0.00 0.00 0.00 1.00 k
+
+0 @g
+
+0 @G
+
+[] 0 d 0 J 0 j
+
+0 R 0 O 0 1.01 1.01 0 @w
+
+90.00 399.17 m
+
+93.96 396.65 L
+
+90.00 394.13 L
+
+S
+
+@J
+
+@rs
+
+@rs
+
+
+ end
+
+%%EndDocument
+ @endspecial 108 1136 a Fr(Figure)21 b(3:)32 b(A)20 b(DF)-5
+b(A)21 b(for)f(the)i(sample)d(sp)q(eci\014cation)j(in)e(Figure)g(2.)39
+b(State)21 b(0)f(is)h(the)g(start)g(state.)108 1186 y(Accepting)d
+(states)g(are)g(lab)q(eled)e(with)h(the)g(n)o(um)o(b)q(er)f(of)g(the)i
+(rule)f(that)g(they)g(matc)o(h.)26 b(F)m(or)16 b(example,)108
+1236 y(state)i(10)d(accepts)j(rule)f(2.)25 b(T)m(ransitions)16
+b(di\013ering)g(only)g(b)o(y)g(lab)q(el)f(are)i(represen)o(ted)i(with)d
+(the)h(same)108 1286 y(arc.)i(F)m(or)12 b(example,)f(state)j(0)e(has)h
+(transitions)g(to)f(state)i(6)e(on)h(all)e(of)i(the)g(follo)o(wing)d(c)
+o(haracters:)19 b Fm(a)p Fr(,)13 b Fl(:)7 b(:)g(:)n Fr(,)108
+1336 y Fm(o)p Fr(,)14 b Fm(q)p Fr(,)f Fl(:)7 b(:)g(:)12
+b Fm(z)p Fr(.)21 1469 y(RE2C)i(is)g(di\013eren)o(t)h(from)e(most)g
+(other)i(scanner)h(generators)f(in)f(that)h(the)g(user)g(m)o(ust)f(pro)
+o(vide)g(the)h(input)f(bu\013ering)-42 1519 y(mec)o(hanism)i(for)h(the)
+i(scanner;)h(the)f(generated)g(co)q(de)g(simply)c(assumes)j(that)g(the)
+g(user)h(has)f(de\014ned)h(three)g(p)q(oin)o(ters:)-42
+1569 y Fm(YYCURSOR)p Fr(,)9 b Fm(YYLIMIT)g Fr(and)h Fm(YYMARKER)p
+Fr(,)e(and)i(a)h(routine)f Fm(YYFILL\()p Fl(n)p Fm(\))p
+Fr(.)15 b(Before)d(executing)f(the)g(generated)h(co)q(de,)f
+Fm(YYCURSOR)-42 1619 y Fr(and)h Fm(YYLIMIT)d Fr(m)o(ust)h(b)q(e)i(set)g
+(to)g(p)q(oin)o(t)e(to)h(the)h(\014rst)g(and)f(one)h(past)f(the)h(last)
+f(c)o(haracter)i(in)e(the)g(bu\013er,)i(resp)q(ectiv)o(ely)m(.)18
+b(After)-42 1669 y(a)f(tok)o(en)g(is)f(recognized,)i(and)f(b)q(efore)g
+(an)o(y)f(action)g(is)h(executed,)i Fm(YYCURSOR)c Fr(is)h(set)i(to)e(p)
+q(oin)o(t)g(to)h(just)g(past)g(the)g(tok)o(en.)-42 1718
+y Fm(YYFILL)d Fr(will)g(b)q(e)i(called)f(as)g(the)h(bu\013er)h(needs)f
+(\014lling;)e(at)h(least)h Fl(n)f Fr(additional)e(input)i(c)o
+(haracters)i(should)e(b)q(e)h(pro)o(vided.)-42 1768 y(When)g
+Fm(YYFILL)d Fr(is)i(called,)f Fm(YYCURSOR)f Fr(will)h(p)q(oin)o(t)g(to)
+h(the)g(next)h(c)o(haracter)g(to)f(b)q(e)g(scanned)h(and)f
+Fm(YYMARKER)p Fr(,)d(if)i(set,)i(will)-42 1818 y(p)q(oin)o(t)f(to)f(a)g
+(p)q(ossible)h(bac)o(ktrac)o(king)g(p)q(oin)o(t)f(in)g(the)h(bu\013er.)
+21 b Fm(YYFILL)14 b Fr(m)o(ust)f(up)q(date)j Fm(YYLIMIT)p
+Fr(,)c(and)j(p)q(ossibly)f Fm(YYCURSOR)-42 1868 y Fr(and)f
+Fm(YYMARKER)f Fr(b)q(efore)h(returning.)18 b(T)o(ypically)12
+b Fm(YYCURSOR)p Fr(,)f Fm(YYLIMIT)p Fr(,)g Fm(YYMARKER)p
+Fr(,)f(and)j Fm(YYFILL\()p Fl(n)p Fm(\))e Fr(will)h(b)q(e)h(de\014ned)h
+(as)-42 1918 y(macros.)-42 2034 y Fj(2.1)56 b(Things)19
+b(That)g(RE2C)f(Do)r(esn't)g(Pro)n(vide)-42 2111 y Fr(RE2C)11
+b(do)q(esn't)h(pro)o(vide)f(man)o(y)e(things)j(a)o(v)n(ailable)d(in)h
+(more)h(con)o(v)o(en)o(tional)f(scanner)j(generators)f(including)e
+(default)h(rules,)-42 2160 y(end-of-input)17 b(pseudo-tok)o(ens,)i(and)
+e(bu\013er)i(managemen)o(t)14 b(routines.)29 b(All)17
+b(of)f(these)j(m)o(ust)d(b)q(e)i(supplied)g(b)o(y)f(the)h(user.)-42
+2210 y(Rather)10 b(than)g(b)q(eing)f(a)g(handicap,)h(this)g(allo)o(ws)e
+(RE2C-generated)i(scanners)h(to)f(b)q(e)g(tailored)f(to)g(almost)f(an)o
+(y)h(en)o(vironmen)o(t.)-42 2260 y(F)m(or)k(example,)f(the)i(scanner)h
+(de\014ned)f(in)f(Figure)h(1)f(compiles)f(in)o(to)h(32)g(b)o(ytes)h(of)
+e(i486)h(co)q(de)h(\(using)f(W)m(atcom)e(C)j(9.5\);)e(the)-42
+2310 y(same)g(size)h(as)f(an)g(equiv)n(alen)o(t)g(hand-co)q(ded)h
+(routine.)k(Most)c(other)g(scanner)g(generators)h(cannot)e(pro)q(duce)h
+(scanners)h(that)-42 2360 y(are)k(comp)q(etitiv)o(e)e(with)g(hand-co)q
+(ded)i(analyzers)f(in)f(this)h(case.)28 b(F)m(urther,)18
+b(it)f(is)g(not)f(o)o(v)o(erly)h(di\016cult)f(to)h(implem)o(en)o(t)e(a)
+-42 2409 y(more)c(traditional)f(scanner)j(using)f(RE2C.)e(F)m(or)h
+(example,)g(App)q(endix)h(A)f(con)o(tains)h(the)g(supp)q(ort)h(co)q(de)
+f(for)f(the)i(C)e(scanner)-42 2459 y(b)q(enc)o(hmark)o(ed)j(in)f(T)m
+(able)g(1.)k(Note)d(that)g(this)f(co)q(de)h(allo)o(ws)f(for)g
+(arbitrarily)f(long)h(con)o(tiguous)g(tok)o(ens)h(and)f(pro)o(vides)h
+(line)-42 2509 y(and)g(column)e(n)o(um)o(b)q(er)i(information.)923
+2748 y(3)p eop
+%%Page: 4 4
+4 3 bop -42 195 a Fs(3)67 b(Generating)23 b(Directly)h(Executable)g
+(Scanners)-42 286 y Fr(As)14 b(demonstrated)g(b)o(y)f(GLA)g([7)o(])g
+(generating)h(directly)g(executable)g(co)q(de)g(instead)g(of)f(tables)h
+(can)f(result)i(in)e(m)o(uc)o(h)f(faster)-42 336 y(scanners.)20
+b(Ho)o(w)o(ev)o(er,)13 b(to)g(ac)o(hiev)o(e)h(this)f(sp)q(eed,)h
+(GLA-generated)h(scanners)f(mak)o(e)e(some)g(assumptions)h(ab)q(out)g
+(the)h(input)-42 386 y(and)i(place)g(certain)g(restrictions)g(on)g(tok)
+o(ens)680 371 y Fq(4)699 386 y Fr(.)23 b(In)15 b(this)h(section)g(w)o
+(e)g(will)e(sho)o(w)h(ho)o(w)g(to)h(generate)g(directly)g(executable)
+-42 435 y(scanners)22 b(whic)o(h)d(not)g(only)g(a)o(v)o(oid)f(suc)o(h)i
+(restrictions,)h(but)f(are)g(also)e(faster)i(and)f(usually)g(smaller.)
+33 b(The)19 b(approac)o(h)-42 485 y(presen)o(ted)f(here)f(has)f(the)g
+(added)g(b)q(ene\014t)h(that)f(ev)o(en)g(faster)h(scanners)g(can)f(b)q
+(e)g(easily)f(b)q(e)i(created,)g(at)e(the)i(exp)q(ense)g(of)-42
+535 y(increased)f(co)q(de)e(size,)h(b)o(y)e(using)h(a)f(tec)o(hnique)i
+(akin)e(to)h(lo)q(op)f(unrolling.)-42 651 y Fj(3.1)56
+b(Constructing)19 b(a)g(DF)-6 b(A)-42 728 y Fr(The)15
+b(\014rst)g(step)g(in)f(generating)h(a)f(directly)g(executable)h
+(scanner)h(is)e(to)g(construct)i(a)e(DF)-5 b(A)15 b(that)f(recognizes)i
+(the)e(regular)-42 778 y(expressions)g(in)e(the)h(sp)q(eci\014cation.)
+18 b(Figure)12 b(3)g(presen)o(ts)i(a)e(DF)-5 b(A)13 b(that)f
+(recognizes)h(the)g(regular)f(expressions)i(in)e(Figure)g(2.)-42
+828 y(One)18 b(p)q(ossible)f(algorithm)e(for)h(constructing)i(suc)o(h)g
+(a)e(DF)-5 b(A)18 b(can)f(b)q(e)g(found)g(in)f([1].)26
+b(Giv)o(en)16 b(suc)o(h)i(a)f(DF)-5 b(A,)16 b(the)i(task)f(of)p
+-42 864 780 2 v 5 891 a Fn(4)22 903 y Fo(These)11 b(assumptions)e(and)h
+(restrictions)f(are)i(discussed)e(in)j(more)e(detail)g(in)h(Sections)e
+(3.3.1)i(and)f(5.1.)923 2748 y Fr(4)p eop
+%%Page: 5 5
+5 4 bop -42 195 a Fr(scanning)14 b(the)h(input)f(can)g(b)q(e)g
+(expressed)i(as)e(follo)o(ws:)125 278 y(Starting)i(from)g(the)i(start)g
+(state,)g(mo)o(v)o(e)e(from)f(state)j(to)f(state)h(along)e(transitions)
+i(lab)q(eled)f(with)g(con-)62 328 y(secutiv)o(e)f(c)o(haracters)h(from)
+c(the)i(input.)21 b(When)15 b(no)f(further)i(transitions)f(can)g(b)q(e)
+g(made,)e(bac)o(ktrac)o(k)i(to)g(the)62 378 y(last)h(accepting)g
+(state,)h(sa)o(y)f Fl(q)q Fr(.)24 b(The)16 b(path)g(to)f
+Fl(q)i Fr(sp)q(ells)g(the)f(next)g(tok)o(en)g(and)g(the)g(rule)h(asso)q
+(ciated)f(with)g Fl(q)62 428 y Fr(determines)e(the)h(co)q(de)g(to)e(b)q
+(e)i(executed.)-42 511 y(As)d(a)e(result,)h(the)h(problem)d(of)h
+(generating)h(scanners)h(essen)o(tially)f(reduces)h(to)f(the)g(problem)
+e(of)h(generating)h(an)f(executable)-42 560 y(represen)o(tation)16
+b(for)d(a)h(DF)-5 b(A.)-42 677 y Fj(3.2)56 b(Generating)18
+b(Co)r(de)-42 753 y Fr(If)g(w)o(e)g(assume)g(that)g(the)h(input)f(is)g
+(en)o(tirely)g(con)o(tained)g(in)g(a)f(single)h(bu\013er)h(then)g
+(generating)f(co)q(de)h(for)f(the)g(DF)-5 b(A)19 b(is)-42
+803 y(relativ)o(ely)13 b(straigh)o(tforw)o(ard,)f(as)h(is)g
+(illustrated)g(b)o(y)f(the)i(co)q(de)g(templates)e(in)h(Figure)g(4.)35
+b(Note)14 b(that)f(the)g(only)g(di\013erence)p 575 863
+717 2 v 575 912 2 50 v 856 897 a Fi(Pr)n(olo)n(gue)p
+1290 912 V 575 914 717 2 v 575 964 2 50 v 720 949 a Fm(int)21
+b(yyaccept;)p 1290 964 V 575 1014 V 720 999 a(goto)g(M)p
+Fi(start)p Fm(;)p 1290 1014 V 575 1063 V 720 1049 a(fin:)g(YYCURSOR)f
+(=)i(YYMARKER;)p 1290 1063 V 575 1113 V 720 1098 a(switch\(yyaccept\))p
+Fk(f)p 1290 1113 V 575 1163 V 807 1148 a Fl(:)7 b(:)g(:)p
+1290 1163 V 575 1213 V 602 1198 a Fm(A)p Fl(n)p Fm(:)93
+b(case)21 b Fl(n)p Fm(:)43 b Fi(action)p Fr(\()p Fl(n)p
+Fr(\))p Fm(;)p 1290 1213 V 575 1263 V 807 1248 a Fl(:)7
+b(:)g(:)p 1290 1263 V 575 1313 V 720 1298 a Fk(g)p 1290
+1313 V 575 1362 V 720 1347 a Fi(c)n(o)n(de)15 b(for)g(states)p
+1290 1362 V 575 1364 717 2 v 204 1370 720 2 v 204 1420
+2 50 v 346 1405 a(Co)n(de)g(for)f(ac)n(c)n(epting)h(state)p
+921 1420 V 204 1421 720 2 v 204 1471 2 50 v 230 1456
+a Fm(L)p Fl(q)q Fm(:)50 b(++YYCURSOR;)p 921 1471 V 204
+1521 V 344 1506 a(yyaccept)20 b(=)h Fi(rule)p Fr(\()p
+Fl(q)q Fr(\))p Fm(;)p 921 1521 V 204 1571 V 344 1556
+a(YYMARKER)f(=)h(YYCURSOR;)p 921 1571 V 204 1621 V 230
+1606 a(M)p Fl(q)q Fm(:)50 b(switch\(*YYCURSO)o(R\))p
+Fk(f)p 921 1621 V 204 1670 V 431 1655 a Fl(:)7 b(:)g(:)p
+921 1670 V 204 1720 V 387 1705 a Fm(case)21 b Fl(c)p
+Fm(:)43 b(goto)21 b(L)p Fi(goto)q Fr(\()p Fl(q)q(;)7
+b(c)p Fr(\))p Fm(;)p 921 1720 V 204 1770 V 431 1755 a
+Fl(:)g(:)g(:)p 921 1770 V 204 1820 V 387 1805 a Fm(default:)42
+b(goto)21 b(fin;)p 921 1820 V 204 1870 V 344 1855 a Fk(g)p
+921 1870 V 204 1871 720 2 v 944 1370 V 944 1420 2 50
+v 1045 1405 a Fi(Co)n(de)15 b(for)g(non-ac)n(c)n(epting)h(state)p
+1662 1420 V 944 1421 720 2 v 944 1471 2 50 v 971 1456
+a Fm(L)p Fl(q)q Fm(:)49 b(++YYCURSOR;)p 1662 1471 V 944
+1521 V 1662 1521 V 944 1571 V 1662 1571 V 944 1621 V
+971 1606 a(M)p Fl(q)q Fm(:)g(switch\(*YYCURSOR\))p Fk(f)p
+1662 1621 V 944 1670 V 1172 1655 a Fl(:)7 b(:)g(:)p 1662
+1670 V 944 1720 V 1128 1705 a Fm(case)21 b Fl(c)p Fm(:)43
+b(goto)21 b(L)p Fi(goto)p Fr(\()p Fl(q)q(;)7 b(c)p Fr(\))p
+Fm(;)p 1662 1720 V 944 1770 V 1172 1755 a Fl(:)g(:)g(:)p
+1662 1770 V 944 1820 V 1128 1805 a Fm(default:)42 b(goto)21
+b(fin;)p 1662 1820 V 944 1870 V 1084 1855 a Fk(g)p 1662
+1870 V 944 1871 720 2 v 108 1946 a Fr(Figure)g(4:)30
+b(Directly)20 b(executable)h(scanner.)38 b(The)20 b(co)q(de)h
+(generated)g(for)f(a)g(scanner)h(consists)g(of)f(a)108
+1996 y(prologue)12 b(follo)o(w)o(ed)f(b)o(y)h(co)q(de)i(for)e(eac)o(h)h
+(state.)18 b Fi(start)11 b Fr(is)i(the)g(start)g(state.)18
+b Fi(action)p Fr(\()p Fl(n)p Fr(\))13 b(denotes)h(the)f(co)q(de)108
+2045 y(asso)q(ciated)h(with)e(rule)h Fl(n)p Fr(,)f Fi(goto)p
+Fr(\()p Fl(q)q(;)7 b(c)p Fr(\))12 b(denotes)i(the)f(state)g(reac)o(hed)
+h(from)d(state)i Fl(q)h Fr(along)d(the)i(transition)108
+2095 y(lab)q(eled)18 b(with)e Fl(c)h Fr(and)g Fi(rule)p
+Fr(\()p Fl(q)q Fr(\))g(denotes)i(the)e(rule)h(asso)q(ciated)g(with)e
+(state)i Fl(q)q Fr(.)28 b Fm(yyaccept)16 b Fr(is)h(used)h(to)108
+2145 y(sa)o(v)o(e)d(bac)o(ktrac)o(king)e(information.)i(The)g
+Fm(M)p Fr(-lab)q(els)e(will)f(b)q(e)j(used)g(in)e(section)i(3.4.2.)-42
+2245 y(b)q(et)o(w)o(een)j(the)f(templates)f(for)g(accepting)g(and)h
+(non-accepting)f(states)i(is)e(that)g(the)h(accepting)g(states)g(ha)o
+(v)o(e)f(additional)-42 2294 y(co)q(de)e(to)f(sa)o(v)o(e)g(bac)o(ktrac)
+o(king)f(information.)j(Figure)e(5)g(sho)o(ws)g(co)q(de)h(that)f(migh)o
+(t)d(b)q(e)k(generated)g(for)f(state)g(1)g(in)f(Figure)h(3.)-42
+2460 y Fj(3.3)56 b(Bu\013ering)-42 2537 y Fr(Complications)13
+b(arise)i(when)g(the)g(input)g(is)g(not)f(con)o(tained)h(in)g(a)f
+(single)g(bu\013er:)21 b(additional)13 b(co)q(de)j(is)e(needed)j(for)d
+(\014lling)-42 2587 y(the)h(bu\013er)g(as)f(necessary)m(.)923
+2748 y(5)p eop
+%%Page: 6 6
+6 5 bop 647 188 a Fm(L1:)49 b(++YYCURSOR;)762 238 y(yyaccept)20
+b(=)i(4;)762 288 y(YYMARKER)e(=)i(YYCURSOR;)647 338 y(M1:)49
+b(switch\(*YYCURSOR\))p Fk(f)806 388 y Fm(case)21 b('a':)43
+b(goto)21 b(L6;)849 438 y Fl(:)7 b(:)g(:)806 487 y Fm(case)21
+b('q':)43 b(goto)21 b(L6;)806 537 y(case)g('r':)43 b(goto)21
+b(L2;)806 587 y(case)g('s':)43 b(goto)21 b(L6;)849 637
+y Fl(:)7 b(:)g(:)806 687 y Fm(case)21 b('z':)43 b(goto)21
+b(L6;)806 736 y(default:)42 b(goto)21 b(fin;)762 786
+y Fk(g)690 876 y Fr(Figure)14 b(5:)k(Co)q(de)c(for)g(state)g(1.)505
+968 y Fm(L6:)50 b(++YYCURSOR;)621 1018 y(if\(YYLIMIT)19
+b(==)j(YYCURSOR\))e(YYFILL\(1\);)621 1068 y(yyaccept)g(=)h(4;)621
+1118 y(YYMARKER)f(=)h(YYCURSOR;)505 1168 y(M6:)50 b(switch\(*YYCURSO)o
+(R\))p Fk(f)708 1217 y Fl(:)7 b(:)g(:)621 1267 y Fk(g)690
+1357 y Fr(Figure)14 b(6:)k(Co)q(de)c(for)g(state)g(6.)-42
+1489 y Fh(3.3.1)48 b(The)16 b(Sen)o(tinel)c(Metho)q(d)-42
+1566 y Fr(Most)20 b(scanner)g(generators)g(use)g(the)g(sen)o(tinel)f
+(metho)q(d)g([1)o(])f(to)h(determine)g(when)h(the)f(bu\013er)i(needs)f
+(\014lling.)32 b(In)19 b(the)-42 1616 y(simplest)d(case,)h(a)f(sym)o(b)
+q(ol)f(that)h(do)q(es)i(not)e(app)q(ear)h(in)f(v)n(alid)f(input)h(is)g
+(c)o(hosen)h(as)g(the)g(sen)o(tinel)g(c)o(haracter.)26
+b(An)17 b(extra)-42 1666 y(state)12 b(is)f(added)g(to)g(the)h(DF)-5
+b(A)11 b(and)g(transitions)f(to)h(this)g(state)h(on)f(the)g(sen)o
+(tinel)h(sym)o(b)q(ol)d(are)i(added)g(to)g(the)h(original)d(states.)-42
+1715 y(When)16 b(the)g(DF)-5 b(A)16 b(arriv)o(es)f(in)g(this)h(new)f
+(state)i(it)e(is)g(time)f(to)h(re\014ll)g(the)h(bu\013er.)23
+b(After)16 b(the)g(bu\013er)h(is)e(re\014lled,)g(scanning)-42
+1765 y(m)o(ust)h(b)q(e)g(restarted)i(in)e(the)h(previous)f(state.)26
+b(Unfortunately)m(,)16 b(this)g(is)g(not)g(p)q(ossible)g(with)g(the)h
+(approac)o(h)f(outlined)g(in)-42 1815 y(Figure)j(4:)26
+b(the)19 b(necessary)h(information)15 b(is)j(simply)e(not)i(a)o(v)n
+(ailable.)28 b(Co)q(de)19 b(could)f(b)q(e)g(added)h(to)f(eac)o(h)g
+(state)h(to)f(sa)o(v)o(e)-42 1865 y(the)e(necessary)g(information)c
+(but)j(this)g(w)o(ould)e(result)j(in)e(slo)o(w)o(er)h(and)f(larger)h
+(scanners.)22 b(GLA)14 b(solv)o(es)h(this)f(problem)g(b)o(y)-42
+1915 y(ensuring)i(that)g(the)f(sen)o(tinel)h(only)f(gets)g(inserted)i
+(b)q(et)o(w)o(een)g(tok)o(ens:)k(if)14 b(this)i(is)f(the)h(case,)g(the)
+g(scanner)g(can)g(alw)o(a)o(ys)e(b)q(e)-42 1964 y(restarted)k(from)c
+(the)j(start)f(state.)25 b(T)m(o)15 b(ensure)i(that)f(the)h(sen)o
+(tinel)f(only)f(gets)i(inserted)g(b)q(et)o(w)o(een)g(tok)o(ens,)f(GLA)g
+(allo)o(ws)-42 2014 y(newline)g(\(ASCI)q(I)g(LF\))g(c)o(haracters)h(to)
+f(app)q(ear)g(only)f(at)g(the)h(end)g(of)f(a)h(tok)o(en)g(and)f
+(disallo)o(ws)f(the)i(bu\013ering)g(of)f(partial)-42
+2064 y(lines)39 2049 y Fq(5)58 2064 y Fr(.)-42 2172 y
+Fh(3.3.2)48 b(Bu\013ering)-42 2249 y Fr(RE2C-generated)17
+b(scanners)h(c)o(hec)o(k)f(if)e(the)i(bu\013er)g(needs)g(\014lling)e
+(simply)f(b)o(y)i(comparing)e Fm(YYCURSOR)g Fr(and)i
+Fm(YYLIMIT)p Fr(.)e(A)-42 2298 y(metho)q(d)d(inspired)g(b)o(y)g(the)h
+(mec)o(hanism)d(used)j(to)f(guard)g(against)g(stac)o(k)g(o)o(v)o
+(er\015o)o(w)g(in)g([17)o(])1365 2283 y Fq(6)1394 2298
+y Fr(is)g(used)i(to)e(reduce)h(the)g(amoun)o(t)-42 2348
+y(of)i(c)o(hec)o(king.)21 2398 y(Chec)o(ks)j(are)g(only)f(inserted)h
+(in)f(certain)h(k)o(ey)f(states.)27 b(These)18 b(c)o(hec)o(ks)g(simply)
+c(ensure)k(that)e(there)i(is)e(enough)h(input)-42 2448
+y(in)g(the)g(bu\013er)h(for)f(the)h(scan)f(to)g(pro)q(ceed)h(un)o(til)e
+(the)i(next)f(k)o(ey)g(state.)28 b(F)m(or)17 b(example,)f(in)g(the)i
+(DF)-5 b(A)17 b(of)f(Figure)h(3)g(it)g(is)-42 2498 y(su\016cien)o(t)e
+(to)e(c)o(hec)o(k)i(that)f(there)h(are)g(at)e(least)h(6)g(c)o
+(haracters)h(in)f(the)g(bu\013er)h(when)f(it)g(starts,)g(and)g(that)g
+(there)h(is)f(at)f(least)-42 2547 y(one)i(c)o(haracter)g(in)e(the)i
+(bu\013er)g(when)f(the)h(DF)-5 b(A)14 b(is)g(in)f(states)j(6,)d(8,)g
+(or)h(10.)k(No)13 b(other)i(c)o(hec)o(ks)g(are)g(required.)k(The)14
+b(c)o(hec)o(ks)-42 2597 y(inserted)i(in)d(k)o(ey)h(states)h(are)f(of)g
+(the)g(form)923 2748 y(6)p eop
+%%Page: 7 7
+7 6 bop 62 195 a Fm(if\(\(YYLIMIT)20 b(-)h(YYCURSOR\))f(<)i
+Fl(n)p Fm(\))f(YYFILL\()p Fl(n)p Fm(\);)-42 278 y Fr(where)c
+Fl(n)f Fr(is)f(the)i(maxim)n(um)11 b(n)o(um)o(b)q(er)k(of)g(c)o
+(haracters)i(that)f(can)g(b)q(e)g(consumed)g(b)q(efore)g(another)g(k)o
+(ey)g(state)g(is)g(reac)o(hed.)-42 328 y(F)m(or)e(example,)e(Figure)i
+(6)g(sho)o(ws)g(the)g(co)q(de)h(generated)g(for)f(state)h(6)e(in)h
+(Figure)g(3.)21 378 y(A)h(set)g(of)f(k)o(ey)h(states)h(can)f(b)q(e)g
+(determined)g(b)o(y)f(disco)o(v)o(ering)h(the)g(strongly-connected)h
+(comp)q(onen)o(ts)e(\(SCCs\))i(of)e(the)-42 428 y(DF)-5
+b(A.)12 b(An)h(SCC)f(is)f(a)h(maxima)o(l)d(subset)k(of)f(states)h(suc)o
+(h)g(that)f(there)h(exists)g(a)f(path)g(from)e(an)o(y)i(state)g(in)g
+(the)h(subset)g(to)f(an)o(y)-42 477 y(other.)24 b(The)16
+b(set)g(of)f(k)o(ey)h(states)g(consists)h(of)e(all)f(of)h(the)h(states)
+h(in)e(non-trivial)f(SCCs,)h(together)i(with)e(the)h(start)g(state.)-42
+527 y(Note)d(that)f(for)g(eac)o(h)g(SCC)g Fl(S)r Fr(,)h(w)o(e)f
+(actually)g(only)f(ha)o(v)o(e)h(to)g(include)g(a)f(subset)j(of)d
+(states)j(of)d Fl(S)k Fr(suc)o(h)e(that)f(when)g(the)h(subset)-42
+577 y(is)f(remo)o(v)o(ed,)f Fl(S)k Fr(b)q(ecomes)d(acyclic.)17
+b(Indeed,)c([17)o(])e(describ)q(es)j(a)e(simple)e(heuristic)j(for)e(c)o
+(ho)q(osing)h(suc)o(h)g(a)g(subset.)18 b(Ho)o(w)o(ev)o(er,)-42
+627 y(since)c(in)f(practice)h(most)d(of)i(the)g(\(non-trivial\))f(SCCs)
+h(encoun)o(tered)i(will)c(consist)j(of)e(a)h(single)g(state)g(the)h
+(curren)o(t)g(v)o(ersion)-42 677 y(of)f(RE2C)g(simply)e(includes)j(all)
+d(states)k(in)e(non-trivial)e(SCCs)943 662 y Fq(7)962
+677 y Fr(.)18 b(An)13 b(algorithm)e(giv)o(en)h(in)h([3)o(])g(w)o(as)g
+(used)h(to)f(compute)g(the)-42 726 y(SCCs.)-42 843 y
+Fj(3.4)56 b(Optimizations)-42 919 y Fr(Ev)o(en)17 b(go)q(o)q(d)f
+(optimizing)e(C)i(compilers)f(can)i(b)q(e)g(coaxed)f(in)o(to)g
+(generating)g(m)o(uc)o(h)f(smaller)g(and)h(sligh)o(tly)f(faster)i(co)q
+(de)g(if)-42 969 y(some)c(transformations)g(are)h(\014rst)h(applied)e
+(to)h(the)g(generated)i(co)q(de.)-42 1077 y Fh(3.4.1)48
+b(Eliminatin)o(g)13 b(Bac)o(ktrac)o(king)-42 1154 y Fr(Consider)19
+b(state)g(1)f(in)g(the)h(DF)-5 b(A)18 b(in)g(Figure)g(3.)31
+b(Note)19 b(that)f(since)h(all)e(of)h(the)h(transitions)f(from)e(state)
+j(1)f(reac)o(h)h(only)-42 1203 y(accepting)f(states,)h(bac)o(ktrac)o
+(king)f(information)c(do)q(es)k(not)f(need)i(to)e(b)q(e)h(sa)o(v)o(ed)g
+(if)e(the)i(co)q(de)g(for)f(the)h Fm(default)e Fr(case)j(is)-42
+1253 y(c)o(hanged)h(to)e(go)g(directly)h(to)g(the)g(co)q(de)h(asso)q
+(ciated)f(with)f(state)i(1.)32 b(The)19 b(result)h(of)e(this)h
+(optimization)d(is)i(sho)o(wn)h(in)-42 1303 y(Figure)d(7.)48
+b(More)17 b(generally)m(,)e(this)h(optimization)d(can)j(b)q(e)g
+(applied)f(to)h(all)f(accepting)h(states)h(whic)o(h)f(ha)o(v)o(e)g
+(transitions)647 1396 y Fm(L1:)49 b(++YYCURSOR;)647 1446
+y(M1:)g(switch\(*YYCURSOR\))p Fk(f)806 1495 y Fm(case)21
+b('a':)43 b(goto)21 b(L6;)849 1545 y Fl(:)7 b(:)g(:)806
+1595 y Fm(case)21 b('q':)43 b(goto)21 b(L6;)806 1645
+y(case)g('r':)43 b(goto)21 b(L2;)806 1695 y(case)g('s':)43
+b(goto)21 b(L6;)849 1744 y Fl(:)7 b(:)g(:)806 1794 y
+Fm(case)21 b('z':)43 b(goto)21 b(L6;)806 1844 y(default:)42
+b(goto)21 b(A4;)762 1894 y Fk(g)419 1983 y Fr(Figure)14
+b(7:)k(Co)q(de)c(for)g(state)g(1)g(with)g(bac)o(ktrac)o(king)f
+(eliminated.)-42 2083 y(only)h(to)f(accepting)i(states.)-42
+2191 y Fh(3.4.2)48 b(Optimizing)12 b Fm(switch)p Fh(es)-42
+2268 y Fr(Most)21 b(C)g(compilers)f(will)f(generate)j(either)f(a)g
+(jump)e(table)h(or)h(a)g(set)g(of)f Fm(if)g Fr(statemen)o(ts)h(for)g(a)
+f Fm(switch)g Fr(statemen)o(t)-42 2317 y(dep)q(ending)e(on)e(the)i
+(distribution)e(of)g(the)i Fm(case)e Fr(lab)q(els.)26
+b(In)17 b(man)o(y)e(compilers)h(the)h(decision)g(as)g(to)g(whic)o(h)g
+(metho)q(d)f(to)-42 2367 y(use)j(is)f(biased)f(to)o(w)o(ards)h
+(generating)g(jump)e(tables)i(since)g(in)g(most)e(cases)j(this)f
+(results)h(in)e(faster)h(alb)q(eit)f(larger)h(co)q(de.)-42
+2417 y(Ho)o(w)o(ev)o(er,)c(exp)q(erience)h(with)e(directly)h
+(executable)h(scanners)g(has)e(sho)o(wn,)g(that)g(replacing)h(man)o(y)d
+(of)i(these)h(jump)e(tables)p -42 2452 780 2 v 5 2478
+a Fn(5)22 2490 y Fo(If)f(the)g(input)f(con)o(tains)g(no)h(newlines,)f
+(a)h(GLA)h(scanner)e(will)h(attempt)f(to)h(bu\013er)f(the)g(en)o(tire)g
+(input)h(stream.)5 2518 y Fn(6)22 2530 y Fo(The)h(problem)d(of)i
+(detecting)e(stac)o(k)h(o)o(v)o(er\015o)o(w)g(in)i(LR)f(parsers)f(is)i
+(probably)d(b)q(est)i(left)f(to)h(hardw)o(are)f(mec)o(hanisms)f([12)o
+(].)5 2558 y Fn(7)22 2569 y Fo(It)i(should)f(b)q(e)h(noted)f(that)g
+(\014nding)f(the)i(minimal)e(set)i(of)g(states)f(to)h(remo)o(v)o(e)f
+(from)g(an)h(SCC)h(in)f(order)f(to)h(render)f(it)h(acyclic)e(is)j
+(equiv)n(alen)o(t)-42 2609 y(to)g(the)e(FEEDBA)o(CK)j(VER)m(TEX)h(SET)d
+(problem)f(whic)o(h)h(is)g(NP-complete)e([6].)923 2748
+y Fr(7)p eop
+%%Page: 8 8
+8 7 bop -42 195 a Fr(with)12 b Fm(if)g Fr(statemen)o(ts)g(results)h(in)
+f(scanners)i(whic)o(h)d(are)i(m)o(uc)o(h)e(smaller,)f(and)i
+(surprisingly)m(,)f(in)h(some)f(cases)i(sligh)o(tly)e(faster)-42
+245 y(as)h(w)o(ell)78 230 y Fq(8)96 245 y Fr(.)17 b(As)c(a)e(result,)h
+(the)h(capabilit)o(y)d(of)h(replacing)g(a)h Fm(switch)e
+Fr(statemen)o(t)i(with)f Fm(if)g Fr(statemen)o(ts)h(w)o(as)g(added)g
+(to)f(RE2C.)21 295 y(RE2C)j(bases)j(its)e(decision)g(on)g(whether)i(to)
+e(generate)i(a)d Fm(switch)g Fr(statemen)o(t)i(or)f(to)g(replace)h(it)f
+(with)g Fm(if)p Fr(s)g(solely)g(on)-42 345 y(the)j(densit)o(y)162
+329 y Fq(9)198 345 y Fr(of)f(the)g Fm(switch)f Fr(statemen)o(t.)27
+b(It)18 b(is)e(surprising)i(that)f(suc)o(h)h(a)e(simple)g(heuristic)i
+(w)o(orks)f(w)o(ell.)27 b(F)m(or)16 b(more)-42 394 y(esoteric)h
+(applications)e(in)g(whic)o(h)h(the)g(input)f(alphab)q(et)h(is)f(not)h
+(a)f(simple)f(in)o(terv)n(al)h(RE2C)g(has)g(the)i(adv)n(an)o(tage)d(in)
+h(that)-42 444 y(there)f(is)e(no)g(pro)o(vision)f(for)h(don't)f(care)i
+(en)o(tries)g(in)f(a)g Fm(switch)f Fr(statemen)o(t:)17
+b(if)11 b(no)h Fm(case)f Fr(matc)o(hes)h(none)g(of)f(the)i(statemen)o
+(ts)-42 494 y(in)i(the)g Fm(switch)e Fr(m)o(ust)g(b)q(e)i(executed.)22
+b(Ho)o(w)o(ev)o(er,)15 b(for)f(the)h(examples)f(in)g(T)m(able)f(1)h
+(this)h(is)f(not)h(so:)k(RE2C)14 b(simply)f(do)q(es)i(a)-42
+544 y(b)q(etter)j(job)d(of)g(generating)g(co)q(de)i(for)e
+Fm(switch)f Fr(statemen)o(ts)i(than)g(the)g(compiler.)21
+b([18)o(],)15 b([11)o(],)g(and)h([2)o(])f(also)g(address)i(the)-42
+594 y(problem)c(of)g(generating)h(go)q(o)q(d)g(co)q(de)h(for)e
+Fm(switch)g Fr(statemen)o(ts.)-42 702 y Fh(Replacing)18
+b Fm(switch)p Fh(es)g(with)g Fm(if)p Fh(s)41 b Fr(When)17
+b(replacing)g(a)f Fm(switch)g Fr(statemen)o(t)h(with)g
+Fm(if)f Fr(statemen)o(ts,)i(it)f(is)f(useful)i(to)-42
+751 y(sort)g(the)f Fm(case)p Fr(s)f(b)o(y)h(lab)q(el)f(and)g(then)h
+(group)g(them)f(according)h(to)f(rule)h(in)o(to)f(subranges,)i(as)f
+(illustrated)f(in)g(Figure)h(8.)-42 801 y(RE2C)c(replaces)h(a)f
+Fm(switch)f Fr(with)g(either)i(a)f(linear)f(or)h(binary)g(searc)o(h,)h
+(dep)q(ending)f(on)g(the)h(n)o(um)o(b)q(er)e(of)g(subranges)i(in)f(the)
+467 894 y Fm(switch\(*YYCURSOR\))p Fk(f)511 944 y Fm(case)21
+b('\\)o(000':)49 b Fl(:)7 b(:)g(:)20 b Fm(case)h('/':)115
+b(goto)21 b(L11;)576 994 y(case)g('0':)431 b(goto)21
+b(L7;)576 1043 y(case)g('1':)49 b Fl(:)7 b(:)g(:)20 b
+Fm(case)h('9':)115 b(goto)21 b(L8;)576 1093 y(case)g(':':)49
+b Fl(:)7 b(:)g(:)20 b Fm(case)h('`':)115 b(goto)21 b(L11;)576
+1143 y(case)g('a':)49 b Fl(:)7 b(:)g(:)20 b Fm(case)h('o':)115
+b(goto)21 b(L6;)576 1193 y(case)g('p':)431 b(goto)21
+b(L1;)576 1243 y(case)g('r':)49 b Fl(:)7 b(:)g(:)20 b
+Fm(case)h('z':)115 b(goto)21 b(L6;)577 1292 y(case)g(')p
+Fk(f)p Fm(':)49 b Fl(:)7 b(:)g(:)20 b Fm(case)h('\\377':)49
+b(goto)21 b(L11;)467 1342 y Fk(g)672 1432 y Fr(Figure)14
+b(8:)j Fm(switch)c Fr(for)g(state)i(0.)-42 1531 y Fm(switch)p
+Fr(.)i(If)d(there)h(are)f(only)f(a)h(few)g(subranges)h(a)e(linear)h
+(searc)o(h)h(is)f(generated;)g(otherwise,)h(a)e(binary)h(searc)o(h)h
+(is)f(used.)21 1581 y(Figure)f(9)f(and)g(Figure)h(10)f(sho)o(w)h
+(linear)f(and)h(binary)f(searc)o(hes,)i(resp)q(ectiv)o(ely)m(,)g(that)f
+(could)f(b)q(e)h(used)h(to)e(replace)52 b(the)607 1674
+y Fm(if\(*YYCURSOR)19 b(<=)i('/'\))g(goto)g(L11;)607
+1724 y(if\(*YYCURSOR)e(<=)i('0'\))g(goto)g(L7;)607 1773
+y(if\(*YYCURSOR)e(<=)i('9'\))g(goto)g(L8;)607 1823 y(if\(*YYCURSOR)e
+(<=)i('`'\))g(goto)g(L11;)607 1873 y(if\(*YYCURSOR)e(==)i('p'\))g(goto)
+g(L1;)607 1923 y(if\(*YYCURSOR)e(<=)i('z'\))g(goto)g(L6;)607
+1973 y(goto)g(L11;)477 2062 y Fr(Figure)14 b(9:)k(Linear)c(lo)q(okup)f
+(co)q(de)h(sequence)i(for)e(state)h(0.)p -42 2147 780
+2 v 5 2173 a Fn(8)22 2185 y Fo(See)c(T)m(able)g(1)g(for)g(examples.)5
+2213 y Fn(9)22 2225 y Fo(The)h(n)o(um)o(b)q(er)d(of)i(distinct)f
+(subranges)f(divided)g(b)o(y)i(the)g(total)f(n)o(um)o(b)q(er)g(of)h
+Fg(case)p Fo(s.)923 2748 y Fr(8)p eop
+%%Page: 9 9
+9 8 bop 563 188 a Fm(if\(*YYCURSOR)19 b(<=)j('`'\))p
+Fk(f)650 238 y Fm(if\(*YYCURSOR)d(<=)j('/'\))f(goto)g(L11;)650
+288 y(if\(*YYCURSOR)e(<=)j('0'\))f(goto)g(L7;)650 338
+y(if\(*YYCURSOR)e(<=)j('9'\))f(goto)g(L8;)650 388 y(goto)g(L11;)563
+438 y Fk(g)h Fm(else)f Fk(f)650 487 y Fm(if\(*YYCURSOR)e(==)j('p'\))f
+(goto)g(L1;)650 537 y(if\(*YYCURSOR)e(<=)j('z'\))f(goto)g(L6;)650
+587 y(goto)g(L11;)563 637 y Fk(g)463 726 y Fr(Figure)14
+b(10:)k(Binary)13 b(lo)q(okup)h(co)q(de)g(sequence)i(for)e(state)g(0.)
+-42 826 y Fm(switch)e Fr(in)g(Figure)h(8.)k(Note)d(in)e(particular)g
+(the)i(comparison)d(for)i(the)g(\\)p Fm(p)p Fr(")f(in)g(Figure)h(9.)k
+(This)c(optimization)d(eliminates)-42 876 y(a)k(comparison)f(eac)o(h)i
+(time)d(it)i(is)g(applied.)k(Also)c(note)h(that)f(no)g(comparisons)f
+(are)i(required)g(at)f(the)g(top)g(and)g(b)q(ottom)f(of)-42
+925 y(the)i(range.)-42 1033 y Fh(Simplifyi)o(ng)j Fm(switch)p
+Fh(es)40 b Fr(As)19 b(a)f(general)g(rule,)i(b)q(etter)g(replacemen)o(t)
+e(co)q(de)h(can)g(b)q(e)g(generated)h(for)e(a)g Fm(switch)f
+Fr(if)h(it)-42 1083 y(con)o(tains)g(few)o(er)g(subranges.)31
+b(One)18 b(w)o(a)o(y)f(of)g(reducing)h(the)g(n)o(um)o(b)q(er)f(of)g
+(subranges)i(in)e(a)g Fm(switch)p Fr(,)g(at)g(the)i(exp)q(ense)g(of)-42
+1133 y(some)c(sp)q(eed,)j(is)d(to)h(lo)q(cate)g(a)f Fi(b)n(ase)h
+Fm(switch)f Fr(whic)o(h)g(is)h(v)o(ery)g(similar)d(and)j(then)g
+(replace)h(the)f(co)q(de)h(for)e(all)f(cases)k(whic)o(h)-42
+1183 y(app)q(ear)d(iden)o(tically)d(in)i(the)g(base)h
+Fm(switch)d Fr(with)i(a)f Fm(goto)g Fr(to)h(\(the)h(co)q(de)f
+(generated)i(for\))d(the)i(base)f Fm(switch)p Fr(.)j(RE2C)c(uses)-42
+1233 y(this)18 b(optimization)d(to)i(go)q(o)q(d)g(adv)n(an)o(tage)g
+(when)h(generating)g(co)q(de)g(in)f(the)h(transitions)g(of)f(states)i
+(used)f(for)f(matc)o(hing)-42 1282 y(k)o(eyw)o(ords.)i(F)m(or)12
+b(example,)f(note)j(that)f(the)g Fm(switch)p Fr(es)f(for)h(states)h(1)f
+(through)g(4)f(di\013er)h(from)f(the)h Fm(switch)f Fr(of)g(state)i(6)e
+(only)-42 1332 y(on)i(\\)p Fm(r)p Fr(",)f(\\)p Fm(i)p
+Fr(",)g(\\)p Fm(n)p Fr(",)f(and)i(\\)p Fm(t)p Fr(",)f(resp)q(ectiv)o
+(ely)m(.)19 b(Figure)14 b(11)f(sho)o(ws)h(the)h(co)q(de)g(generated)g
+(for)e(these)j(states.)37 b(Another)15 b(w)o(a)o(y)560
+1425 y Fm(L1:)49 b(++YYCURSOR;)560 1475 y(M1:)g(if\(*YYCURSOR)19
+b(!=)j('r'\))f(goto)g(M6;)560 1525 y(L2:)49 b(++YYCURSOR;)560
+1574 y(M2:)g(if\(*YYCURSOR)19 b(!=)j('i'\))f(goto)g(M6;)560
+1624 y(L3:)49 b(++YYCURSOR;)560 1674 y(M3:)g(if\(*YYCURSOR)19
+b(!=)j('n'\))f(goto)g(M6;)560 1724 y(L4:)49 b(++YYCURSOR;)560
+1774 y(M4:)g(if\(*YYCURSOR)19 b(!=)j('t'\))f(goto)g(M6;)675
+1824 y(goto)g(L5;)444 1913 y Fr(Figure)14 b(11:)j(Co)q(de)d(for)g
+(states)h(1{4)e(after)h(all)f(optimizations.)-42 2013
+y(of)h(implemen)o(ting)d(this)j(optimization)e(is)i(to)g(construct)i(a)
+e(tunnel)g(automaton)f([9)o(])h(from)e(the)j(DF)-5 b(A,)14
+b(and)g(then)h(generate)-42 2062 y(co)q(de)g(from)d(the)j(tunnel)f
+(automaton.)-42 2170 y Fh(Common)i(Sub)q(expression)d(Eliminatio)o(n)38
+b Fr(Man)o(y)14 b(compilers)g(will)f(miss)g(the)i(fact)f(that)h
+Fm(*YYCURSOR)d Fr(in)i(Figures)h(9)-42 2220 y(and)e(10)f(should)h(b)q
+(e)g(loaded)f(in)o(to)g(a)h(register.)19 b(Most)13 b(can)f(b)q(e)i
+(coaxed)f(to)f(do)h(so)g(b)o(y)f(\014rst)i(assigning)e
+Fm(*YYCURSOR)e Fr(to)j(a)f(lo)q(cal)-42 2270 y(v)n(ariable.)-42
+2407 y Fs(4)67 b(Exp)r(erimen)n(tal)25 b(Results)-42
+2498 y Fr(T)m(able)16 b(1)h(compares)f(t)o(w)o(o)g(RE2C-generated)h(C)g
+(scanners)h(with)e(the)i(\(hand-co)q(ded\))f(lcc)g(scanner)h([5)o(])e
+(and)h(comparable)-42 2548 y(GLA-)f(and)g(\015ex-generated)i(scanners)f
+(on)f(a)g(v)n(ariet)o(y)g(of)f(platforms.)48 b(It)16
+b(rep)q(orts)i(the)e(times)f(in)h(seconds)i(required)f(b)o(y)-42
+2598 y(the)e(v)n(arious)e(scanners)i(to)e(scan)h(ab)q(out)g(170,000)e
+(lines)h(of)g(C)h(source.)19 b(The)14 b(5,607,820)d(b)o(yte)j(source)g
+(\014le)g(used)h(essen)o(tially)923 2748 y(9)p eop
+%%Page: 10 10
+10 9 bop 707 452 a Fr(time)438 b(space)328 502 y(program)p
+516 517 2 50 v 82 w(user)83 b(sys)76 b(total)p 975 517
+V 82 w(text)j(data)d(bss)f(total)p 292 519 1284 2 v 860
+554 a Fi(R4000)16 b(/)f(gc)n(c2.3.3)h(-O)p 292 570 V
+317 605 a Fr(\015ex)e(-Cem)p 516 620 2 50 v 71 w(10.36)p
+683 620 V 50 w(0.87)p 808 620 V 71 w(11.23)p 975 620
+V 71 w(5200)p 1130 620 V 71 w(4192)p 1285 620 V 92 w(48)p
+1420 620 V 72 w(9440)357 655 y(\015ex)h(-Cf)p 516 670
+V 92 w(5.44)p 683 670 V 50 w(0.72)p 808 670 V 92 w(6.16)p
+975 670 V 71 w(4688)p 1130 670 V 51 w(64384)p 1285 670
+V 91 w(48)p 1420 670 V 51 w(69120)443 705 y(lcc)p 516
+720 V 93 w(3.19)p 683 720 V 50 w(0.67)p 808 720 V 92
+w(3.86)p 975 720 V 71 w(7328)p 1130 720 V 71 w(1216)p
+1285 720 V 51 w(8256)p 1420 720 V 50 w(16800)438 754
+y(gla)p 516 769 V 92 w(2.89)p 683 769 V 50 w(0.63)p 808
+769 V 92 w(3.52)p 975 769 V 50 w(11552)p 1130 769 V 71
+w(3056)p 1285 769 V 72 w(144)p 1420 769 V 50 w(14752)417
+804 y(re2c)p 516 819 V 94 w(2.54)p 683 819 V 50 w(0.68)p
+808 819 V 92 w(3.22)p 975 819 V 50 w(13264)p 1130 819
+V 92 w(512)p 1285 819 V 113 w(0)p 1420 819 V 51 w(13776)373
+854 y(re2c)g(-s)p 516 869 V 93 w(2.38)p 683 869 V 50
+w(0.67)p 808 869 V 92 w(3.05)p 975 869 V 50 w(11056)p
+1130 869 V 71 w(4528)p 1285 869 V 113 w(0)p 1420 869
+V 51 w(15584)p 292 871 1284 2 v 737 906 a Fi(R4000)h(/)f(c)n(c2.11.2)g
+(-O)g(-Olimit)e(5000)p 292 922 V 317 957 a Fr(\015ex)h(-Cem)p
+516 972 2 50 v 92 w(9.97)p 683 972 V 50 w(0.89)p 808
+972 V 71 w(10.86)p 975 972 V 71 w(4704)p 1130 972 V 71
+w(4240)p 1285 972 V 92 w(32)p 1420 972 V 72 w(8976)357
+1007 y(\015ex)h(-Cf)p 516 1022 V 92 w(6.19)p 683 1022
+V 50 w(0.72)p 808 1022 V 92 w(6.91)p 975 1022 V 71 w(4256)p
+1130 1022 V 51 w(64432)p 1285 1022 V 91 w(32)p 1420 1022
+V 51 w(68720)443 1057 y(lcc)p 516 1072 V 93 w(2.74)p
+683 1072 V 50 w(0.72)p 808 1072 V 92 w(3.46)p 975 1072
+V 71 w(9664)p 1130 1072 V 92 w(864)p 1285 1072 V 51 w(8256)p
+1420 1072 V 50 w(18784)438 1106 y(gla)p 516 1121 V 92
+w(2.46)p 683 1121 V 50 w(0.69)p 808 1121 V 92 w(3.15)p
+975 1121 V 50 w(19232)p 1130 1121 V 71 w(2992)p 1285
+1121 V 72 w(128)p 1420 1121 V 50 w(22352)417 1156 y(re2c)p
+516 1171 V 94 w(2.97)p 683 1171 V 50 w(0.63)p 808 1171
+V 92 w(3.60)p 975 1171 V 50 w(15088)p 1130 1171 V 92
+w(528)p 1285 1171 V 113 w(0)p 1420 1171 V 51 w(15616)373
+1206 y(re2c)g(-s)p 516 1221 V 93 w(2.94)p 683 1221 V
+50 w(0.61)p 808 1221 V 92 w(3.55)p 975 1221 V 50 w(16080)p
+1130 1221 V 51 w(11808)p 1285 1221 V 112 w(0)p 1420 1221
+V 51 w(27888)p 292 1223 1284 2 v 849 1258 a Fi(SP)m(AR)o(C)g(/)g(gc)n
+(c2.3.3)g(-O)p 292 1274 V 317 1309 a Fr(\015ex)f(-Cem)p
+516 1324 2 50 v 71 w(16.03)p 683 1324 V 50 w(2.78)p 808
+1324 V 71 w(18.81)p 975 1324 V 71 w(8992)p 1130 1324
+V 113 w(24)p 1285 1324 V 92 w(48)p 1420 1324 V 72 w(9064)357
+1359 y(\015ex)h(-Cf)p 516 1374 V 92 w(7.84)p 683 1374
+V 50 w(2.69)p 808 1374 V 71 w(10.53)p 975 1374 V 71 w(6560)p
+1130 1374 V 51 w(62232)p 1285 1374 V 91 w(48)p 1420 1374
+V 51 w(68840)443 1409 y(lcc)p 516 1424 V 93 w(4.46)p
+683 1424 V 50 w(2.01)p 808 1424 V 92 w(6.47)p 975 1424
+V 71 w(7800)p 1130 1424 V 92 w(384)p 1285 1424 V 51 w(8256)p
+1420 1424 V 50 w(16440)438 1459 y(gla)p 516 1473 V 92
+w(4.08)p 683 1473 V 50 w(1.56)p 808 1473 V 92 w(5.64)p
+975 1473 V 50 w(10864)p 1130 1473 V 71 w(2168)p 1285
+1473 V 72 w(136)p 1420 1473 V 50 w(13168)417 1508 y(re2c)p
+516 1523 V 94 w(3.67)p 683 1523 V 50 w(1.76)p 808 1523
+V 92 w(5.43)p 975 1523 V 50 w(13552)p 1130 1523 V 134
+w(0)p 1285 1523 V 113 w(0)p 1420 1523 V 51 w(13552)373
+1558 y(re2c)g(-s)p 516 1573 V 93 w(3.48)p 683 1573 V
+50 w(1.70)p 808 1573 V 92 w(5.18)p 975 1573 V 50 w(15464)p
+1130 1573 V 134 w(0)p 1285 1573 V 113 w(0)p 1420 1573
+V 51 w(15464)p 292 1575 1284 2 v 880 1610 a Fi(i486)g(/)g(gc)n(c2.4.5)g
+(-O)p 292 1626 V 317 1661 a Fr(\015ex)f(-Cem)p 516 1676
+2 50 v 71 w(21.86)p 683 1676 V 50 w(1.26)p 808 1676 V
+71 w(23.12)p 975 1676 V 71 w(8536)p 1130 1676 V 113 w(20)p
+1285 1676 V 92 w(24)p 1420 1676 V 72 w(8580)357 1711
+y(\015ex)h(-Cf)p 516 1726 V 92 w(9.12)p 683 1726 V 50
+w(1.18)p 808 1726 V 71 w(10.30)p 975 1726 V 71 w(6200)p
+1130 1726 V 51 w(62228)p 1285 1726 V 91 w(24)p 1420 1726
+V 51 w(68452)443 1761 y(lcc)p 516 1776 V 93 w(5.45)p
+683 1776 V 50 w(1.22)p 808 1776 V 92 w(6.67)p 975 1776
+V 71 w(5924)p 1130 1776 V 92 w(384)p 1285 1776 V 51 w(8240)p
+1420 1776 V 50 w(14548)438 1811 y(gla)p 516 1825 V 92
+w(5.11)p 683 1825 V 50 w(1.18)p 808 1825 V 92 w(6.29)p
+975 1825 V 50 w(15496)p 1130 1825 V 71 w(2144)p 1285
+1825 V 72 w(108)p 1420 1825 V 50 w(17748)417 1860 y(re2c)p
+516 1875 V 94 w(4.73)p 683 1875 V 50 w(1.13)p 808 1875
+V 92 w(5.86)p 975 1875 V 71 w(9800)p 1130 1875 V 134
+w(0)p 1285 1875 V 113 w(0)p 1420 1875 V 72 w(9800)373
+1910 y(re2c)g(-s)p 516 1925 V 93 w(4.85)p 683 1925 V
+50 w(1.17)p 808 1925 V 92 w(6.02)p 975 1925 V 50 w(12968)p
+1130 1925 V 134 w(0)p 1285 1925 V 113 w(0)p 1420 1925
+V 51 w(12968)p 292 1927 1284 2 v 871 1962 a Fi(68020)h(/)f(gc)n(c1.40)h
+(-O)p 292 1978 V 317 2013 a Fr(\015ex)e(-Cem)p 516 2028
+2 50 v 50 w(117.37)p 683 2028 V 50 w(5.89)p 808 2028
+V 51 w(123.26)p 975 2028 V 70 w(7700)p 1130 2028 V 113
+w(20)p 1285 2028 V 92 w(22)p 1420 2028 V 72 w(7742)357
+2063 y(\015ex)h(-Cf)p 516 2078 V 71 w(50.93)p 683 2078
+V 50 w(5.27)p 808 2078 V 71 w(56.20)p 975 2078 V 71 w(5388)p
+1130 2078 V 51 w(62228)p 1285 2078 V 91 w(22)p 1420 2078
+V 51 w(67638)443 2113 y(lcc)p 516 2128 V 72 w(33.28)p
+683 2128 V 50 w(6.28)p 808 2128 V 71 w(39.56)p 975 2128
+V 71 w(4956)p 1130 2128 V 92 w(384)p 1285 2128 V 51 w(8236)p
+1420 2128 V 50 w(13576)438 2163 y(gla)p 516 2177 V 71
+w(33.80)p 683 2177 V 50 w(4.20)p 808 2177 V 71 w(38.00)p
+975 2177 V 50 w(13904)p 1130 2177 V 71 w(2144)p 1285
+2177 V 72 w(106)p 1420 2177 V 50 w(16154)417 2212 y(re2c)p
+516 2227 V 73 w(28.92)p 683 2227 V 50 w(2.91)p 808 2227
+V 71 w(31.83)p 975 2227 V 71 w(8556)p 1130 2227 V 134
+w(0)p 1285 2227 V 113 w(0)p 1420 2227 V 72 w(8556)373
+2262 y(re2c)g(-s)p 516 2277 V 72 w(30.72)p 683 2277 V
+50 w(3.19)p 808 2277 V 71 w(33.91)p 975 2277 V 71 w(9856)p
+1130 2277 V 134 w(0)p 1285 2277 V 113 w(0)p 1420 2277
+V 72 w(9856)513 2352 y(T)m(able)e(1:)18 b(Comparison)12
+b(of)h(generated)j(C)d(scanners.)913 2748 y(10)p eop
+%%Page: 11 11
+11 10 bop -42 195 a Fr(consists)15 b(of)d(10)h(copies)h(of)e(the)i
+(source)h(to)e(James)f(Clark's)h(SGML)f(parser,)i(sgmls)1263
+180 y Fq(10)1297 195 y Fr(.)k(The)c(times)e(rep)q(orted)i(are)g(a)o(v)o
+(erages)-42 245 y(for)j(10)g(trials;)h(the)g(sizes)g(rep)q(orted)h
+(include)e(ev)o(erything)h(but)g(C)f(library)f(co)q(de)1251
+230 y Fq(11)1287 245 y Fr(.)28 b(\015ex)18 b(pro)o(vides)f(a)g(n)o(um)o
+(b)q(er)g(of)g(table)-42 295 y(compression)e(options)g(including)f
+Fm(-Cem)g Fr(for)h(tables)g(optimized)f(for)h(space,)h(and)f
+Fm(-Cf)f Fr(for)h(tables)g(optimized)f(for)g(sp)q(eed.)-42
+345 y(By)f(default,)e(RE2C)h(will)f(use)h(a)g(heuristic)h(to)f(decide)h
+(if)e(a)h Fm(switch)f Fr(should)h(b)q(e)g(replaced)h(with)f
+Fm(if)p Fr(s:)17 b(the)c Fm(-s)e Fr(option)h(forces)-42
+394 y(RE2C)i(to)g(alw)o(a)o(ys)e(generate)k Fm(switch)p
+Fr(es.)21 444 y(T)m(o)21 b(mak)o(e)g(comparisons)g(more)g(meaningful,)h
+(all)e(seman)o(tic)i(pro)q(cessing)h(co)q(de)g(w)o(as)f(remo)o(v)o(ed)g
+(from)e(the)j(GLA-)-42 494 y(generated)d(and)f(lcc)f(scanners,)j(and)d
+(co)q(de)i(to)e(pro)o(vide)g(line)g(and)g(column)f(n)o(um)o(b)q(er)h
+(information)d(w)o(as)k(added)g(to)f(the)-42 544 y(RE2C)c(sp)q
+(eci\014cation.)19 b(The)14 b(remaining)e(di\013erences)k(of)d(note)h
+(b)q(et)o(w)o(een)i(the)e(scanners)i(include:)21 627
+y Fk(\017)k Fr(The)15 b(\015ex-generated)g(scanners)h(do)d(not)h(pro)o
+(vide)g(line)f(or)h(column)e(n)o(um)o(b)q(er)i(information.)21
+710 y Fk(\017)20 b Fr(The)15 b(GLA-generated)f(scanner)i(assumes)d
+(7-bit)h(input.)21 793 y(As)e(a)g(general)g(rule,)h(the)f
+(RE2C-generated)h(scanners)h(w)o(ere)f(the)f(fastest,)h(follo)o(w)o(ed)
+e(b)o(y)h(the)g(GLA-generated)h(scanner)-42 843 y(and)j(then)g(the)g
+(lcc)g(scanner.)24 b(The)15 b(\015ex-generated)i(scanners)h(w)o(ere)e
+(signi\014can)o(tly)e(slo)o(w)o(er.)23 b(Only)15 b(the)h
+(space-optimized)-42 892 y(\015ex)i(scanner)h(w)o(as)e(smaller)f(than)h
+(the)h(default)f(RE2C)g(scanner,)i(and)e(only)g(b)o(y)g(a)g(narro)o(w)g
+(margin.)26 b(There)19 b(are)e(some)-42 942 y(arc)o(hitectures,)j
+(notably)d(the)g(IBM)h(370,)f(on)g(whic)o(h)g(table)g(driv)o(en)g
+(scanners)i(will)d(probably)h(pro)q(duce)h(b)q(etter)h(results:)-42
+992 y(IBM)c(370)e(compilers)g(t)o(ypically)f(generate)j(p)q(o)q(or)f
+(co)q(de)h(for)f(large)f(routines.)21 1042 y(The)22 b(v)n(arious)f
+(scanners)j(and)d(input)h(\014les)g(used)h(for)e(the)i(tests)g(are)f(a)
+o(v)n(ailable)e(for)h(anon)o(ymous)f(ftp)i(from)e Ff(csg.-)-42
+1092 y(u)o(w)o(aterlo)q(o.ca)10 b Fr(in)f Ff(/pub/p)q
+(eter/re2c/sampler.ta)o(r.Z)p Fr(.)i(\015ex)f(is)f(a)o(v)n(ailable)e
+(for)i(anon)o(ymous)e(ftp)i(from)f Ff(ftp.uu.net)i Fr(as)f
+Ff(/pack)o(ages/-)-42 1142 y(gnu/\015ex-2.3.7.ta)o(r.Z)p
+Fr(,)14 b(GLA)h(is)g(a)o(v)n(ailable)e(for)i(anon)o(ymous)f(ftp)h(from)
+f Ff(ftp.cs.colo)o(rado.edu)i Fr(as)f(part)g(of)g(the)h(Eli)f(pac)o(k)n
+(age)-42 1191 y Ff(/pub/cs/distribs/eli/Eli3.4.2.ta)o(r.Z)p
+Fr(,)i(and)h(the)g(lcc)h(fron)o(t)e(end)i(is)f(a)o(v)n(ailable)e(for)h
+(anon)o(ymous)g(ftp)g(from)g Ff(p)o(rinceton.edu)-42
+1241 y Fr(as)f Ff(/pub/lcc/lccfe-1.9.ta)o(r.Z)p Fr(.)g(An)f(alpha)g(v)o
+(ersion)g(of)g(RE2C)g(will)f(so)q(on)i(b)q(e)g(made)e(a)o(v)n(ailable)f
+(for)i(anon)o(ymous)f(ftp)h(from)-42 1291 y Ff(csg.u)o(w)o(aterlo)q
+(o.ca)g Fr(as)f Ff(/pub/p)q(eter/re2c/re2c-0.5.ta)o(r.Z)p
+Fr(.)-42 1428 y Fs(5)67 b(Related)23 b(W)-6 b(ork)-42
+1519 y Fr(The)18 b(k)o(ey)g(to)f(the)h(p)q(erformance)f(and)g
+(\015exibilit)o(y)e(of)i(an)g(RE2C-generated)h(scanner)h(is)e(the)h
+(approac)o(h)f(used)h(to)f(deter-)-42 1569 y(mine)e(when)i(the)g
+(bu\013er)g(needs)g(\014lling.)23 b(In)o(terestingly)m(,)16
+b(the)h(lcc)g(scanner)g([5)o(])f(uses)h(a)f(similar)e(approac)o(h)i
+(\(with)g(certain)-42 1619 y(concessions)g(to)e(k)o(eep)g(the)h(b)q(o)q
+(okk)o(eeping)e(manageable.\))-42 1735 y Fj(5.1)56 b(Comparison)18
+b(With)g(GLA)-42 1812 y Fr(It)h(is)f(natural)f(to)h(compare)f(RE2C)h
+(to)g(GLA)f([7])g(as)h(it)g(also)f(generates)j(directly)f(executable)g
+(scanners.)32 b(RE2C)18 b(and)-42 1861 y(GLA)d(ha)o(v)o(e)g(man)o(y)e
+(di\013erences)k(simply)c(b)q(ecause)j(they)g(are)f(targeted)h(for)e
+(di\013eren)o(t)i(t)o(yp)q(es)g(of)e(users:)22 b(GLA)14
+b(is)h(in)o(tended)-42 1911 y(for)g(p)q(eople)h(who)f(simply)e(wish)i
+(to)f(lev)o(erage)i(their)f(e\013orts)i(with)d(existing)h(to)q(ols)g
+(and)g(libraries;)g(RE2C)f(is)h(in)o(tended)h(for)-42
+1961 y(p)q(eople)d(that)g(ha)o(v)o(e)f(more)g(sp)q(ecialized)h(needs)h
+(and)e(are)h(willing)d(to)j(pro)o(vide)f(their)h(o)o(wn)f(supp)q(ort)h
+(routines.)18 b(F)m(or)12 b(example,)-42 2011 y(GLA)h(pro)o(vides)h(a)f
+(go)q(o)q(d)f(bu\013ering)i(mec)o(hanism,)c(RE2C)j(users)i(m)o(ust)d
+(supply)h(their)h(o)o(wn.)j(These)d(di\013erences,)i(ho)o(w)o(ev)o(er,)
+-42 2061 y(are)f(not)f(unique)f(to)h(GLA)g(and)f(ha)o(v)o(e)h(b)q(een)h
+(addressed)h(for)d(the)i(most)e(part)h(in)f(previous)h(sections.)21
+2111 y(Of)j(more)f(in)o(terest)i(is)f(the)h(di\013erences)i(in)c(the)i
+(co)q(de)g(that)f(RE2C)g(and)g(GLA)g(generate.)29 b(Scanners)18
+b(generated)h(b)o(y)-42 2160 y(RE2C)14 b(and)g(GLA)f(di\013er)h
+(primarily)e(in)h(t)o(w)o(o)h(asp)q(ects:)19 b(ho)o(w)14
+b(they)g(determine)g(when)h(the)f(bu\013er)h(needs)g(\014lling,)d(and)i
+(ho)o(w)-42 2210 y(they)h(generate)g(co)q(de)g(for)e
+Fm(switch)p Fr(es.)21 2260 y(GLA)d(uses)i(the)f(ASCI)q(I)g(NUL)f(c)o
+(haracter)i(as)f(the)g(sen)o(tinel)g(to)f(determine)h(when)g(the)g
+(bu\013er)g(needs)h(\014lling.)j(T)m(o)10 b(impro)o(v)o(e)-42
+2310 y(the)j(sp)q(eed)h(and)e(reduce)i(the)f(size)g(of)e(the)i
+(generated)g(scanners)h(GLA)e(bu\013ers)i(only)d(complete)h(lines)g
+(and)g(restricts)i(tok)o(ens)-42 2360 y(to)d(those)g(that)f(do)g(not)g
+(con)o(tain)g(newline)g(\(ASCI)q(I)h(LF\))f(c)o(haracters)1013
+2345 y Fq(12)1050 2360 y Fr(.)17 b(If)10 b(a)g(tok)o(en)g(with)g(an)g
+(em)o(b)q(edded)h(newline)f(c)o(haracter)-42 2409 y(\(suc)o(h)k(as)f(a)
+f(commen)o(t\))f(is)h(required)i(it)e(m)o(ust)f(b)q(e)j(recognized)g
+(with)e(an)g(auxiliary)f(scanner)j(written)f(in)f(C.)g(This)h(co)q(de)g
+(has)-42 2459 y(to)h(p)q(erform)f(the)i(bu\013ering-related)f(b)q(o)q
+(okk)o(eeping)g(that)g(is)g(done)g(automatically)d(b)o(y)i
+(GLA-generated)i(co)q(de.)p -42 2494 780 2 v -11 2521
+a Fn(10)22 2532 y Fo(Av)n(ailable)10 b(for)h(anon)o(ymous)d(ftp)j(from)
+f Fe(ftp.uu.net)i Fo(as)f Fe(/pub/text-p)o(ro)q(cessing/sg)o(ml/sgmls-)
+o(1.1.)o(ta)o(r.Z)o Fo(.)-11 2560 y Fn(11)22 2572 y Fo(The)h
+(GLA-generated)c(scanner)i(sizes)h(also)f(do)h(not)g(include)f(the)g
+(size)h(of)g(an)g(error)g(rep)q(orting)e(mo)q(dule)g
+Fg(err.o)p Fo(.)-11 2600 y Fn(12)22 2612 y Fo(This)j(is)f(discussed)f
+(in)h(more)f(detail)g(in)h(Section)f(3.3.1.)913 2748
+y Fr(11)p eop
+%%Page: 12 12
+12 11 bop 21 195 a Fr(The)20 b(mec)o(hanism)e(RE2C)h(uses)i(to)f
+(re\014ll)g(the)g(bu\013er)h(eliminates)d(these)k(restrictions)f(and)e
+(y)o(et)i(allo)o(ws)d(RE2C)i(to)-42 245 y(generate)15
+b(faster)f(and)g(smaller)e(scanners.)19 b(RE2C)13 b(also)g(allo)o(ws)g
+(b)q(oth)g(auxiliary)f(and)h(primary)f(scanners)j(to)f(b)q(e)g(sp)q
+(eci\014ed)-42 295 y(using)g(regular)g(expressions.)20
+b(F)m(or)13 b(example,)f(App)q(endix)i(A)g(con)o(tains)g(an)g
+(auxiliary)e(scanner)j(for)f(commen)o(ts.)21 345 y(Lik)o(e)i(RE2C,)g
+(GLA)h(usually)f(replaces)i Fm(switch)p Fr(es)e(with)h
+Fm(if)p Fr(s.)27 b(Unlik)o(e)16 b(RE2C,)g(GLA)g(do)q(es)i(not)f(use)g
+(a)g Fm(case)p Fr(-based)-42 394 y(heuristic)f(to)f(decide)h(whic)o(h)f
+Fm(switch)p Fr(es)g(to)g(replace:)21 b(rather,)16 b(it)f(alw)o(a)o(ys)f
+(generates)j(a)e Fm(switch)e Fr(for)i(the)h(start)g(state)g(and)-42
+444 y(uses)g Fm(if)p Fr(s)d(for)h(the)g(rest.)20 b(GLA)13
+b(replaces)i Fm(switch)p Fr(es)f(with)f(co)q(de)i(sequences)h(of)e(the)
+g(form:)138 518 y Fm(if\(*YYCURSOR)20 b Fi(in)i Fl(S)505
+524 y Fq(1)524 518 y Fm(\))f(goto)g(L)698 524 y Fq(1)717
+518 y Fm(;)226 562 y(.)226 579 y(.)226 595 y(.)138 645
+y(if\(*YYCURSOR)f Fi(in)i Fl(S)505 651 y Fd(n)528 645
+y Fm(\))f(goto)g(L)702 651 y Fd(n)725 645 y Fm(;)-42
+737 y Fr(Bit)12 b(v)o(ectors)h(are)f(used)h(for)e(all)f(mem)o(b)q
+(ership)g(tests)k(in)o(v)o(olving)9 b(sets)k(with)e(more)g(than)g(one)h
+(elemen)o(t.)17 b(As)12 b(an)g(optimization,)-42 787
+y(if)k(a)f(state)i(has)f(a)g(transition)g(to)g(itself)f(the)i(test)g
+(as)f(to)g(whether)h(to)f(remain)f(in)g(the)i(same)e(state)i(or)f(not)g
+(is)g(p)q(erformed)-42 837 y(\014rst.)25 b(F)m(or)16
+b(example,)e(Figure)i(12)f(sho)o(ws)i(the)f(GLA-generated)h(co)q(de)f
+(for)g(state)g(8)g(in)f(Figure)h(2)1506 822 y Fq(13)1541
+837 y Fr(.)73 b(Note)16 b(the)g(use)h(of)291 926 y Fm(static)j
+(unsigned)g(char)h(yytable[])f(=)i Fk(f)291 976 y Fm(0x00,)e(0x00,)h
+(0x00,)g(0x00,)g(/*)65 b(0.)g(1.)g(2.)f(3.)22 b(*/)291
+1025 y Fl(:)7 b(:)g(:)291 1075 y Fm(0x00,)20 b(0x00,)h(0x00,)g(0x00,)g
+(/*)43 b(,)g(-)h(.)f(/)22 b(*/)291 1125 y(0x01,)e(0x01,)h(0x01,)g
+(0x01,)g(/*)43 b(0)g(1)h(2)f(3)22 b(*/)291 1175 y(0x01,)e(0x01,)h
+(0x01,)g(0x01,)g(/*)43 b(4)g(5)h(6)f(7)22 b(*/)291 1225
+y(0x01,)e(0x01,)h(0x00,)g(0x00,)g(/*)43 b(8)g(9)h(:)f(;)22
+b(*/)291 1275 y(0x00,)e(0x00,)h(0x00,)g(0x00,)g(/*)43
+b(<)g(=)h(>)f(?)22 b(*/)291 1324 y Fl(:)7 b(:)g(:)291
+1374 y Fm(0x00,)20 b(0x00,)h(0x00,)g(0x00)g Fk(g)p Fm(;)g(/*)43
+b(|)h Fk(g)108 b Fm(127.)21 b(*/)378 1419 y(.)378 1435
+y(.)378 1452 y(.)291 1502 y(L8:)g(if\(yytable[\(*YYC)o(URSOR)o(++\)+0)o
+(])e(&)j(1<<0\))e(goto)h(L8;--YYCURSOR;)291 1552 y(goto)g(A3;)527
+1631 y Fr(Figure)14 b(12:)j(GLA)d(co)q(de)h(for)e(state)i(8)e(in)h
+(Figure)g(2.)-42 1731 y(128)i(elemen)o(t)f(en)o(tries)i(for)e(the)i
+(bit)f(v)o(ectors)h(to)e(reduce)j(the)e(scanner)i(size:)k(A)16
+b(GLA-generated)h(scanner)g(will)e(crash)h(or)-42 1781
+y(otherwise)f(b)q(eha)o(v)o(e)g(unpredictably)f(if)f(a)h(non-ASCI)q(I)f
+(c)o(haracter)j(app)q(ears)e(in)g(the)g(source)1395 1766
+y Fq(14)1432 1781 y Fr(.)21 1831 y(In)k(some)g(sense)j(the)e(results)h
+(of)e(Section)h(4)f(are)i(a)e(bit)g(misleading:)26 b(the)19
+b(GLA)f(sp)q(eci\014cation)i(that)e(w)o(as)h(used)h(to)-42
+1880 y(obtain)15 b(the)g(\014gures)h(in)e(T)m(able)g(1)h(is)g(not)f(a)h
+(t)o(ypical)f(GLA)g(sp)q(eci\014cation.)22 b(Usually)14
+b(scanners)j(implem)o(en)o(ted)c(using)i(GLA)-42 1930
+y(will)h(handle)i(k)o(eyw)o(ords)f(as)h(iden)o(ti\014ers)g(as)g(GLA)f
+(has)g(b)q(een)i(optimized)d(for)h(this)g([7)o(].)29
+b(T)m(able)16 b(2)h(presen)o(ts)j(a)d(more)f(fair)-42
+1980 y(comparison:)h(the)e(k)o(eyw)o(ord)f(matc)o(hing)e(rules)j(w)o
+(ere)g(remo)o(v)o(ed)e(from)f(b)q(oth)j(the)f(GLA)g(and)g(RE2C)f(sp)q
+(eci\014cations.)39 b(The)-42 2030 y(RE2C-generated)18
+b(scanners)g(w)o(ere)f(still)e(faster)i(and)g(smaller)d(except)k(on)e
+(the)h(MIPS)g(R4000,)e(where)i(the)g(cc-compiled)-42
+2080 y(GLA)d(scanner)h(w)o(as)f(sligh)o(tly)f(faster.)21
+2130 y(Note)k(ho)o(w)o(ev)o(er,)g(that)g(the)g(RE2C)g(sp)q
+(eci\014cation)g(can)g(b)q(e)g(substan)o(tially)f(sp)q(ed)i(up)f(b)o(y)
+f(using)h(a)f(tec)o(hnique)i(akin)e(to)-42 2179 y(lo)q(op)e(unrolling.)
+i(Replacing)d(the)i(original)d(k)o(eyw)o(ord)h(matc)o(hing)f(rule)j(in)
+e(the)i(RE2C)e(sp)q(eci\014cation)1548 2164 y Fq(15)138
+2252 y Fm(L)22 b(I*)435 b Fk(f)22 b Fm(RET\(ID\);)e Fk(g)-42
+2345 y Fr(with)14 b(the)h(follo)o(wing)c(rules)p -42
+2380 780 2 v -11 2407 a Fn(13)22 2419 y Fo(Actually)m(,)f(GLA)i(w)o
+(ould)f(generate)e(a)i Fg(while)f Fo(statemen)o(t.)j(Most)e(compilers)e
+(will)j(generate)d(the)i(same)f(ob)r(ject)g(co)q(de)g(for)h(b)q(oth.)
+-11 2446 y Fn(14)22 2458 y Fo(No)h(c)o(hec)o(ks)e(are)h(made)f(to)h
+(ensure)f(that)g(only)h(7-bit)f(c)o(haracters)f(app)q(ear)h(in)h(the)g
+(input.)-11 2486 y Fn(15)22 2498 y Fg(L)e Fo(=)i Fg([a-zA-Z)p
+215 2498 11 2 v 10 w(])g Fo(and)g Fg(I)e Fo(=)i Fg([a-zA-Z)p
+514 2498 V 10 w(0-9])n Fo(.)913 2748 y Fr(12)p eop
+%%Page: 13 13
+13 12 bop 727 776 a Fr(time)387 b(space)380 826 y(program)p
+557 841 2 50 v 61 w(user)72 b(sys)65 b(total)p 974 841
+V 62 w(text)58 b(data)e(bss)64 b(total)p 355 842 1158
+2 v 850 877 a Fi(R4000)16 b(/)f(gc)n(c2.3.3)g(-O)p 355
+894 V 479 929 a Fr(gla)p 557 944 2 50 v 71 w(2.63)p 703
+944 V 51 w(0.58)p 828 944 V 71 w(3.21)p 974 944 V 50
+w(5040)p 1109 944 V 50 w(2496)p 1243 944 V 51 w(144)p
+1357 944 V 71 w(7680)458 979 y(re2c)p 557 994 V 73 w(2.50)p
+703 994 V 51 w(0.65)p 828 994 V 71 w(3.15)p 974 994 V
+50 w(6448)p 1109 994 V 71 w(512)p 1243 994 V 92 w(0)p
+1357 994 V 72 w(6960)414 1028 y(re2c)g(-s)p 557 1043
+V 72 w(2.49)p 703 1043 V 51 w(0.67)p 828 1043 V 71 w(3.16)p
+974 1043 V 50 w(4976)p 1109 1043 V 50 w(4224)p 1243 1043
+V 92 w(0)p 1357 1043 V 72 w(9200)382 1078 y(re2c)g(-s)f
+Fk(y)p 557 1093 V 72 w Fr(2.08)p 703 1093 V 51 w(0.59)p
+828 1093 V 71 w(2.67)p 974 1093 V 50 w(5792)p 1109 1093
+V 50 w(4224)p 1243 1093 V 92 w(0)p 1357 1093 V 52 w(10016)p
+355 1095 1158 2 v 726 1130 a Fi(R4000)i(/)f(c)n(c2.11.2)g(-O)g(-Olimit)
+e(5000)p 355 1146 V 479 1181 a Fr(gla)p 557 1196 2 50
+v 71 w(2.43)p 703 1196 V 51 w(0.64)p 828 1196 V 71 w(3.07)p
+974 1196 V 50 w(6512)p 1109 1196 V 50 w(2416)p 1243 1196
+V 51 w(128)p 1357 1196 V 71 w(9056)458 1231 y(re2c)p
+557 1246 V 73 w(2.93)p 703 1246 V 51 w(0.67)p 828 1246
+V 71 w(3.60)p 974 1246 V 50 w(8048)p 1109 1246 V 71 w(528)p
+1243 1246 V 92 w(0)p 1357 1246 V 72 w(8576)414 1281 y(re2c)i(-s)p
+557 1296 V 72 w(3.04)p 703 1296 V 51 w(0.64)p 828 1296
+V 71 w(3.68)p 974 1296 V 50 w(9952)p 1109 1296 V 50 w(2208)p
+1243 1296 V 92 w(0)p 1357 1296 V 52 w(12160)p 355 1297
+1158 2 v 838 1332 a Fi(SP)m(AR)o(C)g(/)g(gc)n(c2.3.3)g(-O)p
+355 1349 V 479 1384 a Fr(gla)p 557 1399 2 50 v 71 w(4.08)p
+703 1399 V 51 w(1.65)p 828 1399 V 71 w(5.73)p 974 1399
+V 50 w(5472)p 1109 1399 V 50 w(1656)p 1243 1399 V 51
+w(136)p 1357 1399 V 71 w(7264)458 1434 y(re2c)p 557 1449
+V 73 w(3.77)p 703 1449 V 51 w(1.67)p 828 1449 V 71 w(5.44)p
+974 1449 V 50 w(7008)p 1109 1449 V 113 w(0)p 1243 1449
+V 92 w(0)p 1357 1449 V 72 w(7008)414 1483 y(re2c)g(-s)p
+557 1498 V 72 w(3.66)p 703 1498 V 51 w(2.37)p 828 1498
+V 71 w(6.03)p 974 1498 V 50 w(9112)p 1109 1498 V 113
+w(0)p 1243 1498 V 92 w(0)p 1357 1498 V 72 w(9112)p 355
+1500 1158 2 v 869 1535 a Fi(i486)g(/)g(gc)n(c2.4.5)g(-O)p
+355 1551 V 479 1586 a Fr(gla)p 557 1601 2 50 v 71 w(5.04)p
+703 1601 V 51 w(1.15)p 828 1601 V 71 w(6.19)p 974 1601
+V 50 w(5368)p 1109 1601 V 50 w(1632)p 1243 1601 V 51
+w(108)p 1357 1601 V 71 w(7108)458 1636 y(re2c)p 557 1651
+V 73 w(4.75)p 703 1651 V 51 w(1.17)p 828 1651 V 71 w(5.92)p
+974 1651 V 50 w(5448)p 1109 1651 V 113 w(0)p 1243 1651
+V 92 w(0)p 1357 1651 V 72 w(5448)414 1686 y(re2c)g(-s)p
+557 1701 V 72 w(5.06)p 703 1701 V 51 w(1.13)p 828 1701
+V 71 w(6.19)p 974 1701 V 50 w(8248)p 1109 1701 V 113
+w(0)p 1243 1701 V 92 w(0)p 1357 1701 V 72 w(8248)p 355
+1703 1158 2 v 860 1737 a Fi(68020)h(/)f(gc)n(c1.40)h(-O)p
+355 1754 V 479 1789 a Fr(gla)p 557 1804 2 50 v 51 w(32.69)p
+703 1804 V 50 w(3.37)p 828 1804 V 50 w(36.06)p 974 1804
+V 50 w(4772)p 1109 1804 V 50 w(1632)p 1243 1804 V 51
+w(106)p 1357 1804 V 71 w(6510)458 1839 y(re2c)p 557 1854
+V 53 w(29.86)p 703 1854 V 50 w(3.74)p 828 1854 V 50 w(33.60)p
+974 1854 V 50 w(4468)p 1109 1854 V 113 w(0)p 1243 1854
+V 92 w(0)p 1357 1854 V 72 w(4468)414 1889 y(re2c)f(-s)p
+557 1904 V 52 w(28.77)p 703 1904 V 50 w(3.55)p 828 1904
+V 50 w(32.32)p 974 1904 V 50 w(5616)p 1109 1904 V 113
+w(0)p 1243 1904 V 92 w(0)p 1357 1904 V 72 w(5616)108
+1978 y(T)m(able)i(2:)24 b(Scanner)18 b(p)q(erformance)f(with)g(k)o(eyw)
+o(ords)g(treated)h(as)f(iden)o(ti\014ers.)29 b Fk(y)17
+b Fr(uses)h(an)f(\\unrolled")108 2028 y(sp)q(eci\014cation.)913
+2748 y(13)p eop
+%%Page: 14 14
+14 13 bop 138 185 a Fm(L)501 b Fk(f)22 b Fm(RET\(ID\);)e
+Fk(g)138 235 y Fm(L)i(I)457 b Fk(f)22 b Fm(RET\(ID\);)e
+Fk(g)138 284 y Fm(L)i(I)g(I)413 b Fk(f)22 b Fm(RET\(ID\);)e
+Fk(g)138 334 y Fm(L)i(I)g(I)f(I)370 b Fk(f)22 b Fm(RET\(ID\);)e
+Fk(g)138 384 y Fm(L)i(I)g(I)f(I)h(I)326 b Fk(f)22 b Fm(RET\(ID\);)e
+Fk(g)138 434 y Fm(L)i(I)g(I)f(I)h(I)f(I)283 b Fk(f)22
+b Fm(RET\(ID\);)e Fk(g)138 484 y Fm(L)i(I)g(I)f(I)h(I)f(I)h(I)239
+b Fk(f)22 b Fm(RET\(ID\);)e Fk(g)138 533 y Fm(L)i(I)g(I)f(I)h(I)f(I)h
+(I)f(I)196 b Fk(f)22 b Fm(RET\(ID\);)e Fk(g)138 583 y
+Fm(L)i(I*)435 b Fk(f)22 b Fm(RET\(ID\);)e Fk(g)-42 677
+y Fr(reduces)f(the)e(n)o(um)o(b)q(er)f(of)g(end-of-bu\013er)h(c)o(hec)o
+(ks)h(and)e(results)i(in)e(a)g(signi\014can)o(t)g(sp)q(eed)i(impro)o(v)
+o(emen)o(t)13 b(o)o(v)o(er)k(the)g(GLA-)-42 726 y(generated)f(scanner.)
+-42 864 y Fs(6)67 b(Summary)24 b(and)f(F)-6 b(urther)25
+b(W)-6 b(ork)-42 955 y Fr(This)16 b(pap)q(er)h(has)f(describ)q(ed)h
+(RE2C,)e(a)h(to)q(ol)f(for)g(creating)h(lexical)f(analyzers.)24
+b(Unlik)o(e)16 b(other)g(suc)o(h)h(to)q(ols,)e(RE2C)g(con-)-42
+1004 y(cen)o(trates)i(solely)d(on)g(generating)g(e\016cien)o(t)h(co)q
+(de)g(for)f(matc)o(hing)f(regular)h(expressions.)21 b(Not)14
+b(only)g(do)q(es)h(this)g(singleness)-42 1054 y(of)h(purp)q(ose)i(mak)o
+(e)c(RE2C)i(more)g(suitable)g(for)g(a)g(wider)g(v)n(ariet)o(y)g(of)g
+(applications,)f(it)h(allo)o(ws)f(it)h(to)g(generate)i(scanners)-42
+1104 y(whic)o(h)c(approac)o(h)g(hand-crafted)h(scanners)g(in)f(terms)g
+(of)f(size)i(and)e(sp)q(eed.)20 b(Compared)13 b(to)h(scanners)i
+(generated)f(b)o(y)f(\015ex,)-42 1154 y(and)g(GLA,)f(RE2C-generated)i
+(scanners)g(are)g(faster)f(and)g(in)f(man)o(y)f(cases)k(smaller)c(as)i
+(w)o(ell.)21 1204 y(While)g(RE2C-generated)h(scanners)h(p)q(erform)e(w)
+o(ell,)g(there)i(is)e(still)g(ro)q(om)f(for)h(impro)o(v)o(emen)o(t.)k
+(Near)d(term)f(impro)o(v)o(e-)-42 1254 y(men)o(ts)g(include)g(using)f
+(GLA's)h(bit)f(v)o(ectors)i(to)f(simplify)d(some)i Fm(switch)p
+Fr(es)h(and)f(adding)g(a)h(state)h(unrolling)d(op)q(erator.)21
+1303 y(In)i(the)g(longer)g(term,)f(inline)g(actions)h(will)e(b)q(e)i
+(added)h(to)e(RE2C.)g(F)m(or)h(example,)e(a)h(sp)q(eci\014cation)i(lik)
+o(e)138 1386 y Fm(D)22 b Fk(f)p Fm(c)f(=)h($)p Fk(g)f
+Fm(\(D)h Fk(f)p Fm(c)f(=)h(10*c)e(+)i($)p Fk(g)p Fm(\)*)-42
+1469 y Fr(migh)o(t)15 b(b)q(e)i(used)g(to)f(obtain)g(the)h(v)n(alue)f
+(of)g(a)g(previously)g(scanned)i(in)o(teger.)26 b(T)o(ypically)m(,)14
+b(these)k(sorts)g(of)d(sp)q(eci\014cations)-42 1519 y(w)o(ould)f(b)q(e)
+g(used)h(as)f(an)f(action)h(in)f(some)g(other)i(sp)q(eci\014cation.)-42
+1656 y Fs(7)67 b(Ac)n(kno)n(wledgmen)n(ts)-42 1747 y
+Fr(The)15 b(authors)f(thank)g(the)g(referees)j(for)c(their)h(man)o(y)e
+(v)n(aluable)h(commen)o(ts)f(and)i(suggestions.)913 2748
+y(14)p eop
+%%Page: 15 15
+15 14 bop -42 195 a Fs(A)68 b(C)22 b(Scanner)-42 276
+y Fg(#define)16 b(BSIZE)192 b(8192)-42 315 y(#define)16
+b(RET\(i\))174 b({s->cur)15 b(=)i(cursor;)e(return)h(i;})-42
+394 y(#define)g(YYCTYPE)156 b(uchar)-42 433 y(#define)16
+b(YYCURSOR)138 b(cursor)-42 473 y(#define)16 b(YYLIMIT)156
+b(s->lim)-42 512 y(#define)16 b(YYMARKER)138 b(s->ptr)-42
+552 y(#define)16 b(YYFILL\(n\))120 b({cursor)15 b(=)i(fill\(s,)e
+(cursor\);})-42 631 y(typedef)h(struct)f(Scanner)g({)29
+670 y(int)299 b(fd;)29 709 y(uint)281 b(line;)29 749
+y(uchar)263 b(*bot,)16 b(*tok,)g(*ptr,)f(*cur,)h(*pos,)g(*lim,)g(*top,)
+g(*eof;)-42 788 y(})i(Scanner;)-42 867 y(uchar)e(*fill\(Scann)o(er)e
+(*s,)j(uchar)f(*cursor\){)29 907 y(if\(!s->eof)o(\){)100
+946 y(uint)g(cnt)g(=)i(s->tok)d(-)i(s->bot;)100 985 y(if\(cnt\){)d(/*)j
+(move)g(partial)e(token)h(to)g(bottom)g(*/)170 1025 y(memcpy\(s->b)o
+(ot,)e(s->tok,)h(s->lim)g(-)j(s->tok\);)d(s->tok)g(=)i(s->bot;)170
+1064 y(s->ptr)f(-=)h(cnt;)f(cursor)f(-=)i(cnt;)f(s->pos)g(-=)h(cnt;)f
+(s->lim)g(-=)h(cnt;)100 1104 y(})100 1143 y(if\(\(s->to)o(p)e(-)i
+(s->lim\))e(<)i(BSIZE\){)f(/*)g(buffer)g(needs)g(to)h(be)g(expanded)d
+(*/)170 1183 y(uchar)i(*buf)g(=)i(\(uchar*\))c(malloc\(\(\(s-)o(>li)o
+(m)h(-)i(s->bot\))e(+)i(BSIZE\)*size)o(of\()o(uch)o(ar\))o(\);)170
+1222 y(memcpy\(buf,)d(s->tok,)h(s->lim)h(-)h(s->tok\);)e(s->tok)g(=)i
+(buf;)170 1262 y(s->ptr)f(=)h(&buf[s->pt)o(r)e(-)i(s->bot];)e(cursor)g
+(=)j(&buf[curs)o(or)c(-)k(s->bot];)170 1301 y(s->pos)e(=)h(&buf[s->po)o
+(s)e(-)i(s->bot];)e(s->lim)g(=)j(&buf[s->l)o(im)c(-)k(s->bot];)170
+1340 y(s->top)e(=)h(&s->lim[BS)o(IZE)o(];)170 1380 y(free\(s->bot)o
+(\);)d(s->bot)i(=)h(buf;)100 1419 y(})100 1459 y(if\(\(cnt)e(=)i
+(read\(s->fd)o(,)e(\(char*\))g(s->lim,)g(BSIZE\)\))g(!=)i(BSIZE\){)e
+(/*)i(EOF)g(*/)170 1498 y(s->eof)f(=)h(&s->lim[cn)o(t];)d(*\(s->eof\)+)
+o(+)h(=)i('\\n';)100 1538 y(})100 1577 y(s->lim)e(+=)i(cnt;)29
+1616 y(})29 1656 y(return)f(cursor;)-42 1695 y(})-42
+1774 y(int)h(scan\(Scann)o(er)d(*s\){)100 1814 y(uchar)h(*cursor)h(=)h
+(s->cur;)-42 1853 y(std:)70 b(s->tok)15 b(=)i(cursor;)-42
+1892 y(/*!re2c)100 1932 y("/*")157 b({)17 b(goto)f(comment;)f(})-42
+2013 y Fc(:)6 b(:)g(:)11 b Fb(mor)n(e)j(rules)e Fc(:)6
+b(:)g(:)100 2086 y Fg([)17 b(\\t\\v\\f]+)50 b({)17 b(goto)f(std;)h(})
+100 2125 y("\\n")157 b({)17 b(if\(cursor)e(==)i(s->eof\))e(RET\(EOI\);)
+f(s->pos)i(=)h(cursor;)e(s->line++;)364 2164 y(goto)h(std;)h(})100
+2204 y([\\000-\\37)o(7])32 b({)17 b(printf\("une)o(xpe)o(cte)o(d)d
+(character:)h('\045c'\\n",)f(*s->tok\);)364 2243 y(goto)i(std;)h(})-42
+2283 y(*/)-42 2322 y(comment:)-42 2362 y(/*!re2c)100
+2401 y("*/")157 b({)17 b(goto)f(std;)h(})100 2440 y("\\n")157
+b({)17 b(if\(cursor)e(==)i(s->eof\))e(RET\(EOI\);)f(s->tok)i(=)h
+(s->pos)e(=)j(cursor;)d(s->line++;)364 2480 y(goto)h(comment;)f(})100
+2519 y([\\000-\\37)o(7])32 b({)17 b(goto)f(comment;)f(})-42
+2559 y(*/)-42 2598 y(})913 2748 y Fr(15)p eop
+%%Page: 16 16
+16 15 bop -42 195 a Fs(References)-21 286 y Fr([1])20
+b Fa(Aho,)d(A.)g(V.,)f(Sethi,)h(R.,)h(and)f(Ullman,)h(J.)e(D.)21
+b Fi(Compilers:)e(principles,)c(te)n(chniques,)h(and)g(to)n(ols)p
+Fr(.)k(Addison-)44 336 y(W)m(esley)m(,)13 b(1988.)k(Reprin)o(ted)d
+(with)f(corrections.)-21 419 y([2])20 b Fa(Bernstein,)c(R.)f(L.)k
+Fr(Pro)q(ducing)13 b(go)q(o)q(d)g(co)q(de)i(for)e(the)h(case)g
+(statemen)o(t.)j Fi(Softwar)n(e{Pr)n(actic)n(e)d(and)h(Exp)n(erienc)n
+(e)g(15)p Fr(,)44 469 y(10)e(\(Octob)q(er)j(1985\),)c(1021{1024.)-21
+552 y([3])20 b Fa(DeRemer,)e(F.,)f(and)g(Pennello,)i(T.)h
+Fr(E\016cien)o(t)15 b(computation)e(of)h Fl(LALR)p Fr(\(1\))h(lo)q
+(ok-ahead)f(sets.)21 b Fi(A)o(CM)15 b(T)m(r)n(ans-)44
+602 y(actions)g(on)g(Pr)n(o)n(gr)n(amming)g(L)n(anguages)h(and)f
+(Systems)g(4)p Fr(,)f(4)g(\(Octob)q(er)h(1982\),)e(615{649.)-21
+685 y([4])20 b Fa(Ellis,)c(M.,)g(and)g(Str)o(oustr)o(up,)h(B.)i
+Fi(The)c(A)o(nnotate)n(d)h(C++)e(R)n(efer)n(enc)n(e)h(Manual)p
+Fr(.)j(Addison-W)m(esley)m(,)13 b(1990.)-21 768 y([5])20
+b Fa(Fraser,)c(C.)f(W.,)h(and)g(Hanson,)h(D.)f(R.)i Fr(A)c
+(retargetable)g(compiler)e(for)h(ANSI)h(C.)j Fi(SIGPLAN)e(Notic)n(es)f
+(26)p Fr(,)g(10)44 817 y(\(Octob)q(er)h(1991\),)e(29{43.)-21
+900 y([6])20 b Fa(Garey,)g(M.)d(R.,)i(and)g(Johnson,)h(D.)e(S.)25
+b Fi(Computers)16 b(and)h(Intr)n(actability:)k(A)c(Guide)g(to)f(the)h
+(The)n(ory)f(of)h(NP-)44 950 y(Completeness)p Fr(.)h(W.)13
+b(H.)g(F)m(reeman)g(and)h(Compan)o(y)m(,)d(1991.)-21
+1033 y([7])20 b Fa(Gra)m(y,)14 b(R.)e(W.)g Fl(\015)r
+Fr(-GLA)e(-)g(A)g(generator)g(for)g(lexical)f(analyzers)h(that)g
+(programmers)e(can)i(use.)i Fi(USENIX)g(Confer)n(enc)n(e)44
+1083 y(Pr)n(o)n(c)n(e)n(e)n(dings)17 b Fr(\(June)e(1988\),)d(147{160.)
+-21 1166 y([8])20 b Fa(Gra)m(y,)c(R.)f(W.,)g(Heuring,)g(V.)f(P.,)h
+(Levi,)h(S.)f(P.,)g(Slo)o(ane,)i(A.)d(M.,)h(and)g(W)-5
+b(aite,)15 b(W.)g(M.)h Fr(Eli:)h(A)c(complete,)44 1216
+y(\015exible)h(compiler)e(construction)j(system.)j Fi(Communic)n
+(ations)d(of)g(the)g(A)o(CM)f(35)p Fr(,)g(2)g(\(F)m(ebruary)g(1992\),)f
+(121{131.)-21 1299 y([9])20 b Fa(Gr)o(osch,)e(J.)i Fr(E\016cien)o(t)15
+b(generation)g(of)f(lexical)f(analysers.)21 b Fi(Softwar)n(e{Pr)n
+(actic)n(e)15 b(and)h(Exp)n(erienc)n(e)g(19)p Fr(,)f(11)f(\(1989\),)44
+1349 y(1089{1103.)-42 1432 y([10])20 b Fa(Harrison,)c(M.)g(A.)j
+Fi(Intr)n(o)n(duction)c(to)g(F)m(ormal)f(L)n(anguage)i(The)n(ory)p
+Fr(.)i(Addison-W)m(esley)m(,)13 b(1978.)-42 1515 y([11])20
+b Fa(Hennessy,)15 b(J.)e(L.,)i(and)f(Mendelsohn,)i(N.)f
+Fr(Compilation)8 b(of)j(the)h(Pascal)g(case)g(statemen)o(t.)i
+Fi(Softwar)n(e{Pr)n(actic)n(e)44 1565 y(and)h(Exp)n(erienc)n(e)h(12)p
+Fr(,)d(9)h(\(Septem)o(b)q(er)h(1982\),)d(879{882.)-42
+1648 y([12])20 b Fa(Horspool,)c(R.)g(N.,)f(and)g(Whitney,)h(M.)h
+Fr(Ev)o(en)d(faster)g(LR)e(parsing.)k Fi(Softwar)n(e{Pr)n(actic)n(e)d
+(and)i(Exp)n(erienc)n(e)g(20)p Fr(,)44 1697 y(6)e(\(1990\),)g(515{535.)
+-42 1780 y([13])20 b Fa(Ja)o(cobson,)d(V.)i Fr(T)m(uning)14
+b(UNIX)g(Lex)h(or)f(it's)f(NOT)i(true)g(what)f(they)h(sa)o(y)f(ab)q
+(out)g(Lex.)19 b(In)14 b Fi(USENIX)i(Confer)n(enc)n(e)44
+1830 y(Pr)n(o)n(c)n(e)n(e)n(dings)h Fr(\(W)m(ashington,)12
+b(DC,)h(Win)o(ter)h(1987\),)f(pp.)g(163{164.)j(Abstract)f(only)m(.)-42
+1913 y([14])20 b Fa(Kernighan,)h(B.)e(W.,)h(and)g(Ritchie,)f(D.)h(M.)28
+b Fi(The)18 b(C)f(Pr)n(o)n(gr)n(amming)g(L)n(anguage,)i(2nd)g(Ed.)28
+b Fr(Pren)o(tice-Hall,)44 1963 y(Inc.,)13 b(1988.)-42
+2046 y([15])20 b Fa(Lesk,)25 b(M.)e(E.)38 b Fr(LEX)20
+b({)g(a)g(lexical)g(analyzer)g(generator.)38 b(Computing)18
+b(Science)k(T)m(ec)o(hnical)e(Rep)q(ort)h(39,)g(Bell)44
+2096 y(T)m(elephone)14 b(Lab)q(oratories,)g(Murra)o(y)g(Hill,)e(NJ,)h
+(1975.)-42 2179 y([16])20 b Fa(P)l(axson,)e(V.)h Fr(\015ex)14
+b({)g(man)e(pages,)i(1988.)j(In)d Ff(\015ex-2.3.7.ta)o(r.Z)p
+Fr(.)e(Av)n(ailable)g(for)i(anon)o(ymous)e(ftp)i(from)e
+Ff(ftp.uu.net)j Fr(in)44 2229 y Ff(/pack)o(ages/gnu)p
+Fr(.)-42 2312 y([17])20 b Fa(Pennello,)k(T.)d(J.)33 b
+Fr(V)m(ery)19 b(fast)g(LR)f(parsing.)33 b(In)19 b Fi(Pr)n(o)n(c)n(e)n
+(e)n(dings)g(of)g(the)h(A)o(CM)f(SIGPLAN'86)h(Symp)n(osium)g(on)44
+2362 y(Compiler)14 b(Construction)j Fr(\(July)c(1986\),)g(A)o(CM.)-42
+2445 y([18])20 b Fa(Sale,)g(A.)25 b Fr(The)17 b(implemen)o(tatio)o(n)c
+(of)j(case)h(statemen)o(ts)g(in)e(Pascal.)25 b Fi(Softwar)n(e{Pr)n
+(actic)n(e)16 b(and)i(Exp)n(erienc)n(e)f(11)p Fr(,)g(9)44
+2494 y(\(Septem)o(b)q(er)d(1981\),)f(929{942.)913 2748
+y(16)p eop
+%%Trailer
+end
+userdict /end-hook known{end-hook}if
+%%EOF
--- /dev/null
+#include <limits.h>
+#include <stdio.h>
+
+template<int base>
+static bool adddgt(unsigned long &u, unsigned int d)
+{
+ if (u > (ULONG_MAX - d) / base) {
+ return false;
+ }
+ u = u * base + d;
+ return true;
+}
+
+static bool lex(const char *s, unsigned long &u)
+{
+ const char *YYMARKER;
+ const char *YYCTXMARKER;
+ u = 0;
+
+ /*!re2c
+ re2c:yyfill:enable = 0;
+ re2c:define:YYCTYPE = char;
+ re2c:define:YYCURSOR = s;
+
+ end = "\x00";
+ */
+
+ /*!re2c
+ * { return false; }
+ '0b' / [01] { goto bin; }
+ "0" { goto oct; }
+ "" / [1-9] { goto dec; }
+ '0x' / [0-9a-fA-F] { goto hex; }
+ */
+
+bin:
+ /*!re2c
+ * { return false; }
+ end { return true; }
+ [01] { if (!adddgt<2>(u, s[-1] - '0')) return false; goto bin; }
+ */
+
+oct:
+ /*!re2c
+ * { return false; }
+ end { return true; }
+ [0-7] { if (!adddgt<8>(u, s[-1] - '0')) return false; goto oct; }
+ */
+
+dec:
+ /*!re2c
+ * { return false; }
+ end { return true; }
+ [0-9] { if (!adddgt<10>(u, s[-1] - '0')) return false; goto dec; }
+ */
+
+hex:
+ /*!re2c
+ * { return false; }
+ end { return true; }
+ [0-9] { if (!adddgt<16>(u, s[-1] - '0')) return false; goto hex; }
+ [a-f] { if (!adddgt<16>(u, s[-1] - 'a' + 10)) return false; goto hex; }
+ [A-F] { if (!adddgt<16>(u, s[-1] - 'A' + 10)) return false; goto hex; }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ for (int i = 1; i < argc; ++i) {
+ unsigned long u;
+ if (lex(argv[i], u)) {
+ printf("%lu\n", u);
+ } else {
+ printf("error\n");
+ }
+ }
+ return 0;
+}
--- /dev/null
+#include <limits.h>
+#include <stdio.h>
+
+template<int base>
+static bool adddgt(unsigned long &u, unsigned int d)
+{
+ if (u > (ULONG_MAX - d) / base) {
+ return false;
+ }
+ u = u * base + d;
+ return true;
+}
+
+/*!types:re2c*/
+
+static bool lex(const char *s, unsigned long &u)
+{
+ const char *YYMARKER;
+ const char *YYCTXMARKER;
+ int c = yycinit;
+ u = 0;
+ /*!re2c
+ re2c:yyfill:enable = 0;
+ re2c:define:YYCTYPE = char;
+ re2c:define:YYCURSOR = s;
+ re2c:define:YYGETCONDITION = "c";
+ re2c:define:YYGETCONDITION:naked = 1;
+ re2c:define:YYSETCONDITION = "c = @@;";
+ re2c:define:YYSETCONDITION:naked = 1;
+
+ <*> * { return false; }
+
+ <init> '0b' / [01] :=> bin
+ <init> "0" :=> oct
+ <init> "" / [1-9] :=> dec
+ <init> '0x' / [0-9a-fA-F] :=> hex
+
+ <bin, oct, dec, hex> "\x00" { return true; }
+ <bin> [01] { if (!adddgt<2>(u, s[-1] - '0')) return false; goto yyc_bin; }
+ <oct> [0-7] { if (!adddgt<8>(u, s[-1] - '0')) return false; goto yyc_oct; }
+ <dec> [0-9] { if (!adddgt<10>(u, s[-1] - '0')) return false; goto yyc_dec; }
+ <hex> [0-9] { if (!adddgt<16>(u, s[-1] - '0')) return false; goto yyc_hex; }
+ <hex> [a-f] { if (!adddgt<16>(u, s[-1] - 'a' + 10)) return false; goto yyc_hex; }
+ <hex> [A-F] { if (!adddgt<16>(u, s[-1] - 'A' + 10)) return false; goto yyc_hex; }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ for (int i = 1; i < argc; ++i) {
+ unsigned long u;
+ if (lex(argv[i], u)) {
+ printf("%lu\n", u);
+ } else {
+ printf("error\n");
+ }
+ }
+ return 0;
+}
--- /dev/null
+#include <ctype.h>
+#include <stdio.h>
+
+template<typename char_t>
+struct input_t {
+ size_t len;
+ char_t *str;
+
+ input_t(FILE *f) : len(0), str(NULL)
+ {
+ fseek(f, 0, SEEK_END);
+ len = ftell(f) / sizeof(char_t);
+ fseek(f, 0, SEEK_SET);
+ str = new char_t[len + 1];
+ fread(str, sizeof(char_t), len, f);
+ str[len] = 0;
+ }
+ ~input_t()
+ {
+ delete[]str;
+ }
+};
+
+typedef input_t<unsigned char> iutf8_t;
+typedef input_t<unsigned short> iutf16_t;
+typedef input_t<unsigned int> iutf32_t;
+typedef input_t<unsigned short> iucs2_t;
+
+struct out_t {
+ bool caps;
+
+ out_t() : caps(false) {}
+ void prt(char c)
+ {
+ printf("%c", caps ? toupper(c) : c);
+ caps = false;
+ }
+ void err()
+ {
+ printf(" ... error\n");
+ }
+};
+
+/*!rules:re2c
+ re2c:yyfill:enable = 0;
+
+ // letters
+ l = "\u2830";
+ la = "\u2801"; lb = "\u2803"; lc = "\u2809"; ld = "\u2819"; le = "\u2811";
+ lf = "\u280b"; lg = "\u281b"; lh = "\u2813"; li = "\u280a"; lj = "\u281a";
+ lk = "\u2805"; ll = "\u2807"; lm = "\u280d"; ln = "\u281d"; lo = "\u2815";
+ lp = "\u280f"; lq = "\u281f"; lr = "\u2817"; ls = "\u280e"; lt = "\u281e";
+ lu = "\u2825"; lv = "\u2827"; lw = "\u283a"; lx = "\u282d"; ly = "\u283d";
+ lz = "\u2835";
+
+ // numbers
+ n = "\u283c";
+ n1 = "\u2801"; n2 = "\u2803"; n3 = "\u2809"; n4 = "\u2819"; n5 = "\u2811";
+ n6 = "\u280b"; n7 = "\u281b"; n8 = "\u2813"; n9 = "\u280a"; n0 = "\u281a";
+
+ // punctuation
+ pcom = "\u2802"; psem = "\u2806"; pcln = "\u2812";
+ pdot = "\u2832"; pxcl = "\u2816"; pqst = "\u2826";
+ past = "\u2814"; pdsh = "\u2804"; phyp = "\u2824";
+
+ // formatting
+ fcp = "\u2820"; fsp = "\u2800" | "\x20"; fnl = "\n" | "\n\r";
+
+ <*> * { out.err(); return; }
+ <*> "\x00" { if (YYCURSOR != in.str + in.len + 1) out.err(); return; }
+
+ <*> l :=> l
+ <l> la { out.prt('a'); goto yyc_l; }
+ <l> lb { out.prt('b'); goto yyc_l; }
+ <l> lc { out.prt('c'); goto yyc_l; }
+ <l> ld { out.prt('d'); goto yyc_l; }
+ <l> le { out.prt('e'); goto yyc_l; }
+ <l> lf { out.prt('f'); goto yyc_l; }
+ <l> lg { out.prt('g'); goto yyc_l; }
+ <l> lh { out.prt('h'); goto yyc_l; }
+ <l> li { out.prt('i'); goto yyc_l; }
+ <l> lj { out.prt('j'); goto yyc_l; }
+ <l> lk { out.prt('k'); goto yyc_l; }
+ <l> ll { out.prt('l'); goto yyc_l; }
+ <l> lm { out.prt('m'); goto yyc_l; }
+ <l> ln { out.prt('n'); goto yyc_l; }
+ <l> lo { out.prt('o'); goto yyc_l; }
+ <l> lp { out.prt('p'); goto yyc_l; }
+ <l> lq { out.prt('q'); goto yyc_l; }
+ <l> lr { out.prt('r'); goto yyc_l; }
+ <l> ls { out.prt('s'); goto yyc_l; }
+ <l> lt { out.prt('t'); goto yyc_l; }
+ <l> lu { out.prt('u'); goto yyc_l; }
+ <l> lv { out.prt('v'); goto yyc_l; }
+ <l> lw { out.prt('w'); goto yyc_l; }
+ <l> lx { out.prt('x'); goto yyc_l; }
+ <l> ly { out.prt('y'); goto yyc_l; }
+ <l> lz { out.prt('z'); goto yyc_l; }
+
+ <*> n :=> n
+ <n> n1 { out.prt('1'); goto yyc_n; }
+ <n> n2 { out.prt('2'); goto yyc_n; }
+ <n> n3 { out.prt('3'); goto yyc_n; }
+ <n> n4 { out.prt('4'); goto yyc_n; }
+ <n> n5 { out.prt('5'); goto yyc_n; }
+ <n> n6 { out.prt('6'); goto yyc_n; }
+ <n> n7 { out.prt('7'); goto yyc_n; }
+ <n> n8 { out.prt('8'); goto yyc_n; }
+ <n> n9 { out.prt('9'); goto yyc_n; }
+ <n> n0 { out.prt('0'); goto yyc_n; }
+
+ <*> pcom { out.prt(','); goto yyc_l; }
+ <*> psem { out.prt(';'); goto yyc_l; }
+ <*> pcln { out.prt(':'); goto yyc_l; }
+ <*> pdot { out.prt('.'); goto yyc_l; }
+ <*> pxcl { out.prt('!'); goto yyc_l; }
+ <*> pqst { out.prt('?'); goto yyc_l; }
+ <*> past { out.prt('*'); goto yyc_l; }
+ <*> pdsh { out.prt('\''); goto yyc_l; }
+ <*> phyp { out.prt('-'); goto yyc_l; }
+
+ <*> fcp { out.caps = true; goto yyc_l; }
+ <*> fsp { out.prt(' '); goto yyc_l; }
+ <*> fnl { out.prt('\n'); goto yyc_l; }
+*/
+
+/*!types:re2c*/
+
+static void lex_utf8(const iutf8_t & in)
+{
+ const unsigned char *YYCURSOR = in.str;
+ const unsigned char *YYMARKER;
+ int c = yycl;
+ out_t out;
+ /*!use:re2c
+ re2c:define:YYCTYPE = "unsigned char";
+ re2c:define:YYGETCONDITION = "c";
+ re2c:define:YYGETCONDITION:naked = 1;
+ re2c:define:YYSETCONDITION = "c = @@;";
+ re2c:define:YYSETCONDITION:naked = 1;
+ */
+}
+
+static void lex_utf16(const iutf16_t & in)
+{
+ const unsigned short *YYCURSOR = in.str;
+ int c = yycl;
+ out_t out;
+ /*!use:re2c
+ re2c:define:YYCTYPE = "unsigned int";
+ re2c:define:YYGETCONDITION = "c";
+ re2c:define:YYGETCONDITION:naked = 1;
+ re2c:define:YYSETCONDITION = "c = @@;";
+ re2c:define:YYSETCONDITION:naked = 1;
+ re2c:flags:8 = 0;
+ re2c:flags:x = 1;
+ */
+}
+
+static void lex_utf32(const iutf32_t & in)
+{
+ const unsigned int *YYCURSOR = in.str;
+ int c = yycl;
+ out_t out;
+ /*!use:re2c
+ re2c:define:YYCTYPE = "unsigned int";
+ re2c:define:YYGETCONDITION = "c";
+ re2c:define:YYGETCONDITION:naked = 1;
+ re2c:define:YYSETCONDITION = "c = @@;";
+ re2c:define:YYSETCONDITION:naked = 1;
+ re2c:flags:x = 0;
+ re2c:flags:u = 1;
+ */
+}
+
+static void lex_ucs2(const iucs2_t & in)
+{
+ const unsigned short *YYCURSOR = in.str;
+ int c = yycl;
+ out_t out;
+ /*!use:re2c
+ re2c:define:YYCTYPE = "unsigned int";
+ re2c:define:YYGETCONDITION = "c";
+ re2c:define:YYGETCONDITION:naked = 1;
+ re2c:define:YYSETCONDITION = "c = @@;";
+ re2c:define:YYSETCONDITION:naked = 1;
+ re2c:flags:u = 0;
+ re2c:flags:w = 1;
+ */
+}
+
+int main()
+{
+ FILE *f;
+
+ f = fopen("06_braille.utf8.txt", "rb");
+ if (f) {
+ printf("utf8:\n");
+ iutf8_t in(f);
+ lex_utf8(in);
+ fclose(f);
+ }
+
+ f = fopen("06_braille.utf16.txt", "rb");
+ if (f) {
+ printf("utf16:\n");
+ iutf16_t in(f);
+ lex_utf16(in);
+ fclose(f);
+ }
+
+ f = fopen("06_braille.utf32.txt", "rb");
+ if (f) {
+ printf("utf32:\n");
+ iutf32_t in(f);
+ lex_utf32(in);
+ fclose(f);
+ }
+
+ f = fopen("06_braille.ucs2.txt", "rb");
+ if (f) {
+ printf("ucs2:\n");
+ iucs2_t in(f);
+ lex_ucs2(in);
+ fclose(f);
+ }
+
+ return 0;
+}
--- /dev/null
+⠠⠁⠇⠇⠀⠓⠥⠍⠁⠝⠀⠃⠑⠊⠝⠛⠎⠀⠁⠗⠑⠀⠃⠕⠗⠝⠀⠋⠗⠑⠑⠀⠁⠝⠙⠀⠑⠟⠥⠁⠇⠀⠊⠝⠀⠙⠊⠛⠝⠊⠞⠽⠀⠁⠝⠙⠀⠗⠊⠛⠓⠞⠎⠲⠀
+⠠⠞⠓⠑⠽⠀⠁⠗⠑⠀⠑⠝⠙⠕⠺⠑⠙⠀⠺⠊⠞⠓⠀⠗⠑⠁⠎⠕⠝⠀⠁⠝⠙⠀⠉⠕⠝⠎⠉⠊⠑⠝⠉⠑⠀⠁⠝⠙⠀⠎⠓⠕⠥⠇⠙⠀⠁⠉⠞⠀⠞⠕⠺⠁⠗⠙⠎⠀
+⠕⠝⠑⠀⠁⠝⠕⠞⠓⠑⠗⠀⠊⠝⠀⠁⠀⠎⠏⠊⠗⠊⠞⠀⠕⠋⠀⠃⠗⠕⠞⠓⠑⠗⠓⠕⠕⠙⠲
+
--- /dev/null
+#include <float.h>
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+
+/*!max:re2c*/
+static const size_t SIZE = 64 * 1024;
+
+struct input_t {
+ unsigned char buf[SIZE + YYMAXFILL];
+ unsigned char *lim;
+ unsigned char *cur;
+ unsigned char *mar;
+ unsigned char *tok;
+ bool eof;
+
+ FILE *const file;
+
+ input_t(FILE *f)
+ : buf()
+ , lim(buf + SIZE)
+ , cur(lim)
+ , mar(lim)
+ , tok(lim)
+ , eof(false)
+ , file(f)
+ {}
+ bool fill(size_t need)
+ {
+ if (eof) {
+ return false;
+ }
+ const size_t free = tok - buf;
+ if (free < need) {
+ return false;
+ }
+ memmove(buf, tok, lim - tok);
+ lim -= free;
+ cur -= free;
+ mar -= free;
+ tok -= free;
+ lim += fread(lim, 1, free, file);
+ if (lim < buf + SIZE) {
+ eof = true;
+ memset(lim, 0, YYMAXFILL);
+ lim += YYMAXFILL;
+ }
+ return true;
+ }
+};
+
+/*!re2c re2c:define:YYCTYPE = "unsigned char"; */
+
+template<int base>
+static bool adddgt(unsigned long &u, unsigned long d)
+{
+ if (u > (ULONG_MAX - d) / base) {
+ return false;
+ }
+ u = u * base + d;
+ return true;
+}
+
+static bool lex_oct(const unsigned char *s, const unsigned char *e, unsigned long &u)
+{
+ for (u = 0, ++s; s < e; ++s) {
+ if (!adddgt<8>(u, *s - 0x30u)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+static bool lex_dec(const unsigned char *s, const unsigned char *e, unsigned long &u)
+{
+ for (u = 0; s < e; ++s) {
+ if (!adddgt<10>(u, *s - 0x30u)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+static bool lex_hex(const unsigned char *s, const unsigned char *e, unsigned long &u)
+{
+ for (u = 0, s += 2; s < e;) {
+ /*!re2c
+ re2c:yyfill:enable = 0;
+ re2c:define:YYCURSOR = s;
+ * { if (!adddgt<16>(u, s[-1] - 0x30u)) return false; continue; }
+ [a-f] { if (!adddgt<16>(u, s[-1] - 0x61u + 10)) return false; continue; }
+ [A-F] { if (!adddgt<16>(u, s[-1] - 0x41u + 10)) return false; continue; }
+ */
+ }
+ return true;
+}
+
+static bool lex_str(input_t &in, unsigned char q)
+{
+ printf("%c", q);
+ for (unsigned long u = q;; printf("\\x%lx", u)) {
+ in.tok = in.cur;
+ /*!re2c
+ re2c:define:YYCURSOR = in.cur;
+ re2c:define:YYMARKER = in.mar;
+ re2c:define:YYLIMIT = in.lim;
+ re2c:yyfill:enable = 1;
+ re2c:define:YYFILL = "if (!in.fill(@@)) return false;";
+ re2c:define:YYFILL:naked = 1;
+ * { return false; }
+ [^\n\\] { u = in.tok[0]; if (u == q) break; continue; }
+ "\\a" { u = '\a'; continue; }
+ "\\b" { u = '\b'; continue; }
+ "\\f" { u = '\f'; continue; }
+ "\\n" { u = '\n'; continue; }
+ "\\r" { u = '\r'; continue; }
+ "\\t" { u = '\t'; continue; }
+ "\\v" { u = '\v'; continue; }
+ "\\\\" { u = '\\'; continue; }
+ "\\'" { u = '\''; continue; }
+ "\\\"" { u = '"'; continue; }
+ "\\?" { u = '?'; continue; }
+ "\\" [0-7]{1,3} { lex_oct(in.tok, in.cur, u); continue; }
+ "\\u" [0-9a-fA-F]{4} { lex_hex(in.tok, in.cur, u); continue; }
+ "\\U" [0-9a-fA-F]{8} { lex_hex(in.tok, in.cur, u); continue; }
+ "\\x" [0-9a-fA-F]+ { if (!lex_hex(in.tok, in.cur, u)) return false; continue; }
+ */
+ }
+ printf("%c", q);
+ return true;
+}
+
+static bool lex_flt(const unsigned char *s)
+{
+ double d = 0;
+ double x = 1;
+ int e = 0;
+ /*!re2c
+ re2c:yyfill:enable = 0;
+ re2c:define:YYCURSOR = s;
+ */
+mant_int:
+ /*!re2c
+ "." { goto mant_frac; }
+ [eE] { goto exp_sign; }
+ * { d = (d * 10) + (s[-1] - '0'); goto mant_int; }
+ */
+mant_frac:
+ /*!re2c
+ "" { goto sfx; }
+ [eE] { goto exp_sign; }
+ [0-9] { d += (x /= 10) * (s[-1] - '0'); goto mant_frac; }
+ */
+exp_sign:
+ /*!re2c
+ "+"? { x = 1e+1; goto exp; }
+ "-" { x = 1e-1; goto exp; }
+ */
+exp:
+ /*!re2c
+ "" { for (; e > 0; --e) d *= x; goto sfx; }
+ [0-9] { e = (e * 10) + (s[-1] - '0'); goto exp; }
+ */
+sfx:
+ /*!re2c
+ * { goto end; }
+ [fF] { if (d > FLT_MAX) return false; goto end; }
+ */
+end:
+ printf("%g", d);
+ return true;
+}
+
+static bool lex(input_t &in)
+{
+ unsigned long u;
+ for (;;) {
+ in.tok = in.cur;
+ /*!re2c
+ re2c:define:YYCURSOR = in.cur;
+ re2c:define:YYMARKER = in.mar;
+ re2c:define:YYLIMIT = in.lim;
+ re2c:yyfill:enable = 1;
+ re2c:define:YYFILL = "if (!in.fill(@@)) return false;";
+ re2c:define:YYFILL:naked = 1;
+
+ end = "\x00";
+
+ * { return false; }
+ end { return in.lim - in.tok == YYMAXFILL; }
+
+ // macros
+ macro = ("#" | "%:") ([^\n] | "\\\n")* "\n";
+ macro { continue; }
+
+ // whitespaces
+ mcm = "/*" ([^*] | ("*" [^/]))* "*""/";
+ scm = "//" [^\n]* "\n";
+ wsp = ([ \t\v\n\r] | scm | mcm)+;
+ wsp { printf(" "); continue; }
+
+ // character and string literals
+ "L"? ['"] { if (!lex_str(in, in.cur[-1])) return false; continue; }
+ "L"? "''" { return false; }
+
+ // integer literals
+ oct = "0" [0-7]*;
+ dec = [1-9][0-9]*;
+ hex = '0x' [0-9a-fA-F]+;
+ oct { if (!lex_oct(in.tok, in.cur, u)) return false; goto sfx; }
+ dec { if (!lex_dec(in.tok, in.cur, u)) return false; goto sfx; }
+ hex { if (!lex_hex(in.tok, in.cur, u)) return false; goto sfx; }
+
+ // floating literals
+ frc = [0-9]* "." [0-9]+ | [0-9]+ ".";
+ exp = 'e' [+-]? [0-9]+;
+ flt = (frc exp? | [0-9]+ exp) [fFlL]?;
+ flt { if (lex_flt(in.tok)) continue; return false; }
+
+ // boolean literals
+ "false" { printf("false"); continue; }
+ "true" { printf("true"); continue; }
+
+ // keywords
+ "asm" { printf("ASM"); continue; }
+ "auto" { printf("AUTO"); continue; }
+ "bool" { printf("BOOL"); continue; }
+ "break" { printf("BREAK"); continue; }
+ "case" { printf("CASE"); continue; }
+ "catch" { printf("CATCH"); continue; }
+ "char" { printf("CHAR"); continue; }
+ "class" { printf("CLASS"); continue; }
+ "const" { printf("CONST"); continue; }
+ "const_cast" { printf("CONST_CAST"); continue; }
+ "continue" { printf("CONTINUE"); continue; }
+ "default" { printf("DEFAULT"); continue; }
+ "do" { printf("DO"); continue; }
+ "double" { printf("DOUBLE"); continue; }
+ "dynamic_cast" { printf("DYNAMIC_CAST"); continue; }
+ "else" { printf("ELSE"); continue; }
+ "enum" { printf("ENUM"); continue; }
+ "explicit" { printf("EXPLICIT"); continue; }
+ "export" { printf("EXPORT"); continue; }
+ "extern" { printf("EXTERN"); continue; }
+ "float" { printf("FLOAT"); continue; }
+ "for" { printf("FOR"); continue; }
+ "friend" { printf("FRIEND"); continue; }
+ "goto" { printf("GOTO"); continue; }
+ "if" { printf("IF"); continue; }
+ "inline" { printf("INLINE"); continue; }
+ "int" { printf("INT"); continue; }
+ "long" { printf("LONG"); continue; }
+ "mutable" { printf("MUTABLE"); continue; }
+ "namespace" { printf("NAMESPACE"); continue; }
+ "operator" { printf("OPERATOR"); continue; }
+ "private" { printf("PRIVATE"); continue; }
+ "protected" { printf("PROTECTED"); continue; }
+ "public" { printf("PUBLIC"); continue; }
+ "register" { printf("REGISTER"); continue; }
+ "reinterpret_cast" { printf("REINTERPRET_CAST"); continue; }
+ "return" { printf("RETURN"); continue; }
+ "short" { printf("SHORT"); continue; }
+ "signed" { printf("SIGNED"); continue; }
+ "sizeof" { printf("SIZEOF"); continue; }
+ "static" { printf("STATIC"); continue; }
+ "static_cast" { printf("STATIC_CAST"); continue; }
+ "struct" { printf("STRUCT"); continue; }
+ "switch" { printf("SWITCH"); continue; }
+ "template" { printf("TEMPLATE"); continue; }
+ "this" { printf("THIS"); continue; }
+ "throw" { printf("THROW"); continue; }
+ "try" { printf("TRY"); continue; }
+ "typedef" { printf("TYPEDEF"); continue; }
+ "typeid" { printf("TYPEID"); continue; }
+ "typename" { printf("TYPENAME"); continue; }
+ "union" { printf("UNION"); continue; }
+ "unsigned" { printf("UNSIGNED"); continue; }
+ "using" { printf("USING"); continue; }
+ "virtual" { printf("VIRTUAL"); continue; }
+ "void" { printf("VOID"); continue; }
+ "volatile" { printf("VOLATILE"); continue; }
+ "wchar_t" { printf("WCHAR_T"); continue; }
+ "while" { printf("WHILE"); continue; }
+
+ // operators and punctuation (including preprocessor)
+ ("{" | "<%") { printf("{"); continue; }
+ ("}" | "%>") { printf("}"); continue; }
+ ("[" | "<:") { printf("["); continue; }
+ ("]" | ":>") { printf("]"); continue; }
+ "(" { printf("("); continue; }
+ ")" { printf(")"); continue; }
+ ";" { printf(";"); continue; }
+ ":" { printf(":"); continue; }
+ "..." { printf("..."); continue; }
+ "new" { printf("new"); continue; }
+ "delete" { printf("delete"); continue; }
+ "?" { printf("?"); continue; }
+ "::" { printf("::"); continue; }
+ "." { printf("."); continue; }
+ ".*" { printf("."); continue; }
+ "+" { printf("+"); continue; }
+ "-" { printf("-"); continue; }
+ "*" { printf("*"); continue; }
+ "/" { printf("/"); continue; }
+ "%" { printf("%%"); continue; }
+ ("^" | "xor") { printf("^"); continue; }
+ ("&" | "bitand") { printf("&"); continue; }
+ ("|" | "bitor") { printf("|"); continue; }
+ ("~" | "compl") { printf("~"); continue; }
+ ("!" | "not") { printf("!"); continue; }
+ "=" { printf("="); continue; }
+ "<" { printf("<"); continue; }
+ ">" { printf(">"); continue; }
+ "+=" { printf("+="); continue; }
+ "-=" { printf("-="); continue; }
+ "*=" { printf("*="); continue; }
+ "/=" { printf("/="); continue; }
+ "%=" { printf("%%="); continue; }
+ ("^=" | "xor_eq") { printf("^="); continue; }
+ ("&=" | "and_eq") { printf("&="); continue; }
+ ("|=" | "or_eq") { printf("|="); continue; }
+ "<<" { printf("<<"); continue; }
+ ">>" { printf(">>"); continue; }
+ ">>=" { printf(">>="); continue; }
+ "<<=" { printf("<<="); continue; }
+ "==" { printf("=="); continue; }
+ ("!=" | "not_eq") { printf("!="); continue; }
+ "<=" { printf("<="); continue; }
+ ">=" { printf(">="); continue; }
+ ("&&" | "and") { printf("&&"); continue; }
+ ("||" | "or") { printf("||"); continue; }
+ "++" { printf("++"); continue; }
+ "--" { printf("--"); continue; }
+ "," { printf(","); continue; }
+ "->*" { printf("->*"); continue; }
+ "->" { printf("->"); continue; }
+
+ // identifiers
+ id = [a-zA-Z_][a-zA-Z_0-9]*;
+ id { printf("%.*s", in.cur - in.tok, in.tok); continue; }
+ */
+sfx:
+ /*!re2c
+ "" { if (u > INT_MAX) return false; printf("%d", static_cast<int>(u)); continue; }
+ 'u' { if (u > UINT_MAX) return false; printf("%u", static_cast<unsigned>(u)); continue; }
+ 'l' { if (u > LONG_MAX) return false; printf("%ld", static_cast<long>(u)); continue; }
+ 'ul' | 'lu' { printf("%lu", u); continue; }
+ */
+ }
+}
+
+int main(int argc, char **argv)
+{
+ if (argc != 2) {
+ printf ("usage: ./example <filename>\n");
+ return 1;
+ }
+
+ FILE *file = fopen(argv[1], "rb");
+ if (!file) {
+ printf("error: cannot open file: %s\n", argv[1]);
+ return 1;
+ }
+
+ input_t in(file);
+ if (!lex(in)) {
+ printf("... error\n");
+ } else {
+ printf("\n");
+ }
+
+ fclose(file);
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+
+/*!max:re2c*/
+
+static int lex(const char *YYCURSOR)
+{
+ const char *YYMARKER, *n, *p, *u, *g, *f, *h, *c;
+ /*!stags:re2c format = 'const char *@@;'; */
+loop:
+ /*!re2c
+ re2c:define:YYCTYPE = char;
+ re2c:yyfill:enable = 0;
+
+ end = "\x00";
+ eol = "\n";
+ sep = [:];
+ char = [^] \ (end | eol | sep);
+ user = char+;
+ pass = char*;
+ uid = [0-9]+;
+ gid = [0-9]+;
+ info = char*;
+ home = "/" char*;
+ cmd = "/" char*;
+
+ * { printf("error\n"); return 1; }
+ end { return 0; }
+
+ @n user sep
+ @p pass sep
+ @u uid sep
+ @g gid sep
+ @f info sep
+ @h home sep
+ @c cmd eol {
+ printf("user: %.*s\n", (int)(p - n) - 1, n);
+ printf("password: %.*s\n", (int)(u - p) - 1, p);
+ printf("UID: %.*s\n", (int)(g - u) - 1, u);
+ printf("GID: %.*s\n", (int)(f - g) - 1, g);
+ printf("info: %.*s\n", (int)(h - f) - 1, f);
+ printf("home: %.*s\n", (int)(c - h) - 1, h);
+ printf("command: %.*s\n", (int)(YYCURSOR - c - 1), c);
+ printf("\n");
+ goto loop;
+ }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc < 2) {
+ fprintf(stderr, "no input files\n");
+ return 1;
+ }
+
+ FILE *file = fopen(argv[1], "r");
+
+ fseek(file, 0, SEEK_END);
+ const size_t fsize = (size_t) ftell(file);
+ fseek(file, 0, SEEK_SET);
+
+ char *buffer = (char*) malloc(fsize + 1);
+
+ fread(buffer, 1, fsize, file);
+ buffer[fsize] = 0;
+
+ const int status = lex(buffer);
+
+ fclose(file);
+ free(buffer);
+
+ return status;
+}
--- /dev/null
+root:x:0:0:root:/root:/bin/bash
+bin:x:1:1:bin:/bin:/bin/false
+portage:x:250:250:portage:/var/tmp/portage:/bin/false
--- /dev/null
+http://user:pass@127.0.0.1:8000/path/data?key=val&key2=val2#frag1
+rsync://rsync.kernel.org/pub/
+http://re2c.org/manual/syntax/syntax.html#rules
+ssh://[2001:db8:85a3::8a2e:370:7334]/
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/*!max:re2c*/
+static const size_t SIZE = 4096;
+
+typedef struct {
+ FILE *file;
+ char *buf;
+ char *lim;
+ char *cur;
+ char *mar;
+ char *tok;
+ /*!stags:re2c format = "char *@@;\n"; */
+ int eof;
+} input_t;
+
+static void init_input(input_t *in, const char *fname)
+{
+ in->file = fopen(fname, "r");
+ in->buf = (char*) malloc(SIZE + YYMAXFILL);
+ in->lim = in->buf + SIZE;
+ in->cur = in->lim;
+ in->mar = in->lim;
+ in->tok = in->lim;
+ /*!stags:re2c format = "in->@@ = 0;\n"; */
+ in->eof = 0;
+}
+
+static void free_input(input_t *in)
+{
+ free(in->buf);
+ fclose(in->file);
+}
+
+static int fill(input_t *in, size_t need)
+{
+ size_t free;
+ if (in->eof) return 1;
+
+ free = in->tok - in->buf;
+ if (free < need) return 2;
+
+ memmove(in->buf, in->tok, in->lim - in->tok);
+ in->lim -= free;
+ in->cur -= free;
+ in->mar -= free;
+ in->tok -= free;
+ /*!stags:re2c format = "if (in->@@) in->@@ -= free;\n"; */
+ in->lim += fread(in->lim, 1, free, in->file);
+ if (in->lim < in->buf + SIZE) {
+ in->eof = 1;
+ memset(in->lim, 0, YYMAXFILL);
+ in->lim += YYMAXFILL;
+ }
+ return 0;
+}
+
+static int lex(input_t *in, long *count)
+{
+ const char
+ *s1, *u1, *h1, *h3, *h5, *r1, *p1, *p3, *q1, *f1,
+ *s2, *u2, *h2, *h4, *h6, *r2, *p2, *p4, *q2, *f2;
+ long c;
+
+ c = 0;
+loop:
+ in->tok = in->cur;
+/*!re2c
+
+ re2c:define:YYCTYPE = char;
+ re2c:define:YYCURSOR = in->cur;
+ re2c:define:YYMARKER = in->mar;
+ re2c:define:YYLIMIT = in->lim;
+ re2c:define:YYFILL = "if (fill(in, @@) != 0) return 2;";
+ re2c:define:YYFILL:naked = 1;
+ re2c:tags:expression = "in->@@";
+
+ end = "\x00";
+ eol = "\n";
+
+ alpha = [a-zA-Z];
+ digit = [0-9];
+ hexdigit = [0-9a-fA-F];
+ unreserved = alpha | digit | [-._~];
+ pct_encoded = "%" hexdigit{2};
+ sub_delims = [!$&'()*+,;=];
+ pchar = unreserved | pct_encoded | sub_delims | [:@];
+
+ scheme = @s1 alpha (alpha | digit | [-+.])* @s2;
+ userinfo = @u1 (unreserved | pct_encoded | sub_delims | ":")* @u2;
+ dec_octet
+ = digit
+ | [\x31-\x39] digit
+ | "1" digit{2}
+ | "2" [\x30-\x34] digit
+ | "25" [\x30-\x35];
+ ipv4address = dec_octet "." dec_octet "." dec_octet "." dec_octet;
+ h16 = hexdigit{1,4};
+ ls32 = h16 ":" h16 | ipv4address;
+ ipv6address
+ = (h16 ":"){6} ls32
+ | "::" (h16 ":"){5} ls32
+ | ( h16)? "::" (h16 ":"){4} ls32
+ | ((h16 ":"){0,1} h16)? "::" (h16 ":"){3} ls32
+ | ((h16 ":"){0,2} h16)? "::" (h16 ":"){2} ls32
+ | ((h16 ":"){0,3} h16)? "::" h16 ":" ls32
+ | ((h16 ":"){0,4} h16)? "::" ls32
+ | ((h16 ":"){0,5} h16)? "::" h16
+ | ((h16 ":"){0,6} h16)? "::";
+ ipvfuture = "v" hexdigit+ "." (unreserved | sub_delims | ":" )+;
+ ip_literal = "[" ( ipv6address | ipvfuture ) "]";
+ reg_name = (unreserved | pct_encoded | sub_delims)*;
+ host
+ = @h1 ip_literal @h2
+ | @h3 ipv4address @h4
+ | @h5 reg_name @h6;
+ port = @r1 digit* @r2;
+ authority = (userinfo "@")? host (":" port)?;
+ path_abempty = ("/" pchar*)*;
+ path_absolute = "/" (pchar+ ("/" pchar*)*)?;
+ path_rootless = pchar+ ("/" pchar*)*;
+ path_empty = "";
+ hier_part
+ = "//" authority @p1 path_abempty @p2
+ | @p3 (path_absolute | path_rootless | path_empty) @p4;
+ query = @q1 (pchar | [/?])* @q2;
+ fragment = @f1 (pchar | [/?])* @f2;
+ uri = scheme ":" hier_part ("?" query)? ("#" fragment)?;
+
+ * { return 1; }
+ end { *count = c; return 0; }
+ eol { goto loop; }
+ uri {
+ ++c;
+ printf("URI %ld:\n", c);
+ printf(" scheme: %.*s\n", (int)(s2 - s1), s1);
+ if (u1) printf(" userinfo: %.*s\n", (int)(u2 - u1), u1);
+ if (h1) printf(" host: %.*s (IP literal)\n", (int)(h2 - h1), h1);
+ if (h3) printf(" host: %.*s (IPv4)\n", (int)(h4 - h3), h3);
+ if (h5) printf(" host: %.*s (name)\n", (int)(h6 - h5), h5);
+ if (r1) printf(" port: %.*s\n", (int)(r2 - r1), r1);
+ if (p1) printf(" path: %.*s\n", (int)(p2 - p1), p1);
+ if (p3) printf(" path: %.*s\n", (int)(p4 - p3), p3);
+ if (q1) printf(" query: %.*s\n", (int)(q2 - q1), q1);
+ if (f1) printf(" fragment: %.*s\n", (int)(f2 - f1), f1);
+ printf("\n");
+ goto loop;
+ }
+*/
+}
+
+int main(int argc, char **argv)
+{
+ long count;
+ input_t in;
+ init_input(&in, argv[1]);
+
+ switch (lex(&in, &count)) {
+ case 0: fprintf(stderr, "ok, parsed %ld URIs\n", count); break;
+ case 1: fprintf(stderr, "syntax error\n"); break;
+ case 2: fprintf(stderr, "yyfill error\n"); break;
+ default: fprintf(stderr, "panic\n"); break;
+ }
+
+ free_input(&in);
+ return 0;
+}
--- /dev/null
+GET /index.html HTTP/1.1
+Host: www.example.com
+User-Agent: Mozilla/5.0
+Accept: text/xml,application/xml,application/xhtml+xml,text/html*/*
+Accept-Language: en-us
+Accept-Charset: ISO-8859-1,utf-8
+Connection: keep-alive
+
+HTTP/1.1 200 OK
+Date: Thu, 24 Jul 2008 17:36:27 GMT
+Server: Apache-Coyote/1.1
+Content-Type: text/html;charset=UTF-8
+Content-Length: 1846
+
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+typedef struct mtag_t {
+ struct mtag_t *pred;
+ long dist;
+} mtag_t;
+
+typedef struct mtagpool_t {
+ mtag_t *head;
+ mtag_t *next;
+ mtag_t *last;
+} mtagpool_t;
+
+typedef struct {
+ FILE *file;
+ char *buf;
+ char *lim;
+ char *cur;
+ char *mar;
+ char *tok;
+ /*!stags:re2c format = "char *@@;\n"; */
+ /*!mtags:re2c format = "mtag_t *@@;\n"; */
+ mtagpool_t mtp;
+ int eof;
+} input_t;
+
+static void mtagpool_clear(mtagpool_t *mtp, input_t *in)
+{
+ mtp->next = mtp->head;
+ /*!mtags:re2c format = "in->@@ = 0;\n"; */
+}
+
+static void mtagpool_init(mtagpool_t *mtp)
+{
+ static const unsigned size = 1024 * 1024;
+ mtp->head = (mtag_t*)malloc(size * sizeof(mtag_t));
+ mtp->next = mtp->head;
+ mtp->last = mtp->head + size;
+}
+
+static void mtagpool_free(mtagpool_t *mtp)
+{
+ free(mtp->head);
+ mtp->head = mtp->next = mtp->last = NULL;
+}
+
+static mtag_t *mtagpool_next(mtagpool_t *mtp)
+{
+ unsigned size;
+ mtag_t *head;
+
+ if (mtp->next < mtp->last) return mtp->next++;
+
+ size = mtp->last - mtp->head;
+ head = (mtag_t*)malloc(2 * size * sizeof(mtag_t));
+ memcpy(head, mtp->head, size * sizeof(mtag_t));
+ free(mtp->head);
+ mtp->head = head;
+ mtp->next = head + size;
+ mtp->last = head + size * 2;
+ return mtp->next++;
+}
+
+static void mtag(mtag_t **pmt, const char *b, const char *t, mtagpool_t *mtp)
+{
+ mtag_t *mt = mtagpool_next(mtp);
+ mt->pred = *pmt;
+ mt->dist = t - b;
+ *pmt = mt;
+}
+
+/*!max:re2c*/
+static const size_t SIZE = 4096;
+
+static void init_input(input_t *in, const char *fname)
+{
+ in->file = fopen(fname, "r");
+ in->buf = (char*) malloc(SIZE + YYMAXFILL);
+ in->lim = in->buf + SIZE;
+ in->cur = in->lim;
+ in->mar = in->lim;
+ in->tok = in->lim;
+ /*!stags:re2c format = "in->@@ = 0;\n"; */
+ /*!mtags:re2c format = "in->@@ = 0;\n"; */
+ mtagpool_init(&in->mtp);
+ in->eof = 0;
+}
+
+static void free_input(input_t *in)
+{
+ fclose(in->file);
+ free(in->buf);
+ mtagpool_free(&in->mtp);
+}
+
+static int fill(input_t *in, size_t need)
+{
+ size_t free;
+ if (in->eof) return 1;
+
+ free = in->tok - in->buf;
+ if (free < need) return 2;
+
+ memmove(in->buf, in->tok, in->lim - in->tok);
+ in->lim -= free;
+ in->cur -= free;
+ in->mar -= free;
+ in->tok -= free;
+ /*!stags:re2c format = "if (in->@@) in->@@ -= free;\n"; */
+ in->lim += fread(in->lim, 1, free, in->file);
+ if (in->lim < in->buf + SIZE) {
+ in->eof = 1;
+ memset(in->lim, 0, YYMAXFILL);
+ in->lim += YYMAXFILL;
+ }
+ return 0;
+}
+
+static void print_headers(const char *tok,
+ const mtag_t *h1, const mtag_t *h2,
+ const mtag_t *h3, const mtag_t *h4,
+ const mtag_t *h5)
+{
+ if (!h1) return;
+ print_headers(tok, h1->pred, h2->pred, h3->pred, h4->pred, h5->pred);
+ printf("%.*s%.*s%.*s%.*s\n",
+ (int)(h2->dist - h1->dist), tok + h1->dist,
+ (int)(h3->dist - h2->dist), tok + h2->dist,
+ (int)(h4->dist - h3->dist), tok + h3->dist,
+ (int)(h5->dist - h4->dist), tok + h4->dist);
+}
+
+#define YYCTYPE char
+#define YYCURSOR in->cur
+#define YYMARKER in->mar
+#define YYLIMIT in->lim
+#define YYMTAGP(mt) mtag(&mt, in->tok, in->cur, &in->mtp)
+#define YYMTAGN(mt) mtag(&mt, in->tok, NULL, &in->mtp)
+#define YYFILL(n) if (fill(in, n) != 0) return 2;
+
+static int lex(input_t *in, long *count)
+{
+ const char *of, *au, *at,
+ *hs1, *hs3, *m1, *p1, *p3, *p5, *q1, *q3,
+ *hs2, *hs4, *m2, *p2, *p4, *p6, *q2, *q4,
+ *r1, *r3, *rp1, *s1, *st1, *u1, *u3, *v1, *v3,
+ *r2, *r4, *rp2, *s2, *st2, *u2, *u4, *v2, *v4;
+ mtag_t *h1, *h2, *h3, *h4, *h5;
+ long c;
+
+ c = 0;;
+ of = au = at
+ = hs1 = hs3 = m1 = p1 = p3 = p5 = q1 = q3
+ = hs2 = hs4 = m2 = p2 = p4 = p6 = q2 = q4
+ = r1 = r3 = rp1 = s1 = st1 = u1 = u3 = v1 = v3
+ = r2 = r4 = rp2 = s2 = st2 = u2 = u4 = v2 = v4 = NULL;
+loop:
+ in->tok = in->cur;
+/*!re2c
+ re2c:tags:expression = "in->@@";
+
+ end = "\x00";
+ eol = "\n";
+
+ crlf = eol;
+ sp = " ";
+ htab = "\t";
+ ows = (sp | htab)*;
+ digit = [0-9];
+ alpha = [a-zA-Z];
+ hexdigit = [0-9a-fA-F];
+ unreserved = alpha | digit | [-._~];
+ pct_encoded = "%" hexdigit{2};
+ sub_delims = [!$&'()*+,;=];
+ pchar = unreserved | pct_encoded | sub_delims | [:@];
+ vchar = [\x1f-\x7e];
+ tchar = [-!#$%&'*+.^_`|~] | digit | alpha;
+
+ obs_fold = crlf (sp | htab)+;
+ obs_text = [\x80-\xff];
+ field_name = tchar+;
+ field_vchar = vchar | obs_text;
+ field_content = field_vchar ((sp | htab)+ field_vchar)?;
+ field_value = (field_content | obs_fold)*;
+ header_field = #h1 field_name #h2 ":" ows #h3 field_value #h4 ows #h5;
+ scheme = alpha (alpha | digit | [-+.])*;
+ userinfo = (unreserved | pct_encoded | sub_delims | ":")*;
+ dec_octet
+ = digit
+ | [\x31-\x39] digit
+ | "1" digit{2}
+ | "2" [\x30-\x34] digit
+ | "25" [\x30-\x35];
+ ipv4address = dec_octet "." dec_octet "." dec_octet "." dec_octet;
+ h16 = hexdigit{1,4};
+ ls32 = h16 ":" h16 | ipv4address;
+ ipv6address
+ = (h16 ":"){6} ls32
+ | "::" (h16 ":"){5} ls32
+ | ( h16)? "::" (h16 ":"){4} ls32
+ | ((h16 ":"){0,1} h16)? "::" (h16 ":"){3} ls32
+ | ((h16 ":"){0,2} h16)? "::" (h16 ":"){2} ls32
+ | ((h16 ":"){0,3} h16)? "::" h16 ":" ls32
+ | ((h16 ":"){0,4} h16)? "::" ls32
+ | ((h16 ":"){0,5} h16)? "::" h16
+ | ((h16 ":"){0,6} h16)? "::";
+ ipvfuture = "v" hexdigit+ "." (unreserved | sub_delims | ":" )+;
+ ip_literal = "[" ( ipv6address | ipvfuture ) "]";
+ reg_name = (unreserved | pct_encoded | sub_delims)*;
+ path_abempty = ("/" pchar*)*;
+ path_absolute = "/" (pchar+ ("/" pchar*)*)?;
+ path_rootless = pchar+ ("/" pchar*)*;
+ path_empty = "";
+ host = ip_literal | ipv4address | reg_name;
+ port = digit*;
+ query = (pchar | [/?])*;
+ absolute_uri = @s1 scheme @s2 ":"
+ ( "//" (@u1 userinfo @u2 "@")? @hs1 host @hs2 (":" @r1 port @r2)? @p1 path_abempty @p2
+ | @p3 (path_absolute | path_rootless | path_empty) @p4
+ ) ("?" @q1 query @q2)?;
+ authority = (@u3 userinfo @u4 "@")? @hs3 host @hs4 (":" @r3 port @r4)?;
+ origin_form = @p5 path_abempty @p6 ("?" @q3 query @q4)?;
+ http_name = "HTTP";
+ http_version = http_name "/" digit "." digit;
+ request_target
+ = @at authority
+ | @au absolute_uri
+ | @of origin_form
+ | "*";
+ method = tchar+;
+ request_line = @m1 method @m2 sp request_target sp @v3 http_version @v4 crlf;
+ status_code = digit{3};
+ reason_phrase = (htab | sp | vchar | obs_text)*;
+ status_line = @v1 http_version @v2 sp @st1 status_code @st2 sp @rp1 reason_phrase @rp2 crlf;
+ start_line = (request_line | status_line);
+ message_head = start_line (header_field crlf)* crlf;
+
+ * { return 1; }
+ end { *count = c; return 0; }
+ eol { goto loop; }
+ message_head {
+ ++c;
+ if (st1) {
+ printf("%.*s %.*s %.*s\n",
+ (int)(v2 - v1), v1,
+ (int)(st2 - st1), st1,
+ (int)(rp2 - rp1), rp1);
+ } else if (m1) {
+ printf("%.*s ", (int)(m2 - m1), m1);
+ if (of) {
+ printf("%.*s", (int)(p6 - p5), p5);
+ if (q3) printf("?%.*s", (int)(q4 - q3), q3);
+ } else if (au) {
+ printf("%.*s:", (int)(s2 - s1), s1);
+ if (p1) printf("//");
+ if (u1) printf("%.*s@", (int)(u2 - u1), u1);
+ printf("%.*s", (int)(hs2 - hs1), hs1);
+ if (r1) printf(":%.*s", (int)(r2 - r1), r1);
+ if (p1) printf("%.*s", (int)(p2 - p1), p1);
+ if (p3) printf("%.*s", (int)(p4 - p3), p3);
+ if (q1) printf("?%.*s", (int)(q2 - q1), q1);
+ } else if (at) {
+ if (u3) printf("%.*s@", (int)(u4 - u3), u3);
+ printf("%.*s", (int)(hs4 - hs3), hs3);
+ if (r3) printf(":%.*s", (int)(r4 - r3), r3);
+ } else {
+ printf("*");
+ }
+ printf(" %.*s\n", (int)(v4 - v3), v3);
+ }
+ print_headers(in->tok, h1, h2, h3, h4, h5);
+ printf("\n");
+ mtagpool_clear(&in->mtp, in);
+ goto loop;
+ }
+*/
+}
+
+int main(int argc, char **argv)
+{
+ long count;
+ input_t in;
+ init_input(&in, argv[1]);
+
+ switch (lex(&in, &count)) {
+ case 0: fprintf(stderr, "ok, parsed %ld HTTPs\n", count); break;
+ case 1: fprintf(stderr, "syntax error\n"); break;
+ case 2: fprintf(stderr, "yyfill error\n"); break;
+ default: fprintf(stderr, "panic!\n"); break;
+ }
+
+ free_input(&in);
+ return 0;
+}
--- /dev/null
+h4cker1970 {
+ name = Jon Smith
+ country = UK
+ channels = freenode/#gentoo-dev; freenode/#gentoo-arch; freenode/#alpha;
+}
+
+mitek {
+ name = Mitrofan Rygoravich
+ country = Belarus
+ channels = bynets/#haskell; freenode/#unix;
+}
+
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <vector>
+
+struct mtag_t
+{
+ int pred;
+ const char *tag;
+};
+
+typedef std::vector<mtag_t> mtagpool_t;
+
+static void mtag(int *pt, const char *t, mtagpool_t *tp)
+{
+ mtag_t l = {*pt, t};
+ *pt = (int) tp->size();
+ tp->push_back(l);
+}
+
+static void print_channels(const mtagpool_t &tp, int x, int y)
+{
+ if (x == -1) return;
+ print_channels(tp, tp[x].pred, tp[y].pred);
+ const char *px = tp[x].tag, *py = tp[y].tag;
+ printf(" %.*s\n", (int) (py - px), px);
+}
+
+#define YYMTAGP(t) mtag(&t, YYCURSOR, &tp)
+#define YYMTAGN(t) mtag(&t, NULL, &tp)
+
+static int lex(const char *YYCURSOR)
+{
+ const char *YYMARKER, *n1, *n2, *a1, *a2, *c1, *c2;
+ mtagpool_t tp;
+ int h1, h2;
+ /*!stags:re2c format = "const char *@@;"; */
+ /*!mtags:re2c format = "int @@;"; */
+loop:
+ tp.clear();
+ /*!mtags:re2c format = "@@ = -1;"; */
+ /*!re2c
+ re2c:define:YYCTYPE = char;
+ re2c:yyfill:enable = 0;
+
+ end = "\x00";
+ eol = "\n";
+ wsp = [ \t]*;
+ eq = wsp "=" wsp;
+ nick = [a-zA-Z0-9_]+;
+ name = [A-Z] ("." | [a-z]+);
+ names = name (wsp name)*;
+ country = [A-Za-z ]+;
+ channel = ([a-z0-9-]+ "/")? "#" [a-z0-9-]+;
+
+ * { printf("error: %s\n", YYCURSOR); return 1; }
+ end { return 0; }
+ wsp | eol { goto loop; }
+
+ @n1 nick @n2 wsp "{" wsp eol
+ wsp "name" eq @a1 names @a2 wsp eol
+ wsp "country" eq @c1 country @c2 wsp eol
+ wsp "channels" eq (wsp #h1 channel #h2 wsp ";")* wsp eol
+ wsp "}" {
+ printf("\n%.*s\n", (int) (n2 - n1), n1);
+ printf(" name: %.*s\n", (int) (a2 - a1), a1);
+ printf(" country: %.*s\n", (int) (c2 - c1), c1);
+ printf(" channels:\n");
+ print_channels(tp, h1, h2);
+ goto loop;
+ }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc < 2) {
+ fprintf(stderr, "no input files\n");
+ return 1;
+ }
+
+ FILE *file = fopen(argv[1], "r");
+
+ fseek(file, 0, SEEK_END);
+ const size_t fsize = (size_t) ftell(file);
+ fseek(file, 0, SEEK_SET);
+
+ char *buffer = (char*) malloc(fsize + 1);
+
+ fread(buffer, 1, fsize, file);
+ buffer[fsize] = 0;
+
+ const int status = lex(buffer);
+
+ fclose(file);
+ free(buffer);
+
+ return status;
+}
--- /dev/null
+#include <stdio.h>
+#include <string>
+#include <vector>
+
+typedef std::vector<std::pair<std::string, std::string> > unknown_t;
+
+struct options_t
+{
+ std::string date;
+ std::string path;
+ std::string format;
+ std::string limit;
+ bool verbose;
+};
+
+static void show(const options_t &o, const unknown_t &u)
+{
+ printf("\noptions:\n");
+ printf(" date: %s\n", o.date.c_str());
+ printf(" path: %s\n", o.path.c_str());
+ printf(" format: %s\n", o.format.c_str());
+ printf(" limit: %s\n", o.limit.c_str());
+ printf(" verbose: %s\n", o.verbose ? "yes" : "no");
+
+ printf("\nunknown:\n");
+ unknown_t::const_iterator i = u.begin(), e = u.end();
+ for (; i != e; ++i) {
+ printf(" %s: '%s'\n", i->first.c_str(), i->second.c_str());
+ }
+}
+
+static void bad_arg(const char *k, const char *v, const char *e)
+{
+ printf("bad argument '%.*s' to option %.*s\n",
+ (int) (e - v), v, (int) (v - k), k);
+}
+
+static int lex(const char *s)
+{
+ options_t o;
+ unknown_t u;
+ const char *m, *k, *v;
+ /*!stags:re2c format = 'const char *@@;'; */
+loop:
+ /*!re2c
+ re2c:define:YYCTYPE = char;
+ re2c:define:YYCURSOR = s;
+ re2c:define:YYMARKER = m;
+ re2c:yyfill:enable = 0;
+
+ end = "\x00";
+ sp = [ \t\n\r];
+ eq = "=";
+ wsp = sp*;
+ char = [^=] \ end;
+ ochar = char \ sp;
+ pchar = ochar \ [/];
+ str = ["] (char \ ["] | [\]["])* ["];
+ opt = ochar+;
+ arg = ochar* | str;
+ date = [0-9]{2} "/" [0-9]{2} "/" [0-9]{4};
+ path = pchar* ("/" pchar*)*;
+ format = str;
+ limit = [0-9]+ [BKMG]?;
+
+ * { printf("error: %s\n", s); return 1; }
+ end { show(o, u); return 0; }
+ wsp { goto loop; }
+
+ "-v" | "--verbose" { o.verbose = true; goto loop; }
+ ("-l" | "--limit" eq) @v limit { o.limit = std::string(v, s); goto loop; }
+ ("-f" | "--format" eq) @v str { o.format = std::string(v, s); goto loop; }
+ ("-d" | "--date" eq) @v date { o.date = std::string(v, s); goto loop; }
+ ("-p" | "--path" eq) @v path { o.path = std::string(v, s); goto loop; }
+
+ @k ("--" ("limit" | "format" | "date" | "path") | "-" [lfdp]) @v eq? arg {
+ bad_arg(k, v, s);
+ goto loop;
+ }
+ [-]{1,2} @k opt @v eq? arg {
+ u.push_back(std::make_pair(std::string(k, v), std::string(v, s)));
+ goto loop;
+ }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ for (int i = 1; i < argc; ++i) lex(argv[i]);
+ return 0;
+}
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+
+static void lex(const char *cur, const char *lim)
+{
+ const char *mar, *tok;
+# define YYCTYPE char
+# define YYPEEK() *cur
+# define YYSKIP() if (++cur == lim) return;
+# define YYBACKUP() mar = cur
+# define YYRESTORE() cur = mar
+loop:
+ tok = cur;
+ /*!re2c
+ re2c:yyfill:enable = 0;
+
+ * { goto loop; }
+ "__" [a-zA-Z0-9_]+ {
+ printf("%.*s\n", (int) (cur - tok), tok);
+ goto loop;
+ }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc < 2) {
+ fprintf(stderr, "no input files\n");
+ return 1;
+ }
+
+ FILE *file = fopen(argv[1], "rb");
+ if (file == NULL) {
+ fprintf(stderr, "cannot open file\n");
+ return 1;
+ }
+
+ fseek(file, 0, SEEK_END);
+ const size_t fsize = (size_t) ftell(file);
+ fseek(file, 0, SEEK_SET);
+
+ char *buffer = (char*) malloc(fsize);
+ fread(buffer, 1, fsize, file);
+ lex(buffer, buffer + fsize);
+
+ free(buffer);
+ fclose(file);
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+#include <string.h>
+
+static int lex(const char *cur, const char *lim)
+{
+ const char *mar, *tok = cur;
+# define YYCTYPE char
+# define YYPEEK() (cur < lim ? *cur : 0)
+# define YYSKIP() ++cur
+# define YYBACKUP() mar = cur
+# define YYRESTORE() cur = mar
+ /*!re2c
+ re2c:yyfill:enable = 0;
+
+ * { printf("error\n"); return 1; }
+ [0-9a-zA-Z]+ [;] [\x00] {
+ printf("%.*s\n", (int) (cur - tok) - 1, tok);
+ return 0;
+ }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc != 2) return 1;
+
+ char *s = argv[1];
+ size_t l = strlen(s);
+ s[l] = ';'; // overwrite terminating NULL
+ return lex(s, s + l + 1);
+}
--- /dev/null
+#include <fstream>
+
+static void conv(std::ifstream &in, std::ofstream &out)
+{
+ std::streampos mar;
+# define YYCTYPE char
+# define YYPEEK() in.peek()
+# define YYSKIP() do { in.ignore(); if (in.eof()) return; } while(0)
+# define YYBACKUP() mar = in.tellg()
+# define YYRESTORE() in.seekg(mar)
+loop:
+ /*!re2c
+ re2c:yyfill:enable = 0;
+
+ * { out.put(yych); goto loop; }
+ "\r\n" { out.put('\n'); goto loop; }
+ */
+}
+
+int main(int argc, char **argv)
+{
+ if (argc != 3) return 1;
+
+ std::ifstream in(argv[1], std::ios::binary);
+ std::ofstream out(argv[2], std::ios::binary);
+ if (in.fail() || out.fail()) return 2;
+
+ conv(in, out);
+ return 0;
+}
--- /dev/null
+/* Generated by re2c 0.15.2 on Wed Dec 2 08:46:58 2015 */
+
+#include <stdio.h>
+#include <stdlib.h> /* malloc, free */
+
+static void *read_file
+ ( const char *fname
+ , size_t unit
+ , size_t padding
+ , size_t *pfsize
+ )
+{
+ void *buffer = NULL;
+ size_t fsize = 0;
+
+ /* open file */
+ FILE *f = fopen(fname, "rb");
+ if(f == NULL) {
+ goto error;
+ }
+
+ /* get file size */
+ fseek(f, 0, SEEK_END);
+ fsize = (size_t) ftell(f) / unit;
+ fseek(f, 0, SEEK_SET);
+
+ /* allocate memory for file and padding */
+ buffer = malloc(unit * (fsize + padding));
+ if (buffer == NULL) {
+ goto error;
+ }
+
+ /* read the whole file in memory */
+ if (fread(buffer, unit, fsize, f) != fsize) {
+ goto error;
+ }
+
+ fclose(f);
+ *pfsize = fsize;
+ return buffer;
+
+error:
+ fprintf(stderr, "error: cannot read file '%s'\n", fname);
+ free(buffer);
+ if (f != NULL) {
+ fclose(f);
+ }
+ return NULL;
+}
+
+#define YYCTYPE unsigned char
+#define YYKEYTYPE unsigned char
+#define YYPEEK() *cursor
+#define YYSKIP() ++cursor
+#define YYLESSTHAN(n) (limit - cursor) < n
+#define YYFILL(n) { break; }
+
+static int action_line4
+ ( unsigned int i
+ , const YYKEYTYPE *keys
+ , const YYCTYPE *start
+ , const YYCTYPE *token
+ , const YYCTYPE **cursor
+ , YYKEYTYPE rule_act
+ )
+{
+ const long pos = token - start;
+ const long len_act = *cursor - token;
+ const long len_exp = (long) keys [3 * i + 1];
+ const YYKEYTYPE rule_exp = keys [3 * i + 2];
+ if (rule_exp == 255) {
+ fprintf
+ ( stderr
+ , "warning: lex_line4: control flow is undefined for input"
+ " at position %ld, rerun re2c with '-W'\n"
+ , pos
+ );
+ }
+ if (len_act == len_exp && rule_act == rule_exp) {
+ const YYKEYTYPE offset = keys[3 * i];
+ *cursor = token + offset;
+ return 0;
+ } else {
+ fprintf
+ ( stderr
+ , "error: lex_line4: at position %ld (iteration %u):\n"
+ "\texpected: match length %ld, rule %u\n"
+ "\tactual: match length %ld, rule %u\n"
+ , pos
+ , i
+ , len_exp
+ , rule_exp
+ , len_act
+ , rule_act
+ );
+ return 1;
+ }
+}
+
+int lex_line4()
+{
+ const size_t padding = 2; /* YYMAXFILL */
+ int status = 0;
+ size_t input_len = 0;
+ size_t keys_count = 0;
+ YYCTYPE *input = NULL;
+ YYKEYTYPE *keys = NULL;
+ const YYCTYPE *cursor = NULL;
+ const YYCTYPE *limit = NULL;
+ const YYCTYPE *token = NULL;
+ const YYCTYPE *eof = NULL;
+ unsigned int i = 0;
+
+ input = (YYCTYPE *) read_file
+ ("example.c.line4.input"
+ , sizeof (YYCTYPE)
+ , padding
+ , &input_len
+ );
+ if (input == NULL) {
+ status = 1;
+ goto end;
+ }
+
+ keys = (YYKEYTYPE *) read_file
+ ("example.c.line4.keys"
+ , 3 * sizeof (YYKEYTYPE)
+ , 0
+ , &keys_count
+ );
+ if (keys == NULL) {
+ status = 1;
+ goto end;
+ }
+
+ cursor = input;
+ limit = input + input_len + padding;
+ eof = input + input_len;
+
+ for (i = 0; status == 0 && i < keys_count; ++i) {
+ token = cursor;
+ YYCTYPE yych;
+
+ if (YYLESSTHAN (2)) YYFILL(2);
+ yych = YYPEEK ();
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f': goto yy4;
+ default: goto yy2;
+ }
+yy2:
+ YYSKIP ();
+yy3:
+ status = action_line4(i, keys, input, token, &cursor, 254);
+ continue;
+yy4:
+ YYSKIP ();
+ yych = YYPEEK ();
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ case 'A':
+ case 'B':
+ case 'C':
+ case 'D':
+ case 'E':
+ case 'F':
+ case 'a':
+ case 'b':
+ case 'c':
+ case 'd':
+ case 'e':
+ case 'f': goto yy5;
+ default: goto yy3;
+ }
+yy5:
+ YYSKIP ();
+ status = action_line4(i, keys, input, token, &cursor, 0);
+ continue;
+
+ }
+ if (status == 0) {
+ if (cursor != eof) {
+ status = 1;
+ const long pos = token - input;
+ fprintf(stderr, "error: lex_line4: unused input strings left at position %ld\n", pos);
+ }
+ if (i != keys_count) {
+ status = 1;
+ fprintf(stderr, "error: lex_line4: unused keys left after %u iterations\n", i);
+ }
+ }
+
+end:
+ free(input);
+ free(keys);
+
+ return status;
+}
+
+#undef YYCTYPE
+#undef YYKEYTYPE
+#undef YYPEEK
+#undef YYSKIP
+#undef YYLESSTHAN
+#undef YYFILL
+
+int main()
+{
+ if(lex_line4() != 0) {
+ return 1;
+ }
+ return 0;
+}
--- /dev/null
+/*!re2c
+ * {}
+ [0-9a-fA-F]{2} {}
+*/
--- /dev/null
+#include <stdio.h>
+
+#ifdef REVERSED_CONDITION_ORDER
+# define yyca 1
+# define yycb 0
+#else
+# define yyca 0
+# define yycb 1
+#endif
+
+int main()
+{
+ const char * YYCURSOR = "aaaa,bbb!";
+ int c = yyca;
+ for (;;) {
+ /*!re2c
+ re2c:define:YYCTYPE = char;
+ re2c:yyfill:enable = 0;
+ re2c:define:YYSETCONDITION = "c = @@;";
+ re2c:define:YYSETCONDITION:naked = 1;
+ re2c:define:YYGETCONDITION = c;
+ re2c:define:YYGETCONDITION:naked = 1;
+
+ <*> * { printf ("error\n"); break; }
+
+ <a> "a" { printf ("a"); continue; }
+ <a> "," => b { printf (","); continue; }
+
+ <b> "!" { printf ("!\n"); break; }
+ <b> "b" { printf ("b"); continue; }
+ */
+ }
+ return 0;
+}
--- /dev/null
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+ for (int i = 1; i < argc; ++i) {
+ for (char *YYCURSOR = argv[i];;) {
+ /*!re2c
+ re2c:define:YYCTYPE = char;
+ re2c:yyfill:enable = 0;
+ "\x00" { break; }
+ [a-z]* { continue; }
+ */
+ }
+ printf("argv[%d]: %s\n", i, argv[i]);
+ }
+ return 0;
+}
--- /dev/null
+ // re2c block with configuration that turns off #line directives
+ //
+#include <stdio.h> // C/C++ code
+ //
+#define YYMAXFILL 1 // directive that defines YYMAXFILL (unused)
+ // end of re2c block
+ //
+static int lex(const char *YYCURSOR) // YYCURSOR is defined as a function parameter
+{ //
+ const char *YYMARKER; // YYMARKER is defined as a local variable
+
+{
+ char yych;
+ yych = *YYCURSOR;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy4;
+ default: goto yy2;
+ }
+yy2:
+ ++YYCURSOR;
+ { return 1; }
+yy4:
+ yych = *++YYCURSOR;
+ switch (yych) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy4;
+ default: goto yy6;
+ }
+yy6:
+ { // a normal rule with its semantic action
+ printf("number\n"); // ... semantic action (continued)
+ return 0; // ... semantic action (continued)
+ }
+}
+ // end of re2c block
+} //
+ //
+int main() //
+{ //
+ lex("1024"); // C/C++ code
+ lex(";]"); //
+ return 0; //
+} //
--- /dev/null
+/*!re2c re2c:flags:i = 1; */ // re2c block with configuration that turns off #line directives
+ //
+#include <stdio.h> // C/C++ code
+ //
+/*!max:re2c*/ // directive that defines YYMAXFILL (unused)
+/*!re2c // start of re2c block
+ digit = [0-9]; // named definition of 'digit'
+ number = digit+; // named definition of 'number'
+*/ // end of re2c block
+ //
+static int lex(const char *YYCURSOR) // YYCURSOR is defined as a function parameter
+{ //
+ const char *YYMARKER; // YYMARKER is defined as a local variable
+ /*!re2c // start of re2c block
+ re2c:define:YYCTYPE = char; // configuration that defines YYCTYPE
+ re2c:yyfill:enable = 0; // configuration that turns off YYFILL
+ //
+ * { return 1; } // default rule with its semantic action
+ //
+ number { // a normal rule with its semantic action
+ printf("number\n"); // ... semantic action (continued)
+ return 0; // ... semantic action (continued)
+ } // end of semantic action
+ //
+ */ // end of re2c block
+} //
+ //
+int main() //
+{ //
+ lex("1024"); // C/C++ code
+ lex(";]"); //
+ return 0; //
+} //
--- /dev/null
+Multiple blocks
+---------------
+
+This example demonstrates the use of multiple interrelated ``/*!re2c ... */`` blocks.
+We pick a deliberately simple task (parsing integers),
+so that all complexity is associated with relations between blocks and not with the lexical grammar.
+
+:download:`[multiple_blocks.re] <04_parsing_integers_blocks.i.re>`
+
+.. literalinclude:: 04_parsing_integers_blocks.i.re
+ :language: cpp
+ :linenos:
+
+Notes:
+
+* Configurations and definitions (lines 20 - 26) are not scoped to a single re2c block — they are global.
+ Each block may override configurations, but this affects the global scope.
+* Blocks don't have to be in the same function: they can be in separate functions or elsewhere
+ as long as the exposed interface fits into the lexical scope.
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c -o multiple_blocks.cc multiple_blocks.re
+ $ g++ -o multiple_blocks multiple_blocks.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./multiple_blocks 0 12345678901234567890 0xFFFFffffFFFFffff 0x1FFFFffffFFFFffff 0xAbcDEf 0x00 007 0B0 0b110101010 ""
+ 0
+ 12345678901234567890
+ 18446744073709551615
+ error
+ 11259375
+ 0
+ 7
+ 0
+ 426
+ error
+
+
--- /dev/null
+Conditions
+----------
+
+This example demonstrates the use of conditions.
+It is similar in functionality to the `Multiple blocks <example_04.html>`_ example,
+except that individual sub-lexers are connected usding conditions rather than multiple blocks.
+Conditions allow to encode multiple interconnected lexers within a single re2c block.
+
+:download:`[conditions.re] <05_parsing_integers_conditions.ci.re>`
+
+.. literalinclude:: 05_parsing_integers_conditions.ci.re
+ :language: cpp
+ :linenos:
+
+Notes:
+
+* Conditions are enabled with the ``-c`` option.
+
+* Conditions are only syntactic sugar; they can be translated into multiple blocks.
+
+* Each condition is a standalone lexer (DFA).
+
+* Each condition has a unique identifier: ``/*!types:re2c*/`` tells re2c to generate
+ an enumeration of all the identifiers (the names are prefixed with ``yyc`` by default).
+ The lexer uses ``YYGETCONDITION`` to get the identifier of the current condition
+ and ``YYSETCONDITION`` to set it.
+
+* Each condition has a unique label (prefixed with ``yyc_`` by default).
+
+* Conditions are connected: transitions are allowed between the final states of one condition
+ and the start state of another condition (but not between inner states of different conditions).
+ The generated code starts with dispatch.
+ Actions can either jump to the initial dispatch or jump directly to a condition.
+
+* The ``<*>`` rule is merged to all conditions (low priority).
+
+* Rules with multiple conditions are merged to each listed condition (normal priority).
+
+* ``:=>`` jumps directly to the next condition (bypassing the initial dispatch).
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c -c -o conditions.cc conditions.re
+ $ g++ -o conditions conditions.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./conditions 0 12345678901234567890 0xFFFFffffFFFFffff 0x1FFFFffffFFFFffff 0xAbcDEf 0x00 007 0B0 0b110101010 ""
+ 0
+ 12345678901234567890
+ 18446744073709551615
+ error
+ 11259375
+ 0
+ 7
+ 0
+ 426
+ error
+
+
--- /dev/null
+Braille patterns
+----------------
+
+This example is about encoding support in re2c.
+It's a partial decoder from Grade-1 (uncontracted) Unicode English Braille to plain English.
+The input may be encoded in UTF-8, UTF-16, UTF-32, or UCS-2:
+all of these encodings are capable of representing Braille patterns (code points ``[0x2800 - 0x28ff]``).
+We use the ``-r`` option to reuse the same block of re2c rules with different encodings.
+
+So. The hardest part is to get some input.
+Here is a message out of the void:
+
+.. include:: 06_braille.utf8.txt
+
+It appears to be UTF-8 encoded :download:`[braille.utf8.txt] <06_braille.utf8.txt>`.
+Let's convert it into UTF-16, UTF-32, and UCS-2:
+
+.. code-block:: bash
+
+ $ iconv -f utf8 -t utf16le 06_braille.utf8.txt > 06_braille.utf16.txt
+ $ iconv -f utf8 -t utf32le 06_braille.utf8.txt > 06_braille.utf32.txt
+ $ iconv -f utf8 -t ucs2 06_braille.utf8.txt > 06_braille.ucs2.txt
+
+And the input is ready.
+
+Grade-1 Braille is quite simple (compared to Grade-2 Braille).
+Patterns map directly to symbols (letters, digits, and punctuators) except for a couple of special patterns:
+the numeric mode indicator (⠼), the letter mode indicator (⠰), the capital letter indicator (⠠)
+and some others, which we omit here for the sake of simplicity (as well as a few ambiguous punctuation patterns).
+Grade-2 Braille allows contractions; those obey some rather complex rules (like those of a natural language)
+and are much harder to implement.
+
+:download:`[braille.re] <06_braille.cr8i.re>`
+
+.. literalinclude:: 06_braille.cr8i.re
+ :language: cpp
+ :linenos:
+
+Notes:
+
+* The reuse mode is enabled with the ``-r`` option.
+* In the reuse mode, re2c expects a single ``/*!rules:re2c ... */`` block
+ followed by multiple ``/*!use:re2c ... */`` blocks.
+ All blocks can have their own configurations, definitions, and rules.
+* Encoding can be enabled either with a command-line option or a configuration.
+* Each encoding needs the appropriate code unit type (``YYCTYPE``).
+* We use conditions to switch between numeric and normal modes.
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c -cr8 -o braille.cc braille.re
+ $ g++ -o braille braille.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./braille
+ utf8:
+ All human beings are born free and equal in dignity and rights.
+ They are endowed with reason and conscience and should act towards
+ one another in a spirit of brotherhood.
+
+ utf16:
+ All human beings are born free and equal in dignity and rights.
+ They are endowed with reason and conscience and should act towards
+ one another in a spirit of brotherhood.
+
+ utf32:
+ All human beings are born free and equal in dignity and rights.
+ They are endowed with reason and conscience and should act towards
+ one another in a spirit of brotherhood.
+
+ ucs2:
+ All human beings are born free and equal in dignity and rights.
+ They are endowed with reason and conscience and should act towards
+ one another in a spirit of brotherhood.
+
+
--- /dev/null
+C++98 lexer
+-----------
+
+This is an example of a big, real-world re2c program: a C++98 lexer.
+It conforms to the C++98 standard (except for a couple of hacks that simulate the preprocessor).
+All nontrivial lexemes (integers, floating-point constants, strings, and character literals)
+are parsed (not only recognized): numeric literals are converted to numbers, and strings are unescaped.
+Some additional checks described in the standard (e.g., overflows in integer literals) are also done.
+In fact, C++ is an easy language to lex: unlike in many other languages, the C++98 lexer can proceed without feedback from the parser.
+
+:download:`[cxx98.re] <07_cxx98.i.re>`
+
+.. literalinclude:: 07_cxx98.i.re
+ :language: cpp
+ :linenos:
+
+Notes:
+
+* The main lexer is used to lex all trivial lexemes (macros, whitespace, boolean literals, keywords, operators, punctuators, and identifiers),
+ recognize numeric literals (which are further parsed by a bunch of auxiliary lexers),
+ and recognize the start of a string and character literals (which are further recognized and parsed by an auxiliary lexer).
+ Numeric literals are thus lexed twice: this approach may be deemed inefficient,
+ but it takes much more effort to validate and parse them in one go.
+ Besides, a real-world lexer would rather recognize ill-formed lexemes (e.g., overflown integer literals),
+ report them, and resume lexing.
+
+* We don't use re2c in cases where a hand-written parser looks simpler: when parsing octal and decimal literals
+ (though a re2c-based parser would do exactly the same, without the slightest overhead).
+ However, hexadecimal literals still require some lexing, which looks better with re2c.
+ Again, it's only a matter of taste: a re2c-based implementation adds no overhead.
+ Look at the generated code to make sure.
+
+* The main lexer and string lexer both use ``re2c:yyfill:enable = 1;``, other lexers use ``re2c:yyfill:enable = 0;``.
+ This is very important: both the main lexer and string lexer advance input position to new (yet unseen) input characters,
+ so they must check for the end of input and call ``YYFILL``. In contrast, other lexers only parse lexemes that
+ have already been recognized by the main lexer: these lexemes are guaranteed to be within buffer bounds
+ (they are guarded by ``in.tok`` on the left and ``in.lim`` on the right).
+
+* The hardest part is (unsurprisingly) floating-point literals.
+ They are just as hard to lex as they are to use. ``:)``
+
+Generate, compile, and run:
+
+.. code-block:: bash
+
+ $ re2c -o cxx98.cc cxx98.re
+ $ g++ -o cxx98 cxx98.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./cxx98 07_cxx98.re | fold
+ STATIC CONST size_t SIZE = 64 * 1024; STRUCT input_t { UNSIGNED CHAR buf[SIZE +
+ YYMAXFILL]; UNSIGNED CHAR *lim; UNSIGNED CHAR *cur; UNSIGNED CHAR *mar; UNSIGNE
+ D CHAR *tok; BOOL eof; FILE *CONST file; input_t(FILE *f) : buf() , lim(buf + SI
+ ZE) , cur(lim) , mar(lim) , tok(lim) , eof(false) , file(f) {} BOOL fill(size_t
+ need) { IF (eof) { RETURN false; } CONST size_t free = tok - buf; IF (free < nee
+ d) { RETURN false; } memmove(buf, tok, lim - tok); lim -= free; cur -= free; mar
+ -= free; tok -= free; lim += fread(lim, 1, free, file); IF (lim < buf + SIZE) {
+ eof = true; memset(lim, 0, YYMAXFILL); lim += YYMAXFILL; } RETURN true; } }; TE
+ MPLATE<INT base> STATIC BOOL adddgt(UNSIGNED LONG &u, UNSIGNED LONG d) { IF (u >
+ (ULONG_MAX - d) / base) { RETURN false; } u = u * base + d; RETURN true; } STAT
+ IC BOOL lex_oct(CONST UNSIGNED CHAR *s, CONST UNSIGNED CHAR *e, UNSIGNED LONG &u
+ ) { FOR (u = 0, ++s; s < e; ++s) { IF (!adddgt<8>(u, *s - 48)) { RETURN false; }
+ } RETURN true; } STATIC BOOL lex_dec(CONST UNSIGNED CHAR *s, CONST UNSIGNED CHA
+ R *e, UNSIGNED LONG &u) { FOR (u = 0; s < e; ++s) { IF (!adddgt<10>(u, *s - 48))
+ { RETURN false; } } RETURN true; } STATIC BOOL lex_hex(CONST UNSIGNED CHAR *s,
+ CONST UNSIGNED CHAR *e, UNSIGNED LONG &u) { FOR (u = 0, s += 2; s < e;) { } RETU
+ RN true; } STATIC BOOL lex_str(input_t &in, UNSIGNED CHAR q) { printf("\x25\x63"
+ , q); FOR (UNSIGNED LONG u = q;; printf("\x5c\x78\x25\x6c\x78", u)) { in.tok = i
+ n.cur; } printf("\x25\x63", q); RETURN true; } STATIC BOOL lex_flt(CONST UNSIGNE
+ D CHAR *s) { DOUBLE d = 0; DOUBLE x = 1; INT e = 0; mant_int: mant_frac: exp_sig
+ n: exp: sfx: end: printf("\x25\x67", d); RETURN true; } STATIC BOOL lex(input_t
+ &in) { UNSIGNED LONG u; FOR (;;) { in.tok = in.cur; sfx: } } INT main(INT argc,
+ CHAR **argv) { IF (argc != 2) { printf ("\x75\x73\x61\x67\x65\x3a\x20\x2e\x2f\x6
+ 5\x78\x61\x6d\x70\x6c\x65\x20\x3c\x66\x69\x6c\x65\x6e\x61\x6d\x65\x3e\xa"); RETU
+ RN 1; } FILE *file = fopen(argv[1], "\x72\x62"); IF (!file) { printf("\x65\x72\x
+ 72\x6f\x72\x3a\x20\x63\x61\x6e\x6e\x6f\x74\x20\x6f\x70\x65\x6e\x20\x66\x69\x6c\x
+ 65\x3a\x20\x25\x73\xa", argv[1]); RETURN 1; } input_t in(file); IF (!lex(in)) {
+ printf("\x2e\x2e\x2e\x20\x65\x72\x72\x6f\x72\xa"); } ELSE { printf("\xa"); } fcl
+ ose(file); RETURN 0; }
+
+
--- /dev/null
+/etc/passwd
+-----------
+
+This example shows how to parse simple file formats such as the ``/etc/passwd`` file.
+This file consists of multiple lines of the form ``user`` ``:`` ``password`` ``:`` ``UID`` ``:`` ``GID`` ``:`` ``info`` ``:`` ``home`` ``:`` ``command``.
+Our example file is the following :download:`[/etc/passwd] <09_etc_passwd.txt>`:
+
+.. literalinclude:: 09_etc_passwd.txt
+
+:download:`[etc_passwd.re] <09_etc_passwd.i--tags.re>`
+
+.. literalinclude:: 09_etc_passwd.i--tags.re
+ :language: cpp
+ :linenos:
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --tags -o etc_passwd.cc etc_passwd.re
+ $ g++ -o etc_passwd etc_passwd.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./etc_passwd /etc/passwd
+ user: root
+ password: x
+ UID: 0
+ GID: 0
+ info: root
+ home: /root
+ command: /bin/bash
+
+ user: bin
+ password: x
+ UID: 1
+ GID: 1
+ info: bin
+ home: /bin
+ command: /bin/false
+
+ user: portage
+ password: x
+ UID: 250
+ GID: 250
+ info: portage
+ home: /var/tmp/portage
+ command: /bin/false
+
+
+
--- /dev/null
+URI (RFC-3986)
+--------------
+
+This example was used as a benchmark in
+`"Tagged Deterministic Finite Automata with Lookahead" <../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf>`_ paper;
+it is an RFC-3986 compliant URI parser.
+It uses s-tags.
+
+:download:`[uri_rfc3986.re] <10_uri_rfc3986.i--tags.re>`
+
+.. literalinclude:: 10_uri_rfc3986.i--tags.re
+ :language: cpp
+ :linenos:
+
+:download:`[uri.dat] <10_uri.dat.txt>`
+
+.. literalinclude:: 10_uri.dat.txt
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --tags -o uri_rfc3986.cc uri_rfc3986.re
+ $ g++ -o uri_rfc3986 uri_rfc3986.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./uri_rfc3986 uri.dat
+ URI 1:
+ scheme: http
+ userinfo: user:pass
+ host: 127.0.0.1 (IPv4)
+ port: 8000
+ path: /path/data
+ query: key=val&key2=val2
+ fragment: frag1
+
+ URI 2:
+ scheme: rsync
+ host: rsync.kernel.org (name)
+ path: /pub/
+
+ URI 3:
+ scheme: http
+ host: re2c.org (name)
+ path: /manual/syntax/syntax.html
+ fragment: rules
+
+ URI 4:
+ scheme: ssh
+ host: [2001:db8:85a3::8a2e:370:7334] (IP literal)
+ path: /
+
+ ok, parsed 4 URIs
+
+
--- /dev/null
+HTTP (RFC-7230)
+---------------
+
+This example was used as a benchmark in
+`"Tagged Deterministic Finite Automata with Lookahead" <../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf>`_ paper;
+it is an RFC-7230 compliant HTTP message parser.
+It uses both s-tags and m-tags.
+
+:download:`[http_rfc7230.re] <11_http_rfc7230.i--tags.re>`
+
+.. literalinclude:: 11_http_rfc7230.i--tags.re
+ :language: cpp
+ :linenos:
+
+:download:`[http.dat] <11_http.dat.txt>`
+
+.. literalinclude:: 11_http.dat.txt
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --tags -o http_rfc7230.cc http_rfc7230.re
+ $ g++ -o http_rfc7230 http_rfc7230.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./http_rfc7230 http.dat
+ GET /index.html HTTP/1.1
+ Host: www.example.com
+ User-Agent: Mozilla/5.0
+ Accept: text/xml,application/xml,application/xhtml+xml,text/html*/*
+ Accept-Language: en-us
+ Accept-Charset: ISO-8859-1,utf-8
+ Connection: keep-alive
+
+ HTTP/1.1 200 OK
+ Date: Thu, 24 Jul 2008 17:36:27 GMT
+ Server: Apache-Coyote/1.1
+ Content-Type: text/html;charset=UTF-8
+ Content-Length: 1846
+
+ ok, parsed 2 HTTPs
+
+
--- /dev/null
+Records & structs
+-----------------
+
+This example shows how to parse simple non-recursive structures and records.
+It uses both s-tags (for simple fields) and m-tags (for fields that contain multiple elements).
+Our imaginary records describe IRC users.
+Each record consists of a nickname followed by an opening curly brace, a list of attributes (one per line), and a closing curly brace.
+Attributes are name, country and a list of IRC channels.
+Below is an example:
+
+:download:`[records.dat] <13_records.dat.txt>`
+
+.. literalinclude:: 13_records.dat.txt
+
+:download:`[records.re] <13_records.i--tags.re>`
+
+.. literalinclude:: 13_records.i--tags.re
+ :language: cpp
+ :linenos:
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --tags -o records.cc records.re
+ $ g++ -o records records.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./records records.dat
+
+ h4cker1970
+ name: Jon Smith
+ country: UK
+ channels:
+ freenode/#gentoo-dev
+ freenode/#gentoo-arch
+ freenode/#alpha
+
+ mitek
+ name: Mitrofan Rygoravich
+ country: Belarus
+ channels:
+ bynets/#haskell
+ freenode/#unix
+
--- /dev/null
+Options & arguments
+-------------------
+
+This example shows how to parse command-line options
+with possible arguments, where each individual option may need its own argument format.
+Our parser handles errors and typos:
+for known options it reports ill-formed arguments;
+for unrecognized options it collects them and reports at the end of parsing.
+Our imaginary options are summarized below:
+
+* ``-v``, ``--verbose``
+
+* ``-l LIMIT``, ``--limit=LIMIT``, where ``LIMIT`` is a decimal number followed by one of the suffixes ``B``, ``K``, ``M`` or ``G``
+
+* ``-d DATE``, ``--date=DATE``, where ``DATE`` has the form ``DD/MM/YYYY``
+
+* ``-p PATH``, ``--path=PATH``, where ``PATH`` is a ``/``-separated file path
+
+* ``-f FORMAT``, ``--format=FORMAT``, where ``FORMAT`` is a double-quoted format string
+
+:download:`[options.re] <14_options.i--tags.re>`
+
+.. literalinclude:: 14_options.i--tags.re
+ :language: cpp
+ :linenos:
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --tags -o options.cc options.re
+ $ g++ -o options options.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./options '-v --limit=8K -d08/08/1985 -p/usr/src/linux --format="%s" --limit -f=3 --verbos --d"19th May"'
+ bad argument '' to option --limit
+ bad argument '=3' to option -f
+
+ options:
+ date: 08/08/1985
+ path: /usr/src/linux
+ format: "%s"
+ limit: 8K
+ verbose: yes
+
+ unknown:
+ verbos: ''
+ d: '"19th May"'
+
--- /dev/null
+Strings in binaries
+-------------------
+
+The program below searches all strings starting with double underscore in the given binary file.
+The same method can be used to search for arbitrary signatures or keywords.
+Since we are dealing with a *binary* file, we cannot use the sentinel method to check for the end of input:
+binary files can contain all kinds of characters, so no sentinel can be chosen.
+The usual way in such cases is to use ``YYLIMIT``-based checking: it requires padding input with ``YYMAXFILL`` fake characters,
+but it's not a problem since the input is buffered anyway.
+
+However, this exampe takes another approach:
+it uses generic API to override the default checking mechanism.
+First, it disables the usual mechanism: suppresses the generation of ``YYLESSTHAN`` and ``YYFILL`` with ``re2c:yyfill:enable = 0;`` configuration.
+Second, it redefines ``YYSKIP`` to perform checking before advancing to the next input character.
+In principle, this approach is less efficient:
+checking happens more frequently, as ``YYSKIP`` is invoked on each input character,
+while ``YYLESSTHAN`` happens only once per each strongly connected component of automaton.
+However, it allows to avoid padding.
+
+:download:`[binsyms.re] <15_binsyms.i--input(custom).re>`
+
+.. literalinclude:: 15_binsyms.i--input(custom).re
+ :language: cpp
+ :linenos:
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --input custom -o binsyms.cc binsyms.re
+ $ g++ -o binsyms binsyms.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./binsyms binsyms
+ __gmon_start__
+ __libc_start_main
+ __off_t
+ __cxx11
+ __gnu_cxx3divExx
+ __off64_t
+ __pad1
+ __pad2
+ __pad3
+ __pad4
+ __pad5
+ __compar_fn_t
+ __gnu_cxx
+ __init_array_start
+ __libc_csu_fini
+ __libc_csu_init
+ __init_array_end
+ __GNU_EH_FRAME_HDR
+ __init_array_end
+ __init_array_start
+ __libc_csu_fini
+ __gmon_start__
+ __libc_start_main
+ __data_start
+ __TMC_END__
+ __dso_handle
+ __libc_csu_init
+ __bss_start
+
+
--- /dev/null
+Fake sentinel
+-------------
+
+This example explores the case when we know the *length* of input,
+but there is no terminating character and buffering is not possible.
+In such cases we cannot use the usual sentinel method; and we cannot use ``YYLIMIT``-based method as it requires ``YYMAXFILL`` padding.
+The choiche then is to use generic API:
+disable the default cheching mechanism with ``re2c:yyfill:enable = 0;``
+and use one of the primitives ``YYPEEK`` and ``YYSKIP`` to check for the end of input.
+
+In this example we use ``YYPEEK`` to emulate *fake sentinel*:
+every time the lexer peeks a new character, it first checks for the end of input:
+if it has already been reached, ``YYPEEK`` returns ``NULL`` (though the actual string has no terminating ``NULL``).
+Checking on every ``YYPEEK`` is less efficient than the usual sentinel method
+(which performs no checking at all), but it can be more efficient than copying input to buffer and padding it with a real sentinel character.
+
+Note that fake sentinel method also relies on the fact that sentinel cannot appear in the middle of well-formed input.
+If the input can contain arbitrary characters, then one should utilize ``YYSKIP`` as shown in `this example <example_15.html>`_.
+
+:download:`[fake_sentinel.re] <16_fake_sentinel.i--input(custom).re>`
+
+.. literalinclude:: 16_fake_sentinel.i--input(custom).re
+ :language: cpp
+ :linenos:
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --input custom -o fake_sentinel.cc fake_sentinel.re
+ $ g++ -o fake_sentinel fake_sentinel.cc
+
+Run:
+
+.. code-block:: bash
+
+ $ ./fake_sentinel somestring
+ somestring;
--- /dev/null
+std::ifstream
+-------------
+
+This example shows how to override re2c input mechanism:
+instead of reading input characters from a buffer in memory, read them directly from file using STL ``std::ifstream`` class.
+Note that we use ``tellg`` / ``seekg`` and rely on the ability to move backward and forward in the input stream:
+this might not be possible, for example with ``stdin`` stream.
+The program below converts Windows-style line endings ``CR LF`` to Unix-style line endings ``LF``.
+
+This program uses a non-standard way of checking for the end of input:
+it disables the usual cheching mechnism with ``re2c:yyfill:enable = 0;``
+(this suppresses the generation of ``YYLESSTHAN`` and ``YYFILL``)
+and puts the responsibility for checking on ``YYSKIP``.
+This results in more frequent checks: ``YYSKIP`` is happens on each input character,
+while ``YYLESSTHAN`` happens only once per each strongly connected component of automaton.
+However, this method allows to avoid padding, which would require buffering input and nullify all advantages of direct-file input.
+
+
+
+:download:`[ifstream.re] <17_ifstream.i--input(custom).re>`
+
+.. literalinclude:: 17_ifstream.i--input(custom).re
+ :language: cpp
+ :linenos:
+
+Compile:
+
+.. code-block:: bash
+
+ $ re2c --input custom -o ifstream.cc ifstream.re
+ $ g++ -o ifstream ifstream.cc
+
--- /dev/null
+
+.. toctree::
+ :maxdepth: 1
+
+ Parsing integers with multiple interrelated blocks </examples/example_04>
+ Parsing integers with start conditions </examples/example_05>
+ Parsing /etc/passwd with tags </examples/example_09>
+ Parsing options and arguments with tags </examples/example_14>
+ Parsing records and structs with tags </examples/example_13>
+ C++98 lexer </examples/example_07>
+ Parsing URI (RFC-3986) </examples/example_10>
+ Parsing HTTP message headers (RFC-7230) </examples/example_11>
+ Parsing Braille patterns with multiple encodings </examples/example_06>
+ Finding strings in binaries with generic API </examples/example_15>
+ Faking sentinel characted with generic API </examples/example_16>
+ Reading from std::ifstream with generic API </examples/example_17>
+
+All examples are written in C-90 and in C++98, so they should be portable.
+Feel free to `report bugs <re2c-general@lists.sourceforge.net>`_.
+
--- /dev/null
+====
+re2c
+====
+
+.. toctree::
+ :hidden:
+
+ User manual </manual/manual>
+ Build instructions </install/install>
+ Release notes </releases/release_notes>
+ Changelog </releases/changelog/changelog>
+
+Re2c is a free and open-source lexer generator for C and C++.
+The main goal of the project is to generate *very fast* lexers that match or
+exceed the speed of carefully optimized hand-written code. Instead of using
+traditional table-driven approach, re2c encodes the underlying finite state
+automata directly in the form of conditional jumps and applies numerous optimizations to the generated code.
+The resulting programs are faster and often smaller than their table-driven counterparts, and they
+are much easier to debug and understand.
+Re2c has an unusual *flexible user interface*:
+instead of assuming a fixed program template, it leaves the definition of
+the interface code to the user and allows to configure almost every aspect of the generated
+code. This gives the users a lot of freedom in the way they bind the
+lexer to their particular environment and allows them to decide on the optimal input model.
+Re2c supports *fast and lightweight submatch extraction*
+which does not requre the overhead on full parsing --- a feature that is rarely found in the wild.
+Re2c is used by many other projects
+(such as
+`php <http://php.net/>`_,
+`ninja <https://ninja-build.org/>`_,
+`yasm <http://yasm.tortall.net/>`_,
+`spamassassin <https://spamassassin.apache.org/>`_,
+`BRL-CAD <http://brlcad.org/>`_
+and `wake <https://github.com/sifive/wake>`_)
+and aims at being fully backward compatible.
+On the other hand, it is a research project and a playground for the development of new algorithms in the field of formal grammars and automata.
+
+
+.. |feed| image:: feed/feed/feed.png
+ :target: feed/atom.xml
+ :class: feed
+ :width: 2em
+
+|feed| `Subscribe <feed/atom.xml>`_ to receive the latest news and updates.
+See the `user manual <manual/manual.html>`_ for a complete overview with
+examples.
+
+Download
+--------
+
+You can get the
+`latest release <https://github.com/skvadrik/re2c/releases/latest>`_ on Github,
+as well as the `older releases <https://github.com/skvadrik/re2c/releases>`_
+(make sure you download the latest minor version in each series).
+Many Linux distributions and other systems provide their own packages.
+Re2c source code is hosted on both Github
+(`<https://github.com/skvadrik/re2c>`_) and SourceForge
+(`<https://sourceforge.net/p/re2c>`_).
+Github serves as the main repository, bugtracker and tarball hosting.
+SourceForge is used as a backup repository and email hosting.
+
+Bugs & patches
+--------------
+
+Please send bugs reports, patches and other feedback to `github issue tracker
+<https://github.com/skvadrik/re2c>`_ or email them to
+`re2c-devel@lists.sourceforge.net <re2c-devel@lists.sourceforge.net>`_ and
+`re2c-general@lists.sourceforge.net <re2c-general@lists.sourceforge.net>`_
+mailing lists.
+Re2c has an IRC channel ``#re2c`` on `freenode <https://freenode.net>`_.
+Re2c developers are happy to answer questions and provide help.
+Contributions are always welcome!
+
+Papers
+------
+
+- `"RE2C: a more versatile scanner generator"
+ <1994_bumbulis_cowan_re2c_a_more_versatile_scanner_generator.ps>`_
+ by Peter Bumbulis and Donald D. Cowan,
+ ACM Letters on Programming Languages and Systems (LOPLAS),
+ 1994
+
+- `"Tagged Deterministic Finite Automata with Lookahead"
+ <2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf>`_
+ by Ulya Trofimovich,
+ arXiv:1907.08837,
+ 2017
+
+- `"Efficient POSIX submatch extraction on NFA"
+ <2019_borsotti_trofimovich_efficient_posix_submatch_extraction_on_nfa.pdf>`_
+ by Angelo Borsotti and Ulya Trofimovich,
+ 2019
+
+Authors
+-------
+
+Re2c was originally written by Peter Bumbulis (peter@csg.uwaterloo.ca) in 1993.
+Since then it has been maintained and developed by multiple volunteers,
+most notably,
+Brian Young (bayoung@acm.org),
+Markus Boerger (helly@users.sourceforge.net),
+Dan Nuffer (nuffer@users.sourceforge.net)
+and Ulya Trofimovich (skvadrik@gmail.com).
+Other re2c contributors are
+Derick Rethans,
+Emmanuel Mogenet,
+Hartmut Kaiser,
+jcfp,
+joscherl,
+Mike Gilbert,
+Nerd,
+nuno-lopes,
+Oleksii Taran,
+Peter Bumbulis,
+Petr Skocik,
+Paulo Custodio,
+Ross Burton,
+Ryan Mast,
+Serghei Iakovlev,
+Sergei Trofimovich
+and Tim Kelly
+(apologies if someone is missing).
+
+License
+-------
+
+Re2c is in the public domain. The data structures and algorithms used
+in re2c are all either taken from documents available to the general
+public or are inventions of the author. Programs generated by re2c may
+be distributed freely. Re2c itself may be distributed freely, in source
+or binary, unchanged or modified. Distributors may charge whatever fees
+they can obtain for re2c. If you do make use of re2c, or incorporate it into a larger project an
+acknowledgement somewhere (documentation, research report, etc.) would
+be appreciated.
+Re2c is distributed with no warranty whatsoever.
+The code is certain to contain errors.
+Neither the author nor any contributor takes responsibility for any consequences of its use.
+
+Version
+-------
+
+This website describes re2c version |version|.
+
--- /dev/null
+==================
+Build instructions
+==================
+
+.. toctree::
+ :hidden:
+
+Dependencies
+============
+
+Re2c users need only a C++ compiler to build re2c from a release tarball, and
+optionally Bash if they want to run the tests.
+
+Re2c developers also need Autotools, Bison (if they change parser code), rst2man
+(if they change documentation), Sphinx (if they change this website), Mingw and
+Wine (if they test builds for Windows) and Libtool (if they change the
+experimental libre2c library). A few occasional helper scripts are written in
+Haskell (but they are not necessary for re2c development).
+Re2c is a bootstrapping project with all the consequences.
+
+Building
+========
+
+If you are building re2c from repository, *not* from a release tarball, first of
+all you should run Autotools:
+
+.. code-block:: bash
+
+ $ autoreconf -i -W all
+
+The simplest possible build is an in-tree build (will install re2c to
+``$RE2C_PATH`` location):
+
+.. code-block:: bash
+
+ $ ./configure --prefix=$RE2C_PATH
+ $ make
+ $ make install
+
+Out-of-tree build (puts build artifacts in a separate directory):
+
+.. code-block:: bash
+
+ $ mkdir $BUILD_DIR
+ $ cd $BUILD_DIR
+ $ ../configure --prefix=$RE2C_PATH
+ $ make
+ $ make install
+
+Bootstrapping build (rebuilds re2c with the freshly built re2c and updates
+precompiled bootstrap files):
+
+.. code-block:: bash
+
+ $ make bootstrap
+
+Building on Windows is more tricky. The best option is to use
+`Cygwin <https://cygwin.com/>`_, or build re2c with `Mingw <http://mingw.org/>`_
+(Mingw builds are supported and tested regularly).
+For some Mingw versions you might have to use ``-std=gnu++11`` compiler option
+to avoid spurious build errors (re2c uses ``-std=c++98`` by default).
+
+.. code-block:: bash
+
+ $ ./configure --host i686-w64-ming 32 CXXFLAGS="-std=gnu++11"
+
+To build documentation:
+
+.. code-block:: bash
+
+ $ ./configure --enable-docs
+
+To enable debug:
+
+.. code-block:: bash
+
+ $ ./configure --enable-debug
+
+To build the experimental libre2c library:
+
+.. code-block:: bash
+
+ $ ./configure --enable-libs
+
+Re2c provides a bunch of build scripts ``__build_*.sh`` that can be used
+for specialized builds with ``GLIBCXX_DEBUG``, AddressSanitizer, etc.
+
+Testing
+=======
+
+Re2c has a main test suite and a couple of small unit tests. Run them all:
+
+.. code-block:: bash
+
+ $ make check
+
+Run only the main test suite and watch the progress dumped on ``stdout``:
+
+.. code-block:: bash
+
+ $ ./run_tests.sh -j<N>
+
+Run the main test suite with ``--skeleton`` re2c option:
+
+.. code-block:: bash
+
+ $ ./run_tests.sh --skeleton
+
+Run the test suite under Valgrind (takes some time and memory):
+
+.. code-block:: bash
+
+ $ make vtests
+
+Test mingw builds with Wine:
+
+.. code-block:: bash
+
+ $ make wtests
+
+Check the distribution:
+
+.. code-block:: bash
+
+ $ make distcheck
+
+Re2c provides a helper script ``__alltest.sh`` that builds and tests various
+re2c build flavours with ``GLIBCXX_DEBUG``, AddressSanitizer, etc.
+There is a couple of fuzz-testing Haskell scripts in the ``fuzz`` subdirectory;
+they are based on the QuickCheck library and can be easily modified to fuzz-test
+various aspects of re2c by comparing current re2c version against older versions
+or against other regular expression libraries.
+
--- /dev/null
+Below is an example of generating a picture of DFA that accepts any UTF-8 code point
+(``utf8_any.re``):
+
+.. literalinclude:: /manual/dot/utf8_any.re
+ :language: cpp
+
+Generate and render:
+
+.. code-block:: none
+
+ $ re2c -D -8 utf8_any.re | dot -Tpng -o utf8_any.png
+
+Here is the picture:
+
+.. image:: /manual/dot/utf8_any.png
+ :width: 90%
--- /dev/null
++++++++++++
+User manual
++++++++++++
+
+Syntax
+======
+.. include:: /manual/syntax/syntax.rst_
+.. include:: /manual/syntax/example.rst
+
+Regular expressions
+===================
+.. include:: /manual/regexps/regular_expressions.rst_
+
+User interface
+==============
+.. include:: /manual/api/interface.rst_
+.. include:: /manual/api/api.rst_
+
+Directives
+==========
+.. include:: /manual/directives/directives.rst_
+
+Options
+=======
+.. include:: /manual/options/options_list.rst_
+
+Configurations
+==============
+.. include:: /manual/configurations/configurations.rst_
+
+EOF handling
+============
+.. include:: /manual/eof/eof.rst_
+.. include:: /manual/eof/01_sentinel.rst_
+.. literalinclude:: /manual/eof/01_sentinel.re
+ :language: c
+.. include:: /manual/eof/02_bounds_checking.rst_
+.. literalinclude:: /manual/eof/02_bounds_checking.re
+ :language: c
+.. include:: /manual/eof/03_eof_rule.rst_
+.. literalinclude:: /manual/eof/03_eof_rule.re
+ :language: c
+.. include:: /manual/eof/04_generic_api.rst_
+.. literalinclude:: /manual/eof/04_generic_api.re
+ :language: c
+
+Buffer refilling
+================
+.. include:: /manual/fill/fill.rst_
+.. include:: /manual/fill/01_fill.rst_
+.. literalinclude:: /manual/fill/01_fill.re
+ :language: c
+.. include:: /manual/fill/02_fill.rst_
+.. literalinclude:: /manual/fill/02_fill.re
+ :language: c
+
+Include files
+=============
+.. include:: /manual/includes/includes.rst_
+
+Header files
+============
+.. include:: /manual/headers/headers.rst_
+
+Submatch extraction
+===================
+.. include:: /manual/submatch/submatch.rst_
+.. include:: /manual/submatch/submatch_example_stags.rst_
+.. literalinclude:: /manual/submatch/stags.re
+ :language: c
+.. include:: /manual/submatch/submatch_example_posix.rst_
+.. literalinclude:: /manual/submatch/posix.re
+ :language: c
+.. include:: /manual/submatch/submatch_example_mtags.rst_
+.. literalinclude:: /manual/submatch/mtags.re
+ :language: cpp
+
+Storable state
+==============
+.. include:: /manual/state/state.rst_
+.. literalinclude:: /manual/state/push.re
+ :language: c
+
+Reusable blocks
+===============
+.. include:: /manual/reuse/reuse.rst_
+.. literalinclude:: /manual/reuse/reuse.re
+ :language: c
+
+Encoding support
+================
+.. include:: /manual/encodings/encodings.rst_
+
+Start conditions
+================
+.. include:: /manual/conditions/conditions.rst_
+
+Skeleton programs
+=================
+.. include:: /manual/skeleton/skeleton.rst_
+.. include:: /manual/skeleton/skeleton_example.rst
+
+Visualization and debug
+=======================
+.. include:: /manual/dot/dot.rst_
+.. include:: /manual/dot/example.rst
+
+Warnings
+========
+.. include:: /manual/warnings/warnings_general.rst_
+.. include:: /manual/warnings/warnings_list.rst_
+.. include:: /manual/warnings/undefined_control_flow/wundefined_control_flow.rst
+.. include:: /manual/warnings/unreachable_rules/wunreachable_rules.rst
+.. include:: /manual/warnings/condition_order/wcondition_order.rst
+.. include:: /manual/warnings/useless_escape/wuseless_escape.rst
+.. include:: /manual/warnings/swapped_range/wswapped_range.rst
+.. include:: /manual/warnings/empty_character_class/wempty_character_class.rst
+.. include:: /manual/warnings/match_empty_string/wmatch_empty_string.rst
+.. include:: /manual/warnings/sentinel_in_midrule/wsentinel_in_midrule.rst
+
+More examples
+=============
+.. include:: /examples/examples.rst
--- /dev/null
+
+Here is an example of a very simple program
+:download:`[example.re] </manual/skeleton/example.re.txt>`
+that tries to match two-digit hexadecimal numbers:
+
+.. literalinclude:: /manual/skeleton/example.re.txt
+ :language: c
+
+We can see the generated DFA using ```re2c -D example.re | dot -Grankdir=LR -Tpng -o example.png```:
+
+.. image:: /manual/skeleton/example.png
+ :width: 60%
+
+Given this program, ```re2c -S -o example.c example.re``` generates three files:
+``example.c`` (main program), ``example.c.line4.input`` (input data) and ``example.c.line4.keys`` (expected match results).
+First, let's look at the generated strings
+:download:`[example.c.line4.input] </manual/skeleton/example.c.line4.input>`:
+
+.. code-block:: none
+
+ $ hexdump -v -e '"%08_ax " 24/1 "%02x "' -e '" |" 24/1 "%_p" "|\n"' example.c.line4.input
+ 00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 |........................|
+ 00000018 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f |........ !"#$%&'()*+,-./|
+ 00000030 3a 3b 3c 3d 3e 3f 40 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 |:;<=>?@GHIJKLMNOPQRSTUVW|
+ [ ... ]
+
+Byte sequences correspond to the paths in DFA.
+All strings are glued together, so it's hard to tell where is the end of one string and the beginning of another.
+For that re2c generates keys :download:`[example.c.line4.keys] </manual/skeleton/example.c.line4.keys>`:
+
+.. code-block:: none
+
+ $hexdump -v -e '"%08_ax " 36/1 "%02x " "\n"' example.c.line4.keys
+ 00000000 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+ 00000024 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+ 00000048 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+ [ ... ]
+
+A key is a triplet: string length, the length of matching prefix and the number of matching rule.
+(If tags are used, there is an additional key per each tag variable).
+Keys are packed into an array.
+In our case each key fits into 1 byte, but in case of a larger DFA they might take 2 or 4 bytes.
+The generated program :download:`[example.c] </manual/skeleton/example.c.txt>`
+contains two auxilary functions: ``read_file`` and ``action_line4``.
+``read_file`` is used to map ``.input`` and ``.keys`` files into memory (this function is shared between all lexers).
+``action_line4`` is a replacement for actions: it compares actual lexing results with the expected results.
+This function is specific to each lexer.
+Lexing is done by ``lex_line4``: this function contains the generated DFA.
+The skeleton program is self-contained, so we can compile and run it:
+
+.. code-block:: none
+
+ $ cc -o example example.c
+ $ ./example
+ $ echo $?
+ 0
+
+When everything is fine (there are no errors) the program outputs nothing and
+exits with zero. For the sake of example, let's pretend that re2c has an error
+that results in a missing ``case`` statement:
+
+.. code-block:: bash
+
+ $ re2c -S -o example.c example.re
+ $ sed -i -e "s/case '7'://" example.c
+ $ cc -o example example.c
+ $ ./example
+ error: lex_line4: at position 248 (iteration 241):
+ expected: match length 2, rule 0
+ actual: match length 1, rule 254
+
+Viola! Now the lexer complains about discrepancy between expected and actual
+match results.
+
+One special case of failure detected by skeleton programs is undefined control
+flow in the lexer. Use ``-Wundefined-control-flow`` warning to catch all such
+cases in in your code (more details `here </manual/manual.html#wundefined-control-flow>`_).
--- /dev/null
+A basic example
+---------------
+
+Here is an example program :download:`[syntax.re] </manual/syntax/syntax.re>`
+that shows various aspects of re2c syntax:
+
+.. literalinclude:: /manual/syntax/syntax.re
+ :language: cpp
+
+Run re2c as ``re2c -W syntax.re -o syntax.c`` (option ``-W`` enables warnings).
+The generated code :download:`[syntax.c] </manual/syntax/syntax.c.txt>`
+looks like this:
+
+.. literalinclude:: /manual/syntax/syntax.c.txt
+ :language: c
+
+The lines without comments correspond to the code generated by re2c. Not all
+comments are present in the output --- only those which are in C/C++ code, and
+not inside of re2c blocks.
--- /dev/null
+[-Wcondition-order]
+-------------------
+
+Some older re2c programs that use ``-c --conditions`` option rely on a fixed
+condition order instead of using ``/*!types:re2c*/`` directive or the
+``-t --type-header`` option. This is incorrect and dangerous, as demonstrated by
+the following example :download:`[fixorder.re]
+</manual/warnings/condition_order/fixorder.re.txt>`. In this example
+the lexer has two conditions: ``a`` and ``b``. It starts in condition ``a``,
+which expects a sequence of letters ``a`` followed by a comma. The comma causes
+transition to condition ``b``, which expects a sequence of letters ``b``
+followed by an exclamation mark. Anything other input is an error. Nothing
+special, except that condition numbers are hardcoded manually (the mapping of
+conditions to numbers is toggled by ``REVERSED_CONDITION_ORDER`` define).
+
+.. literalinclude:: /manual/warnings/condition_order/fixorder.re.txt
+ :language: cpp
+ :linenos:
+
+Let's compile and run it.
+Everything works fine: we get ``aaaa,bbb!`` in both cases.
+
+.. code-block:: none
+
+ $ re2c -c -o fixorder.c -Wcondition-order fixorder.re
+ $
+ $ c++ -o fixorder fixorder.c && ./fixorder
+ aaaa,bbb!
+ $
+ $ c++ -o fixorder fixorder.c -DREVERSED_CONDITION_ORDER && ./fixorder
+ aaaa,bbb!
+
+However, if we use the ``-s`` re2c option, the lexer becomes sensitive to condition order:
+
+.. code-block:: none
+
+ $ re2c -cs -o fixorder.c -Wcondition-order fixorder.re
+ fixorder.re:31:6: warning: looks like you use hardcoded numbers instead of autogenerated condition names:
+ better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order]
+ $
+ $ c++ -o fixorder fixorder.c && ./fixorder
+ aaaa,bbb!
+ $
+ $ c++ -o fixorder fixorder.c -DREVERSED_CONDITION_ORDER && ./fixorder
+ error
+
+And we get a warning from re2c. The same behavior remains if we use ``-g`` or
+``-b`` option. Why is that? A look at the generated code explains everything.
+By default the initial dispatch on conditions is a ``switch`` statement:
+
+.. code-block:: cpp
+
+ switch (c) {
+ case yyca: goto yyc_a;
+ case yycb: goto yyc_b;
+ }
+
+Dispatch uses explicit condition names and works no matter what numbers are assigned to them.
+However, with the ``-s`` option, re2c generates an ``if`` statement instead of a ``switch``:
+
+.. code-block:: cpp
+
+ if (c < 1) {
+ goto yyc_a;
+ } else {
+ goto yyc_b;
+ }
+
+And with the ``-g`` option, it uses a jump table (computed ``goto``):
+
+.. code-block:: cpp
+
+ static void *yyctable[2] = {
+ &&yyc_a,
+ &&yyc_b,
+ };
+ goto *yyctable[c];
+
+The last two cases are sensitive to condition order. The fix is easy: as the
+warning suggests, use the ``/*!types:re2c*/`` directive or the
+``-t, --type-header`` option.
--- /dev/null
+[-Wempty-character-class]
+--------------------------
+
+This warning is complementary to the
+``--empty-class <match-empty | match-none | error>`` option.
+For bakward compatibility reasons the default is ``match-empty``: empty
+character class ``[]`` matches empty string (that is, it always matches without
+consuming any input). This behaviour doesn't make much sense, therefore re2c
+provides a warning ``-Wempty-character-class``.
+Note that empty character class can be constructed in many ways, for example as
+a result of range negation or the difference operator. The code below (empty.re)
+demonstrates some of the possibilities:
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ [] { return 0; }
+ [^\x00-\xFF] { return 1; }
+ [^] \ [^] { return 2; }
+ [abc] \ ("a" | "b" | "c") { return 3; }
+ "a" \ [a-z] { return 4; }
+ */
+
+Re2c gives the following warnings:
+
+.. code-block:: none
+
+ $ re2c -Wempty-character-class empty.re -o empty.c
+ empty.re:2:4: warning: empty character class [-Wempty-character-class]
+ empty.re:3:4: warning: empty character class [-Wempty-character-class]
+ empty.re:4:4: warning: empty character class [-Wempty-character-class]
+ empty.re:5:4: warning: empty character class [-Wempty-character-class]
+ empty.re:6:4: warning: empty character class [-Wempty-character-class]
+
--- /dev/null
+[-Wmatch-empty-string]
+--------------------------
+
+``[-Wmatch-empty-string]`` warns when a rule is nullable (matches an empty
+string). It was intended to prevent infinite looping in cases like the
+:download:`[hang.re] </manual/warnings/match_empty_string/hang.re>`
+example below. The program loops over its arguments (the outer ``for`` loop)
+and tries to lex each argument (the inner ``for`` loop). The lexer stops when
+all input has been consumed and it sees the terminating ``NULL``. Arguments must
+consist of lowercase letters only.
+
+.. literalinclude:: /manual/warnings/match_empty_string/hang.re
+ :language: cpp
+ :linenos:
+
+On well-formed input the program runs as expected. However, if one of the
+arguments contains a symbol diffrerent from lowercase letter, the program hangs
+forever:
+
+.. code-block:: none
+
+ $ re2c -Wmatch-empty-string hang.re -o hang.c
+ hang.re:11:19: warning: rule matches empty string [-Wmatch-empty-string]
+ $ c++ -o hang hang.c
+ $
+ $ ./hang only lowercase letters
+ argv[1]: only
+ argv[2]: lowercase
+ argv[3]: letters
+ $
+ $ ./hang right ?
+ argv[1]: right
+ ^C
+
+Note that if we add default rule ``*``, the lexer won't hang anymore: it will
+match the default rule instead of the nullable rule. The fix is easy: make the
+rule non-nullable (say, ``[a-z]+``) and add default rule ``*``.
+
+In some cases matching an empty string makes perfect sense: for example, it
+might be used as a non-consuming default rule, or it might be used to lex an
+optional lexeme (if the corresponding rule doesn't match, the lexer jumps to
+another block and resumes lexing at the same input position). All these cases
+are valid, so if ``[-Wmatch-empty-string]`` becomes annoying, it can be silenced
+with ``[-Wno-match-empty-string]``.
+
--- /dev/null
+[-Wsentinel-in-midrule]
+-----------------------
+
+When using sentinel method of checking for the end of input, it is easy to
+forget that the sentinel symbol must not be allowed in the middle of the rule.
+For example, the following code tries to match single-quoted strings. It allows
+any character except the single quote to occur in the string, including
+terminating ``NULL``. As a result, the generated lexer works as expected on
+well-formed input like ``'aaa'\0``, but things go wrong on ill-formed input like
+``'aaa\0`` (where the closing single quote is missing). Lexer reaches the
+terminating ``NULL`` and assumes it is a part of the single-quoted string, so
+it continues reading bytes from memory. Eventually the lexer terminates due to
+memory access violation, or worse --- it accidentally hits a single quote and
+assumes this to be the end of the string.
+
+.. code-block:: cpp
+ :linenos:
+
+ #include <assert.h>
+
+ int lex(const char *YYCURSOR)
+ {
+ /*!re2c
+ re2c:define:YYCTYPE = char;
+ re2c:yyfill:enable = 0;
+ ['] [^']* ['] { return 0; }
+ * { return 1; }
+ */
+ }
+
+ int main()
+ {
+ assert(lex("'good'") == 0);
+ assert(lex("'bad") == 1);
+ return 0;
+ }
+
+On this code re2c reports a warning. It cannot be certain that ``NULL`` is the sentinel
+symbol, but this is by far the most common case.
+
+.. code-block:: none
+
+ $ re2c -Wsentinel-in-midrule example.re -oexample.c
+ example.re:9:18: warning: sentinel symbol 0 occurs in the middle of the rule
+ (note: if a different sentinel symbol is used, specify it with 're2c:sentinel' configuration) [-Wsentinel-in-midrule]
+
+However, re2c suggests us to define the sentinel symbol using ``re2c:sentinel``
+configuration. Let's do it.
+
+.. code-block:: cpp
+ :linenos:
+
+ #include <assert.h>
+
+ int lex(const char *YYCURSOR)
+ {
+ /*!re2c
+ re2c:define:YYCTYPE = char;
+ re2c:yyfill:enable = 0;
+ re2c:sentinel = 0;
+ ['] [^']* ['] { return 0; }
+ * { return 1; }
+ */
+ }
+
+ int main()
+ {
+ assert(lex("'good'") == 0);
+ assert(lex("'bad") == 1);
+ return 0;
+ }
+
+The warning has turned into an error, as re2c is now certain that the code
+contains an error.
+
+.. code-block:: none
+
+ $ re2c -Wsentinel-in-midrule example.re -oexample.c
+ example.re:10:18: error: sentinel symbol 0 occurs in the middle of the rule [-Werror-sentinel-in-midrule]
+
+The code can be fixed by excluding ``NULL`` from the set of symbols allowed in
+the middle of the string: ``['] [^'\x00]* [']``. If it is necessary to allow
+all symbols, a more powerful EOF handling method should be used.
+
--- /dev/null
+[-Wswapped-range]
+--------------------------
+
+``-Wswapped-range`` warning is reported in cases when a character class contains
+a range which lower bound is greater than the upper bound. For some strange
+reason older versions of re2c did not consider this an error and silently
+swapped range bounds. Consider the following example (swapped.re):
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ * { return "*"; }
+ [a-Z] { return "is it what you wanted?"; }
+ */
+
+Re2c interprets this code as ``[Z-a]``, but generates a warning:
+
+.. code-block:: none
+
+ $ re2c -Wswapped-range swapped.re -o swapped.c
+ swapped.re:3:5: warning: range lower bound (0x61) is greater than upper bound (0x5A), swapping [-Wswapped-range]
+
+Use ``[-Werror-swapped-range]`` to make it an error.
+
+
--- /dev/null
+[-Wundefined-control-flow]
+--------------------------
+
+.. toctree::
+ :hidden:
+
+With ``-Wundefined-control-flow`` warning re2c checks that every path in the
+generated DFA contains at least one accepting state. When the input matches
+such a path, lexer will eventually stop and execute the corresponding semantic
+action. However, if some path has no accepting state, then lexer behavior is
+undefined: it may loop forever, or read past the end of buffer, or jump to some
+other semantic action by accident. For example, consider this simple piece of
+code (a.re) that is supposed to match letter ``a``:
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ "a" { return 'a'; }
+ */
+
+The generated code looks like this:
+
+.. code-block:: cpp
+ :linenos:
+
+ {
+ YYCTYPE yych;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy3;
+ default: goto yy2;
+ }
+ yy2:
+ yy3:
+ ++YYCURSOR;
+ { return 'a'; }
+ }
+
+Clearly this is not what we want: this code matches any letter, not just ``a``!
+This happens because we did not specify any handler for the remaining input symbols.
+If we run re2c with ``-Wundefined-control-flow``, we will see that it complains about undefined control flow and recommends using default rule ``*``:
+
+.. code-block:: none
+
+ a.re:3:2: warning: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use the default '*' rule [-Wundefined-control-flow]
+
+Let's follow the advice and change the code:
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ * { return '*'; }
+ "a" { return 'a'; }
+ */
+
+Now the generated code looks much better:
+
+.. code-block:: cpp
+ :linenos:
+
+ {
+ YYCTYPE yych;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch (yych) {
+ case 'a': goto yy4;
+ default: goto yy2;
+ }
+ yy2:
+ ++YYCURSOR;
+ { return '*'; }
+ yy4:
+ ++YYCURSOR;
+ { return 'a'; }
+ }
+
+Note that the default rule brings no overhead: it simply binds code to the
+default label. It should always be used, unless you are absolutely sure that
+your grammar covers all possible cases.
+
+.. include:: /manual/warnings/undefined_control_flow/default_vs_any.rst
+
--- /dev/null
+[-Wunreachable-rules]
+--------------------------
+
+Sometimes the input grammar contains rules that will never match. This can
+happen for two reasons. First, some rules may be shadowed by other rules that
+match the same input, but have higher priority. Second, the rule itself may be
+infinitely greedy: it may consume as many input characters as it can get and
+never stop, and as a result never match. Both cases indicate a problem with
+the grammar, and ``-Wunreachable-rules`` detects and reports such rules.
+
+Let's see an example of the first kind: shadowed rules (shadowed.re).
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ "" { return ""; }
+ * { return "*"; }
+ "a" | "b" { return "a | b"; }
+ "a" { return "a"; }
+ [\x00-\xFF] { return "[0 - 0xFF]"; }
+ [^] { return "[^]"; }
+ */
+
+In this example the empty rule ``""`` never matches, because any single code
+unit is matched by other rules, which take precedence due to the longerst match.
+Rule ``"a"`` is shadowed by rule ``"a" | "b"``, which also matches ``a``, but
+takes precedence because it comes first. Similarly, rule ``[^]`` is shadowed by
+rule ``[\x00-\xFF]``. Default rule ``*`` is also shadowed, but it's an exception
+that is not reported (default case should always be handled). Shadowed rules
+normally do not appear in the generated code: re2c removes them during its dead
+code elimination pass.
+
+.. code-block:: none
+
+ $ re2c -Wunreachable-rules shadowed.re -o shadowed.c
+ shadowed.re:2:16: warning: unreachable rule (shadowed by rules at lines 4, 6) [-Wunreachable-rules]
+ shadowed.re:5:16: warning: unreachable rule (shadowed by rule at line 4) [-Wunreachable-rules]
+ shadowed.re:7:16: warning: unreachable rule (shadowed by rules at lines 4, 6) [-Wunreachable-rules]
+
+Now let's see an example of second kind: infinitely greedy rule (greedy.re).
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ [^]* { return "greeedy"; }
+ */
+
+This rule will continue eating input characters until ``YYFILL`` fails, or until
+it reads past the end of buffer and causes memory access violation.
+
+.. code-block:: none
+
+ $ re2c -Wunreachable-rules greedy.re -o greedy.c
+ greedy.re:2:9: warning: unreachable rule [-Wunreachable-rules]
+
--- /dev/null
+[-Wuseless-escape]
+--------------------------
+
+Sometimes people escape characters that don't need to be escaped --- either
+because they (mistakenly) think that the character is special and must be
+escaped in the given context, or because they think that this escape sequence
+means something (when it actually doesn't), or just by pure accident. With
+``-Wuseless-escape`` option re2c warns about ignored escapes. Consider this
+example (escapes.re):
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ * {}
+ "\a\A\"\'\[\]\-\x5d\377" {}
+ '\a\A\"\'\[\]\-\x5d\377' {}
+ [\a\A\"\'\[\]\-\x5d\377] {}
+ */
+
+Re2c reports a bunch of warnings:
+
+.. code-block:: none
+
+ $ re2c -Wuseless-escape escapes.re -o escapes.c
+ escapes.re:3:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+ escapes.re:3:11: warning: escape has no effect: '\'' [-Wuseless-escape]
+ escapes.re:3:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+ escapes.re:3:15: warning: escape has no effect: '\]' [-Wuseless-escape]
+ escapes.re:3:17: warning: escape has no effect: '\-' [-Wuseless-escape]
+ escapes.re:4:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+ escapes.re:4:9: warning: escape has no effect: '\"' [-Wuseless-escape]
+ escapes.re:4:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+ escapes.re:4:15: warning: escape has no effect: '\]' [-Wuseless-escape]
+ escapes.re:4:17: warning: escape has no effect: '\-' [-Wuseless-escape]
+ escapes.re:5:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+ escapes.re:5:9: warning: escape has no effect: '\"' [-Wuseless-escape]
+ escapes.re:5:11: warning: escape has no effect: '\'' [-Wuseless-escape]
+ escapes.re:5:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+
+This is because the ``\A`` and ``\[`` escapes are meaningless in all rules,
+``\-`` makes sense only in a character class,
+and each type of closing quotes (``"``, ``'`` and ``]``) should only be escaped inside of a string delimited with the same quotes.
+Useless escapes are ignored: the escaped symbol is treated as not escaped (``\A`` becomes ``A``, etc.).
+The above example should be fixed as follows:
+
+.. code-block:: cpp
+ :linenos:
+
+ /*!re2c
+ * {}
+ "\aA\"'[]-\x5d\377" {}
+ '\aA"\'[]-\x5d\377' {}
+ [\aA"'[\]\-\x5d\377] {}
+ */
+
+More generally, re2c recognizes escapes in the following lexemes:
+
+* double-quoted strings ``" ... "``
+* single-quoted strings ``' ... '``
+* character classes ``[ ... ]`` and ``[^ ... ]``
+
+The following escapes are recognized:
+
+* Closing quotes (``\"`` for double-quoted strings, ``\'`` for single-quoted strings, and ``\]`` for character classes).
+* Dash ``\-`` in character classes.
+* Octal escapes: ``\ooo``, where ``o`` is in range ``[0 - 7]``
+ (the largest octal escape is ``\377``, which equals ``0xFF``).
+* Hexadecimal escapes: ``\xhh``, ``\Xhhhh``, ``\uhhhh``, and ``\Uhhhhhhhh``,
+ where ``h`` is in range ``[0 - 9]``, ``[a - f]``, or ``[A - F]``.
+* Miscellaneous escapes: ``\a``, ``\b``, ``\f``, ``\n``, ``\r``, ``\t``, ``\v``, ``\\``.
+
+Ill-formed octal and hexadecimal escapes are treated as errors.
+An escape followed by a newline is also an error: multiline strings and character classes are not allowed.
+Any other ill-formed escapes are ignored.
+
+
--- /dev/null
+Fast submatch extraction
+========================
+
+*by Ulya Trofimovich*
+
+
+This article is an informal description
+of the `novel algorithm <../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf>`_
+used in `re2c-1.0 <../release_notes/1_0.html>`_
+to implement `submatch extraction <../../manual/features/submatch/submatch.html>`_.
+It tries to explain what is it so complex about this seemingly simple problem,
+why re2c has such a strange interface,
+and how *tags* are related to the familiar *capturing groups* used by other regular expression engines.
+
+
+
+Introduction
+------------
+
+*Regular expressions* is a syntactic notation for describing *sets*.
+Usually it is assumed that these sets contain strings --- sequences of characters over some fixed alphabet.
+This is known as the *language interpretation* of regular expressions.
+For example, :math:`a^*b^*` denotes language :math:`L` that contains all strings
+composed by a sequence of :math:`a` followed by a sequence of :math:`b`.
+Special symbol :math:`\epsilon` means "empty string":
+
+.. math::
+
+ L(a^*b^*) = \{\epsilon, a, b, aa, ab, bb, ...\}
+
+Regular expressions is one possible way of describing *regular languages* ---
+the class of languages generated by Type 3 grammars in the Chomsky hierarchy.
+For every regular expression there is an equivalent Type 3 grammar that generates the same language and vice versa.
+For example, the above language :math:`L` can be generated by the grammar :math:`G = (V_T, V_N, R, S)`:
+
+.. math::
+
+ \text{alphabet of terminals:} &\quad V_T = \{ a, b \} \\
+ \text{alphabet of non-terminals:} &\quad V_N = \{ A, B \} \\
+ \text{production rules:} &\quad R = \{
+ A \rightarrow aA | bB | a | b | \epsilon,
+ B \rightarrow bB | b
+ \} \\
+ \text{start symbol:} &\quad S = A
+
+
+It is often said that regular expressions are used for *matching* strings.
+But what exactly is matching?
+In the narrow sense of the word it means *recognition*:
+deciding if the given string belongs to the language denoted by the regular expression.
+For example, :math:`aaabb \in L`, but :math:`aba \not\in L`.
+In the broad sense of the word matching means *parsing*:
+besides solving the membership problem
+it is also necessary to find the *derivation* --- the sequence of grammar rules that transform start symbol into the input string.
+Derivation gives more information than a simple membership test
+because it reconstructs the *structure* of the input string.
+For example, :math:`aaabb` is derived as follows in the grammar :math:`G`:
+
+.. math::
+
+ A
+ \rightarrow aA
+ \rightarrow aaA
+ \rightarrow aaaA
+ \rightarrow aaabB
+ \rightarrow aaabb
+
+
+There is no exact analogue of "derivation" in terms of regular expressions,
+as their primary application is recognition, not parsing.
+Yet sometimes it is convenient to know which part of the input string
+corresponds to a particular part of the regular expression ---
+the problem known as *submatch extraction*.
+In our example one might want to know the substrings corresponding to :math:`a^*` and :math:`b^*`;
+this is usually denoted with the help of *capturing parentheses*: :math:`(a^*)(b^*)`.
+Submatch extraction is similar to parsing:
+in order to find submatch boundaries we need to know a bit of the input structure.
+However, unlike parsing, there is no need to reconstruct the full structure down to each character.
+
+.. math::
+
+ \underbrace{aaa}_{a^*} \underbrace{bb}_{b^*}
+
+Recognition problem can be solved by converting the regular expression to a *nondeterministic finite automaton* (NFA)
+or an equivalent *deterministic finite automaton* (DFA).
+Parsing and submatch extraction are inherently more complex than recognition,
+and they require a more complex type of automata: *nondeterministic finite state transducers* (NFST).
+Unlike NFA, NFST are strictly more powerful than their deterministic analogues (DFST):
+it is possible to perform determinization, but the resulting automaton is of a more sophisticated type than DFST.
+
+
+Recognition
+-----------
+
+.. image:: nfa_simple.png
+
+aaaa
+
+.. image:: nfa.png
+
+aaaa
+
+.. image:: dfa_raw.png
+
+aaaaa
+
+.. image:: dfa.png
+
+aaaa
+
+.. image:: dfa_min.png
+
+Recognition problem can be solved by converting the regular expression to a *nondeterministic finite automaton* (NFA)
+and simulating NFA moves on the input string.
+Simulation takes linear time, but since the automaton is nondeterministic,
+it is necessary to track many possible paths simultaneously.
+Alternatively, one can convert NFA to an equivalent *deterministic finite automaton* (DFA),
+which also runs in linear time, but is much faster then NFA --- there is only one possible path to track.
+The *determinization* procedure is quite complex;
+in the worst case it may take exponential time and generate a very large DFA.
+Therefore determinization is only worthwile
+if it can be performed ahead of time (in lexer generators like re2c),
+or if the same regular expression is used multiple times.
+Some engines try to get the best of both worlds by using *lazy determinization*:
+NFA simulation with memoization of all intermediate states.
+
+
+
+In terms of NFA "derivation" means "path",
+and parsing means finding this path --- a chain of transitions from initial state to final state which spells the input string.
+This cannot be done by the means of traditional NFA,
+as the only output they produce is a yes/no answer:
+simulation either ends in a final state or not.
+In order to remember the path automaton must be able to record its moves.
+Such automata are known as *nondeterministic finite state transducers* (NFST):
+they are like ordinary NFA extended with an output tape
+and transitions that not only read symbols from the input string, but also write symbols on the output tape.
+Unlike NFA, NFST cannot be always converted to DFST: nondeterminisitc transducers are strictly more powerful.
+However, it is possible to turn NFST into a more complex type of determinisitc automata.
+Devising and constructing such automata is the main challenge of parsing and submatch extraction.
+
+
+The difficulty with DFA
+-----------------------
+
+
+
+Dangerous trailing contexts
+---------------------------
+
+
+The challenge of implementing submatch extraction in lexer generators like re2c is not immediately obvious.
+
--- /dev/null
+Changelog
+=========
+
+----
+1.2x
+----
+
+1.2.1 (2019-08-11)
+~~~~~~~~~~~~~~~~~~
+
+- Fixed bug `#253 <https://github.com/skvadrik/re2c/issues/253>`_:
+ re2c should install unicode_categories.re somewhere.
+
+- Fixed bug `#254 <https://github.com/skvadrik/re2c/issues/254>`_:
+ Turn off re2c:eof = 0.
+
+1.2 (2019-08-02)
+~~~~~~~~~~~~~~~~
+
+- Added EOF rule ``$`` and configuration ``re2c:eof``.
+
+- Added ``/*!include:re2c ... */`` directive and ``-I`` option.
+
+- Added ``/*!header:re2c:on*/`` and ``/*!header:re2c:off*/`` directives.
+
+- Added ``--input-encoding <ascii | utf8>`` option.
+
+ + `#237 <https://github.com/skvadrik/re2c/issues/237>`_:
+ Handle non-ASCII encoded characters in regular expressions
+ + `#250 <https://github.com/skvadrik/re2c/issues/250>`_
+ UTF8 enoding
+
+- Added include file with a list of definitions for Unicode character classes.
+
+ + `#235 <https://github.com/skvadrik/re2c/issues/235>`_:
+ Unicode character classes
+
+- Added ``--location-format <gnu | msvc>`` option.
+
+ + `#195 <https://github.com/skvadrik/re2c/issues/195>`_:
+ Please consider using Gnu format for error messages
+
+- Added ``--verbose`` option that prints "success" message if re2c exits
+ without errors.
+
+- Added configurations for options:
+
+ + ``-o --output`` (specify output file)
+ + ``-t --type-header`` (specify header file)
+
+- Removed configurations for internal/debug options.
+
+- Extended ``-r`` option: allow to mix multiple ``/*!rules:re2c*/``,
+ ``/*!use:re2c*/`` and ``/*!re2c*/`` blocks.
+
+ + `#55 <https://github.com/skvadrik/re2c/issues/55>`_:
+ allow standard re2c blocks in reuse mode
+
+- Fixed ``-F --flex-support`` option: parsing and operator precedence.
+
+ + `#229 <https://github.com/skvadrik/re2c/issues/229>`_:
+ re2c option -F (flex syntax) broken
+ + `#242 <https://github.com/skvadrik/re2c/issues/242>`_:
+ Operator precedence with --flex-syntax is broken
+
+- Changed difference operator ``/`` to apply before encoding expansion of
+ operands.
+
+ + `#236 <https://github.com/skvadrik/re2c/issues/236>`_:
+ Support range difference with variable-length encodings
+
+- Changed output generation of output file to be atomic.
+
+ + `#245 <https://github.com/skvadrik/re2c/issues/245>`_:
+ re2c output is not atomic
+
+- Authored research paper "Efficient POSIX Submatch Extraction on NFA"
+ together with Dr Angelo Borsotti.
+
+- Added experimental libre2c library (``--enable-libs`` configure option) with
+ the following algorithms:
+
+ + TDFA with leftmost-greedy disambiguation
+ + TDFA with POSIX disambiguation (Okui-Suzuki algorithm)
+ + TNFA with leftmost-greedy disambiguation
+ + TNFA with POSIX disambiguation (Okui-Suzuki algorithm)
+ + TNFA with lazy POSIX disambiguation (Okui-Suzuki algorithm)
+ + TNFA with POSIX disambiguation (Kuklewicz algorithm)
+ + TNFA with POSIX disambiguation (Cox algorithm)
+
+- Added debug subsystem (``--enable-debug`` configure option) and new debug
+ options:
+
+ + ``-dump-cfg`` (dump control flow graph of tag variables)
+ + ``-dump-interf`` (dump interference table of tag variables)
+ + ``-dump-closure-stats`` (dump epsilon-closure statistics)
+
+- Added internal options:
+
+ + ``--posix-closure <gor1 | gtop>`` (switch between shortest-path algorithms
+ used for the construction of POSIX closure)
+
+- Fixed a number of crashes found by American Fuzzy Lop fuzzer:
+
+ + `#226 <https://github.com/skvadrik/re2c/issues/226>`_,
+ `#227 <https://github.com/skvadrik/re2c/issues/227>`_,
+ `#228 <https://github.com/skvadrik/re2c/issues/228>`_,
+ `#231 <https://github.com/skvadrik/re2c/issues/231>`_,
+ `#232 <https://github.com/skvadrik/re2c/issues/232>`_,
+ `#233 <https://github.com/skvadrik/re2c/issues/233>`_,
+ `#234 <https://github.com/skvadrik/re2c/issues/234>`_,
+ `#238 <https://github.com/skvadrik/re2c/issues/238>`_
+
+- Fixed handling of newlines:
+
+ + correctly parse multi-character newlines CR LF in ``#line`` directives
+ + consistently convert all newlines in the generated file to Unix-style LF
+
+- Changed default tarball format from .gz to .xz.
+
+ + `#221 <https://github.com/skvadrik/re2c/issues/221>`_:
+ big source tarball
+
+- Fixed a number of other bugs and resolved issues:
+
+ + `#2 <https://github.com/skvadrik/re2c/issues/2>`_: abort
+ + `#6 <https://github.com/skvadrik/re2c/issues/6>`_: segfault
+ + `#10 <https://github.com/skvadrik/re2c/issues/10>`_:
+ lessons/002_upn_calculator/calc_002 doesn't produce a useful example program
+ + `#44 <https://github.com/skvadrik/re2c/issues/44>`_:
+ Access violation when translating the attached file
+ + `#49 <https://github.com/skvadrik/re2c/issues/49>`_:
+ wildcard state \000 rules makes lexer behave weard
+ + `#98 <https://github.com/skvadrik/re2c/issues/98>`_:
+ Transparent handling of #line directives in input files
+ + `#104 <https://github.com/skvadrik/re2c/issues/104>`_:
+ Improve const-correctness
+ + `#105 <https://github.com/skvadrik/re2c/issues/105>`_:
+ Conversion of pointer parameters into references
+ + `#114 <https://github.com/skvadrik/re2c/issues/114>`_:
+ Possibility of fixing bug 2535084
+ + `#120 <https://github.com/skvadrik/re2c/issues/120>`_:
+ condition consisting of default rule only is ignored
+ + `#167 <https://github.com/skvadrik/re2c/issues/167>`_:
+ Add word boundary support
+ + `#168 <https://github.com/skvadrik/re2c/issues/168>`_:
+ Wikipedia's article on re2c
+ + `#180 <https://github.com/skvadrik/re2c/issues/180>`_:
+ Comment syntax?
+ + `#182 <https://github.com/skvadrik/re2c/issues/182>`_:
+ yych being set by YYPEEK () and then not used
+ + `#196 <https://github.com/skvadrik/re2c/issues/196>`_:
+ Implicit type conversion warnings
+ + `#198 <https://github.com/skvadrik/re2c/issues/198>`_:
+ no match for ‘operator!=’ in ‘i != std::vector<_Tp, _Alloc>::rend() [with _Tp = re2c::bitmap_t, _Alloc = std::allocator<re2c::bitmap_t>]()’
+ + `#210 <https://github.com/skvadrik/re2c/issues/210>`_:
+ How to build re2c in windows?
+ + `#215 <https://github.com/skvadrik/re2c/issues/215>`_:
+ A memory read overrun issue in s_to_n32_unsafe.cc
+ + `#220 <https://github.com/skvadrik/re2c/issues/220>`_:
+ src/dfa/dfa.h: simplify constructor to avoid g++-3.4 bug
+ + `#223 <https://github.com/skvadrik/re2c/issues/223>`_:
+ Fix typo
+ + `#224 <https://github.com/skvadrik/re2c/issues/224>`_:
+ src/dfa/closure_posix.cc: pack() tweaks
+ + `#225 <https://github.com/skvadrik/re2c/issues/225>`_:
+ Documentation link is broken in libre2c/README
+ + `#230 <https://github.com/skvadrik/re2c/issues/230>`_:
+ Changes for upcoming Travis' infra migration
+ + `#239 <https://github.com/skvadrik/re2c/issues/239>`_:
+ Push model example has wrong re2c invocation, breaks guide
+ + `#241 <https://github.com/skvadrik/re2c/issues/241>`_:
+ Guidance on how to use re2c for full-duplex command & response protocol
+ + `#243 <https://github.com/skvadrik/re2c/issues/243>`_:
+ A code generated for period (.) requires 4 bytes
+ + `#246 <https://github.com/skvadrik/re2c/issues/246>`_:
+ Please add a license to this repo
+ + `#247 <https://github.com/skvadrik/re2c/issues/247>`_:
+ Build failure on current Cygwin, probably caused by force-fed c++98 mode
+ + `#248 <https://github.com/skvadrik/re2c/issues/248>`_:
+ distcheck still looks for README
+ + `#251 <https://github.com/skvadrik/re2c/issues/251>`_:
+ Including what you use is find, but not without inclusion guards
+
+- Updated documentation and website.
+
+
+----
+1.1x
+----
+
+1.1.1 (2018-08-30)
+~~~~~~~~~~~~~~~~~~
+
+- Fixed bug `#211 <https://github.com/skvadrik/re2c/issues/211>`_:
+ re2c ``-V`` throws ``std::out_of_range`` (version to vernum conversion).
+
+1.1 (2018-08-27)
+~~~~~~~~~~~~~~~~
+
+- Replaced Kuklewicz POSIX disambiguation algorithm with Okui algorithm.
+- Optimized GOR1 algorithm (computation of tagged epsilon-closure).
+- Added option ``--conditions`` (an alias for ``-c --start-conditions``).
+- Fixed bug `#201 <https://github.com/skvadrik/re2c/issues/201>`_:
+ Bugs with option: ``re2c:flags:no-debug-info``.
+- Reworked first part of TDFA paper.
+
+----
+1.0x
+----
+
+1.0.3 (2017-11-08)
+~~~~~~~~~~~~~~~~~~
+
+- Fixed bug `#198 <https://github.com/skvadrik/re2c/issues/198>`_:
+ build error on MacOS with GCC-4.2.1
+
+1.0.2 (2017-08-26)
+~~~~~~~~~~~~~~~~~~
+
+- Fixed bug `#194 <https://github.com/skvadrik/re2c/issues/194>`_:
+ Build with ``--enable-docs``
+- Updated documentation.
+
+1.0.1 (2017-08-11)
+~~~~~~~~~~~~~~~~~~
+
+- Fixed bug `#193 <https://github.com/skvadrik/re2c/issues/193>`_:
+ 1.0 build failure on macOS: error: calling a private constructor of class
+ 're2c::Rule'
+
+- Added paper "Tagged Deterministic Finite Automata with Lookahead" to the
+ distribution files.
+
+1.0 (2017-08-11)
+~~~~~~~~~~~~~~~~
+
+- Added options:
+
+ + ``-P --posix-captures`` (POSIX-compliant capturing groups)
+ + ``-T --tags`` (standalone tags with leftmost greedy disambiguation)
+ + ``--no-lookahead``
+ + ``--no-optimize-tags``
+ + ``--eager-skip``
+ + ``--dump-nfa``
+ + ``--dump-dfa-raw``
+ + ``--dump-dfa-det``
+ + ``--dump-dfa-tagopt``
+ + ``--dump-dfa-min``
+ + ``--dump-adfa``
+
+- Added new syntax:
+
+ + ``@<stag>``
+ + ``#<mtag>``
+
+- Added new directives:
+
+ + ``/*!stags:re2c ... */``
+ + ``/*!mtags:re2c ... */``
+ + ``/*!maxnmatch:re2c ... */``
+
+- Added new API:
+
+ + ``YYSTAGN (t)``
+ + ``YYSTAGP (t)``
+ + ``YYMTAGN (t)``
+ + ``YYMTAGP (t)``
+ + ``YYRESTORETAG (t)``
+ + ``YYMAXNMATCH``
+ + ``yynmatch``
+ + ``yypmatch``
+
+- Added inplace confgurations:
+
+ + ``re2c:define:YYSTAGN``
+ + ``re2c:define:YYSTAGP``
+ + ``re2c:define:YYMTAGN``
+ + ``re2c:define:YYMTAGP``
+ + ``re2c:define:YYRESTORETAG``
+ + ``re2c:flags:8`` or ``re2c:flags:utf-8````
+ + ``re2c:flags:b`` or ``re2c:flags:bit-vectors``
+ + ``re2c:flags:case-insensitive``
+ + ``re2c:flags:case-inverted``
+ + ``re2c:flags:d`` or ``re2c:flags:debug-output``
+ + ``re2c:flags:dfa-minimization``
+ + ``re2c:flags:eager-skip``
+ + ``re2c:flags:e`` or ``re2c:flags:ecb``
+ + ``re2c:flags:empty-class``
+ + ``re2c:flags:encoding-policy``
+ + ``re2c:flags:g`` or ``re2c:flags:computed-gotos``
+ + ``re2c:flags:i`` or ``re2c:flags:no-debug-info``
+ + ``re2c:flags:input``
+ + ``re2c:flags:lookahead``
+ + ``re2c:flags:optimize-tags``
+ + ``re2c:flags:P`` or ``re2c:flags:posix-captures``
+ + ``re2c:flags:s`` or ``re2c:flags:nested-ifs``
+ + ``re2c:flags:T`` or ``re2c:flags:tags``
+ + ``re2c:flags:u`` or ``re2c:flags:unicode``
+ + ``re2c:flags:w`` or ``re2c:flags:wide-chars``
+ + ``re2c:flags:x`` or ``re2c:flags:utf-16``
+ + ``re2c:tags:expression``
+ + ``re2c:tags:prefix``
+
+- Added warning ``-Wnondeterministic-tags``.
+
+- Added fuzz-testing scripts
+
+- Added paper "Tagged Deterministic Finite Automata with Lookahead".
+
+- Fixed bugs:
+
+ + `#121 <https://github.com/skvadrik/re2c/issues/121>`_:
+ trailing contexts are fundamentally broken
+ + `#135 <https://github.com/skvadrik/re2c/issues/135>`_:
+ In installation ``make check`` give syntax error
+ + `#137 <https://github.com/skvadrik/re2c/issues/137>`_:
+ run_tests.sh fail when running configure script with absolute path
+ + `#138 <https://github.com/skvadrik/re2c/issues/138>`_:
+ website improvement
+ + `#141 <https://github.com/skvadrik/re2c/issues/141>`_:
+ Tests under Windows
+ + `#142 <https://github.com/skvadrik/re2c/issues/142>`_:
+ segvault with null terminated input
+ + `#145 <https://github.com/skvadrik/re2c/issues/145>`_:
+ Values for enum YYCONDTYPE are not generated when default rules with conditions are used
+ + `#147 <https://github.com/skvadrik/re2c/issues/147>`_:
+ Please add symbol name to "can't find symbol" error message
+ + `#152 <https://github.com/skvadrik/re2c/issues/152>`_:
+ Line number in #line directive after enum YYCONDTYPE is 0-based
+ + `#156 <https://github.com/skvadrik/re2c/issues/156>`_:
+ Build with Visual Studio 14 2015: symbol name conflict
+ + `#158 <https://github.com/skvadrik/re2c/issues/158>`_:
+ Inconsistent forward declaration of struct/class vs definition
+ + `#160 <https://github.com/skvadrik/re2c/issues/160>`_:
+ Open text files with "wb" causes issues on Windows
+ + `#162 <https://github.com/skvadrik/re2c/issues/162>`_:
+ Reading files with "rb" causes issues in Windows
+ + `#165 <https://github.com/skvadrik/re2c/issues/165>`_:
+ Trailing context consumed if initial expression matches it
+ + `#176 <https://github.com/skvadrik/re2c/issues/176>`_:
+ re2c help message is too wide for most terminals
+ + `#184 <https://github.com/skvadrik/re2c/issues/184>`_:
+ Small documentation issue
+ + `#186 <https://github.com/skvadrik/re2c/issues/186>`_:
+ Difference operator sometimes doesn't work with utf-8
+
+- Merged pull requests:
+
+ + `#131 <https://github.com/skvadrik/re2c/issues/131>`_:
+ Use bash-specific ``[[`` builtin
+ + `#136 <https://github.com/skvadrik/re2c/issues/136>`_:
+ Added basic support for travis-ci.org integration
+ + `#171 <https://github.com/skvadrik/re2c/issues/171>`_:
+ Typo fix
+ + `#172 <https://github.com/skvadrik/re2c/issues/172>`_:
+ Grammar fixes in the docs
+ + `#173 <https://github.com/skvadrik/re2c/issues/173>`_:
+ Grammar fixes in the manpage
+ + `#174 <https://github.com/skvadrik/re2c/issues/174>`_:
+ more documentation fixes
+ + `#175 <https://github.com/skvadrik/re2c/issues/175>`_:
+ more manpage fixes
+ + `#177 <https://github.com/skvadrik/re2c/issues/177>`_:
+ sync --help output w/ manpage
+ + `#178 <https://github.com/skvadrik/re2c/issues/178>`_:
+ Moves rts used in the manpage to master
+ + `#179 <https://github.com/skvadrik/re2c/issues/179>`_:
+ compose manpage out of rsts from gh-pages-gen
+ + `#189 <https://github.com/skvadrik/re2c/issues/189>`_:
+ Typo fix and small grammatical change
+ + `#191 <https://github.com/skvadrik/re2c/issues/191>`_:
+ Makefile.am: create target directory before writing into it
+
+
+-----
+0.16x
+-----
+
+0.16 (2016-01-21)
+~~~~~~~~~~~~~~~~~
+
+- Fixed bug `#127 <https://github.com/skvadrik/re2c/issues/127>`_:
+ code generation error with wide chars and bitmaps (omitted ``goto`` statement)
+- Added DFA minimization and option ``--dfa-minimization <table | moore>``
+- Fixed bug `#128 <https://github.com/skvadrik/re2c/issues/128>`_:
+ very slow DFA construction (resulting in a very large DFA)
+- Fixed bug `#132 <https://github.com/skvadrik/re2c/issues/132>`_:
+ test failure on big endian archs with 0.15.3
+
+
+-----
+0.15x
+-----
+
+0.15.3 (2015-12-02)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed bugs and applied patches:
+
+ + `#122 <https://github.com/skvadrik/re2c/issues/122>`_:
+ clang does not compile re2c 0.15.x
+ + `#124 <https://github.com/skvadrik/re2c/issues/124>`_:
+ Get rid of UINT32_MAX and friends
+ + `#125 <https://github.com/skvadrik/re2c/issues/125>`_:
+ [OS X] git reports changes not staged for commit in newly cloned repository
+
+- Added option ``--no-version`` that allows to omit version information.
+- Reduced memory and time consumed with ``-Wundefined-control-flow``.
+- Improved coverage of input data generated with ``-S --skeleton``.
+
+
+0.15.2 (2015-11-23)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed build system: lexer depends on bison-generated header
+ (Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=566620)
+
+
+0.15.1 (2015-11-22)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed test failures caused by locale-sensitive 'sort'.
+
+
+0.15 (2015-11-22)
+~~~~~~~~~~~~~~~~~
+
+- Updated website http://re2c.org:
+
+ + added examples
+ + updated docs
+ + added news
+ + added web feed (Atom 1.0)
+
+- Added options:
+
+ + ``-S, --skeleton``
+ + ``--empty-class <match-empty | match-none | error>``
+
+- Added warnings:
+
+ + ``-W``
+ + ``-Werror``
+ + ``-W<warning>``
+ + ``-Wno-<warning>``
+ + ``-Werror-<warning>``
+ + ``-Wno-error-<warning>``
+
+- Added specific warnings:
+
+ + ``-Wundefined-control-flow``
+ + ``-Wunreachable-rules``
+ + ``-Wcondition-order``
+ + ``-Wuseless-escape``
+ + ``-Wempty-character-class``
+ + ``-Wswapped-range``
+ + ``-Wmatch-empty-string``
+
+- Fixed options:
+
+ + ``--`` (interpret remaining arguments as non-options)
+
+- Deprecated options:
+
+ + ``-1 --single-pass`` (single pass is the default now)
+
+- Reduced size of the generated ``.dot`` files.
+
+- Fixed bugs:
+
+ + `#27 <https://github.com/skvadrik/re2c/issues/27>`_:
+ re2c crashes reading files containing ``%{ %}`` (patch by Rui)
+ + `#51 <https://github.com/skvadrik/re2c/issues/51>`_:
+ default rule doesn't work in reuse mode
+ + `#52 <https://github.com/skvadrik/re2c/issues/52>`_:
+ eliminate multiple passes
+ + `#59 <https://github.com/skvadrik/re2c/issues/59>`_:
+ bogus ``yyaccept`` in ``-c`` mode
+ + `#60 <https://github.com/skvadrik/re2c/issues/60>`_:
+ redundant use of ``YYMARKER``
+ + `#61 <https://github.com/skvadrik/re2c/issues/61>`_:
+ empty character class ``[]`` matches empty string
+ + `#115 <https://github.com/skvadrik/re2c/issues/115>`_:
+ flex-style named definitions cause ambiguity in re2c grammar
+ + `#119 <https://github.com/skvadrik/re2c/issues/119>`_:
+ ``-f`` with ``-b``/``-g`` generates incorrect dispatch on fill labels
+ + `#116 <https://github.com/skvadrik/re2c/issues/116>`_:
+ empty string with non-empty trailing context consumes code units
+
+- Added test options:
+
+ + ``-j``, ``-j <N>`` (run tests in ``N`` threads, defaults to the number of CPUs)
+ + ``--wine`` (test windows builds using ``wine``)
+ + ``--skeleton`` (generate skeleton programs, compile and execute them)
+ + ``--keep-tmp-files`` (don't delete intermediate files for successful tests)
+
+- Updated build system:
+
+ + support out of source builds
+ + support ```make distcheck```
+ + added ```make bootstrap``` (rebuild re2c after building with precompiled
+ ``.re`` files)
+ + added ```make tests``` (run tests with ``-j``)
+ + added ```make vtests``` (run tests with ``--valgrind -j``)
+ + added ```make wtests``` (run tests with ``--wine -j 1``)
+ + added Autoconf tests for ``CXXFLAGS``. By default try the following options:
+ ``-W -Wall -Wextra -Weffc++ -pedantic -Wformat=2 -Wredundant-decls
+ -Wsuggest-attribute=format -Wconversion -Wsign-conversion -O2 -Weverything``),
+ respect user-defined ``CXXFLAGS``
+ + support Mingw builds: ```configure -host i686-w64-mingw32```
+ + structured source files
+ + removed old MSVC files
+
+- Moved development to github (https://github.com/skvadrik/re2c),
+ keep a mirror on sourceforge.
+
+
+-----
+0.14x
+-----
+
+0.14.3 (2015-05-20)
+~~~~~~~~~~~~~~~~~~~
+
+- applied patch `#27 <https://github.com/skvadrik/re2c/issues/27>`_:
+ re2c crashes reading files containing %{ %}
+- dropped distfiles for MSVC (they are broken anyway)
+
+0.14.2 (2015-03-25)
+~~~~~~~~~~~~~~~~~~~
+
+- fixed `#57 <https://github.com/skvadrik/re2c/issues/57>`_:
+ Wrong result only if another rule is present
+
+0.14.1 (2015-02-27)
+~~~~~~~~~~~~~~~~~~~
+
+- fixed `#55 <https://github.com/skvadrik/re2c/issues/55>`_:
+ re2c-0.14: re2c -V outputs null byte
+
+0.14 (2015-02-23)
+~~~~~~~~~~~~~~~~~
+
+- Added generic input API
+
+ + `#21 <https://github.com/skvadrik/re2c/issues/21>`_:
+ Support to configure how re2c code interfaced with the symbol buffer?"
+
+- fixed `#46 <https://github.com/skvadrik/re2c/issues/46>`_:
+ re2c generates an infinite loop, depends on existence of previous parser
+- fixed `#47 <https://github.com/skvadrik/re2c/issues/47>`_:
+ Dot output label escaped characters
+
+
+-----
+0.13x
+-----
+
+0.13.7.5 (2014-08-22)
+~~~~~~~~~~~~~~~~~~~~~
+
+- Fixed `Gentoo bug with PHP lexer <https://bugs.gentoo.org/show_bug.cgi?id=518904>`_
+
+0.13.7.4 (2014-07-29)
+~~~~~~~~~~~~~~~~~~~~~
+
+- Enabled ``make docs`` only if configured with ``--enable-docs``
+- Disallowed to use yacc/byacc instead of bison to build parser
+- Removed non-portable sed feature in script that runs tests
+
+0.13.7.3 (2014-07-27)
+~~~~~~~~~~~~~~~~~~~~~
+
+- Fixed CXX warning
+- Got rid of asciidoc build-time dependency
+
+0.13.7.2 (2014-07-27)
+~~~~~~~~~~~~~~~~~~~~~
+
+- Included man page into dist, respect users CXXFLAGS.
+
+0.13.7.1 (2014-07-26)
+~~~~~~~~~~~~~~~~~~~~~
+
+- Added missing files to tarball
+
+0.13.7 (2014-07-25)
+~~~~~~~~~~~~~~~~~~~
+
+- Added UTF-8 support
+- Added UTF-16 support
+- Added default rule
+- Added option to control ill-formed Unicode
+
+0.13.6 (2013-07-04)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed #2535084 uint problem with Sun C 5.8
+- #3308400: allow Yacc-style ``%{`` code brackets ``}%``
+- #2506253: allow C++ ``//`` comments
+- Fixed inplace configuration in ``-e`` mode.
+- Applied #2482572 Typos in error messages.
+- Applied #2482561 Error in manual section on ``-r`` mode.
+- Fixed #2478216 Wrong ``start_label`` in ``-c`` mode.
+- Fixed #2186718 Unescaped backslash in file name of ``#line`` directive.
+- Fixed #2102138 Duplicate case labels on EBCDIC.
+- Fixed #2088583 Compile problem on AIX.
+- Fixed #2038610 Ebcdic problem.
+- improve dot support: make char intervals (e.g. ``[A-Z]``) instead of one edge
+ per char
+
+0.13.5 (2008-05-25)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed #1952896 Segfault in ``re2c::Scanner::scan``.
+- Fixed #1952842 Regression.
+
+0.13.4 (2008-04-05)
+~~~~~~~~~~~~~~~~~~~
+
+- Added transparent handling of ``#line`` directives in input files.
+- Added ``re2c:yyfill:check`` inplace configuration.
+- Added ``re2c:define:YYSETSTATE:naked`` inplace configuration.
+- Added ``re2c:flags:w`` and ``re2c:flags:u`` inplace configurations.
+- Added the ability to add rules in ``use:re2c`` blocks.
+- Changed ``-r`` flag to accept only ``rules:re2c`` and ``use:re2c`` blocks.
+
+0.13.3 (2008-03-14)
+~~~~~~~~~~~~~~~~~~~
+
+- Added ``-r`` flag to allow reuse of scanner definitions.
+- Added ``-F`` flag to support flex syntax in rules.
+- Fixed SEGV in scanner that occurs with very large blocks.
+- Fixed issue with unused ``yybm``.
+- Partial support for flex syntax.
+- Changed to allow ``/*`` comments with ``-c`` switch.
+- Added flag ``-D/--emit-dot``.
+
+0.13.2 (2008-02-14)
+~~~~~~~~~~~~~~~~~~~
+
+- Added flag ``--case-inverted``.
+- Added flag ``--case-insensitive``.
+- Added support for ``<!...>`` to enable rule setup.
+- Added support for ``=>`` style rules.
+- Added support for ``:=`` style rules.
+- Added support for ``:=>`` style rules.
+- Added ``re2c:cond:divider`` and ``re2c:cond:goto`` inplace configuration.
+- Fixed code generation to emit space after ``if``.
+
+0.13.1 (2007-08-24)
+~~~~~~~~~~~~~~~~~~~
+
+- Added custom build rules for Visual Studio 2005 (``re2c.rules``).
+ (William Swanson)
+- Fixed issue with some compilers.
+- Fixed #1776177 Build on AIX.
+- Fixed #1743180 ``fwrite`` with 0 length crashes on OS X.
+
+0.13.0 (2007-06-24)
+~~~~~~~~~~~~~~~~~~~
+
+- Added ``-c`` and ``-t`` to generate scanners with (f)lex-like condition
+ support.
+- Fixed issue with short form of switches and parameter if not first switch.
+- Fixed #1708378 segfault ``in actions.cc``.
+
+
+-----
+0.12x
+-----
+
+0.12.3 (2007-08-24)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed issue with some compilers.
+- Fixed #1776177 Build on AIX.
+- Fixed #1743180 ``fwrite`` with 0 length crashes on OS X.
+
+0.12.2 (2007-06-26)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed #1743180 ``fwrite`` with 0 length crashes on OS X.
+
+0.12.1 (2007-05-23)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed #1711240 problem with ``"`` and ``7F`` on EBCDIC plattforms.
+
+0.12.0 (2007-05-01)
+~~~~~~~~~~~~~~~~~~~
+
+- Re-release of 0.11.3 as new stable branch.
+- Fixed issue with short form of switches and parameter if not first switch.
+- Fixed #1708378 segfault in ``actions.cc``.
+- re2c 0.12.0 has been tested with the following compilers:
+
+ + gcc version 4.1.2 (Gentoo 4.1.2)
+ + gcc version 4.1.2 20070302 (prerelease) (4.1.2-1mdv2007.1)
+ + gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)
+ + gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
+ + gcc version 4.1.0 (SUSE Linux 10)
+ + gcc version 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1)
+ + gcc version 4.0.2 20050901 (prerelease) (SUSE Linux) (32 + 64 bit)
+ + MacPPC, gcc version 4.0.1 (Apple Computer, Inc. build 5367)
+ + MacIntel, gcc version 4.0.1 (Apple Computer, Inc. build 5250)
+ + gcc version 3.4.4 [FreeBSD] 20050518 (32 + 64 bit)
+ + gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
+ + gcc version 3.4.2 [FreeBSD]
+ + gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)
+ + gcc version 3.3.3 (PPC, 32 + 64 bit)
+ + Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.762 for x64 (64 bit)
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86 (Microsoft Visual C++ 2005)
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 (Mictosoft Visual C++ 2003)
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86 (Microsoft Visual C++ 2002)
+ + Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20070322Z Package ID: W_CC_C_9.1.037
+ + Intel(R) C++ Compiler for Intel(R) EM64T-based applications, Version 9.1 (64 bit)
+ + icpcbin (ICC) 9.1 20070215
+ + CC: Sun C++ 5.8 2005/10/13 (``CXXFLAGS='-library=stlport4'``)
+ + MIPSpro Compilers: Version 7.4.4m (32 + 64 bit)
+ + aCC: HP C/aC++ B3910B A.06.15 [Mar 28 2007] (HP-UX IA64)
+
+
+-----
+0.11x
+-----
+
+0.11.3 (2007-04-01)
+~~~~~~~~~~~~~~~~~~~
+
+- Added support for underscores in named definitions.
+- Added new option ``--no-generation-date``.
+- Fixed issue with long form of switches.
+
+0.11.2 (2007-03-01)
+~~~~~~~~~~~~~~~~~~~
+
+- Added inplace configuration ``re2c:yyfill:parameter``.
+- Added inplace configuration ``re2c:yych:conversion``.
+- Fixed ``-u`` switch code generation.
+- Added ability to avoid defines and overwrite generated variable names.
+
+0.11.1 (2007-02-20)
+~~~~~~~~~~~~~~~~~~~
+
+- Applied #1647875 Add ``const`` to ``yybm`` vector.
+
+0.11.0 (2007-01-01)
+~~~~~~~~~~~~~~~~~~~
+
+- Added ``-u`` switch to support unicode.
+
+
+-----
+0.10x
+-----
+
+0.10.8 (2007-04-01)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed issue with long form of switches.
+
+0.10.7 (2007-02-20)
+~~~~~~~~~~~~~~~~~~~
+
+- Applied #1647875 Add ``const`` to ``yybm`` vector.
+
+0.10.6 (2006-08-05)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed #1529351 Segv bug on unterminated code blocks.
+- Fixed #1528269 Invalid code generation.
+
+0.10.5 (2006-06-11)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed long form of ``-1`` switch to ``--single-pass`` as noted in man page
+ and help.
+- Added MSVC 2003 project files and renamed old 2002 ones.
+
+0.10.4 (2006-06-01)
+~~~~~~~~~~~~~~~~~~~
+
+- Fix whitespace in generated code.
+
+0.10.3 (2006-05-14)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed issue with ``-wb`` and ``-ws``.
+- Added ``-g`` switch to support gcc's computed goto's.
+- Changed to use nested ``if``'s instead of ``switch(yyaccept)`` in ``-s`` mode.
+
+0.10.2 (2006-05-01)
+~~~~~~~~~~~~~~~~~~~
+
+- Changed to generate ``YYMARKER`` only when needed or in single pass mode.
+- Added ``-1`` switch to force single pass generation and make two pass the
+ default.
+- Fixed ``-i`` switch.
+- Added configuration ``yyfill:enable`` to allow suppression of ``YYFILL()``
+ blocks.
+- Added tutorial like lessons to re2c.
+- Added ``/*!ignore:re2c */`` to support documenting of re2c source.
+- Fixed issue with multiline re2c comments (``/*!max:re2c ... */`` and alike).
+- Fixed generation of ``YYDEBUG()`` when using ``-d`` switch.
+- Added ``/*!getstate:re2c */`` which triggers generation of the
+ ``YYGETSTATE()`` block.
+- Added configuration ``state:abort``.
+- Changed to not generate ``yyNext`` unless configuration ``state:nextlabel`` is
+ used.
+- Changed to not generate ``yyaccept`` code unless needed.
+- Changed to use ``if`` instead of ``switch`` expression when ``yyaccpt`` has
+ only one case.
+- Added docu, examples and tests to ``.src.zip`` package (0.10.1 zip was
+ repackaged).
+- Fixed #1479044 incorrect code generated when using ``-b``.
+- Fixed #1472770 re2c creates an infinite loop.
+- Fixed #1454253 Piece of code saving a backtracking point not generated.
+- Fixed #1463639 Missing forward declaration.
+- Implemented #1187127 savable state support for multiple re2c blocks.
+- re2c 0.10.2 has been tested with the following compilers:
+
+ + gcc (GCC) 4.1.0 (Gentoo 4.1.0)
+ + gcc version 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1)
+ + gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)
+ + gcc (GCC) 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)
+ + gcc version 3.4.4 [FreeBSD] 20050518
+ + gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
+ + gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
+ + gcc-Version 3.3.5 (Debian 1:3.3.5-13)
+ + gcc-Version 3.3.0 (mips-sgi-irix6.5/3.3.0/specs)
+ + MIPSpro Compilers: Version 7.4.4m
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for
+ 80x86 (Microsoft Visual C++ 2005)
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
+ (Mictosoft Visual C++ 2003)
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
+ (Microsoft Visual C++ 2002)
+ + Intel(R) C++ Compiler for Intel(R) EM64T-based applications, Version 9.0
+ Build 20050430 Package ID: l_cc_p_9.0.021
+ + CC: Sun C++ 5.8 2005/10/13 (``CXXFLAGS='-library=stlport4'``)
+ + bison 2.1, 1.875d, 1.875b, 1.875
+
+0.10.1 (2006-02-28)
+~~~~~~~~~~~~~~~~~~~
+
+- Added support for Solaris and native SUN compiler.
+- Applied #1438160 expose ``YYCTXMARKER``.
+- re2c 0.10.1 has been tested with the following compilers:
+
+ + gcc version 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1)
+ + gcc version 4.0.2 (4.0.2-1mdk for Mandriva Linux release 2006.1)
+ + gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)
+ + gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
+ + gcc-Version 3.3.5 (Debian 1:3.3.5-13)
+ + gcc-Version 3.3.0 (mips-sgi-irix6.5/3.3.0/specs)
+ + MIPSpro Compilers: Version 7.4.4m
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for
+ 80x86 (Microsoft Visual C 2005)
+ + Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
+ (Microsoft Visual C 2002)
+ + Intel(R) C++ Compiler for 32-bit applications, Version 9.0 Build 20051130Z
+ Package ID: W_CC_C_9.0.028
+ + CC: Sun C++ 5.8 2005/10/13 (``CXXFLAGS='-compat5 -library=stlport4'``)
+ + bison 2.1, 1.875d, 1.875b, 1.875
+
+0.10.0 (2006-02-18)
+~~~~~~~~~~~~~~~~~~~
+
+- Added make target ``zip`` to create windows source packages as zip files.
+- Added ``re2c:startlabel`` configuration.
+- Fixed code generation to not generate unreachable code for initial state.
+- Added support for c/c++ compatible ``\u`` and ``\U`` unicode notation.
+- Added ability to control indendation.
+- Made scanner error out in case an ambiguous ``/*`` is found.
+- Fixed indendation of generated code.
+- Added support for DOS line endings.
+- Added experimental unicode support.
+- Added ``config_w32.h`` to build out of the box on windows (using msvc 2002+).
+- Added Microsoft Visual C .NET 2005 build files.
+- Applied #1411087 variable length trailing context.
+- Applied #1408326 do not generate ``goto`` next state.
+- Applied #1408282 ``CharSet`` initialization fix.
+- Applied #1408278 ``readsome`` with MSVC.
+- Applied #1307467 Unicode patch for 0.9.7.
+
+
+----
+0.9x
+----
+
+0.9.12 (2005-12-28)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed bug #1390174 re2c cannot accept ``{0,}``.
+
+0.9.11 (2005-12-18)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed #1313083 ``-e`` (EBCDIC cross compile) broken.
+- Fixed #1297658 underestimation of ``n`` in ``YYFILL(n)``.
+- Applied #1339483 Avoid rebuilds of re2c when running subtargets.
+- Implemented #1335305 symbol table reimplementation, just slightly modifed.
+
+0.9.10 (2005-09-04)
+~~~~~~~~~~~~~~~~~~~
+
+- Add ``-i`` switch to avoid generating ``#line`` information.
+- Fixed bug #1251653 re2c generate some invalid ``#line`` on WIN32.
+
+0.9.9 (2005-07-21)
+~~~~~~~~~~~~~~~~~~~
+
+- Implemented #1232777 negated char classes ``[^...]`` and the dot operator ``.``.
+- Added hexadecimal character definitions.
+- Added consistency check for octal character definitions.
+
+0.9.8 (2005-06-26)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixed code generation for ``-b`` switch.
+- Added Microsoft Visual C .NET build files.
+
+0.9.7 (2005-04-30)
+~~~~~~~~~~~~~~~~~~~
+
+- Applied #1181535 storable state patch.
+- Added ``-d`` flag which outputs a debugable parser.
+- Fixed generation of ``#line`` directives (according to ISO-C99).
+- Fixed bug #1187785 Re2c fails to generate valid code.
+- Fixed bug #1187452 unused variable ``yyaccept``.
+
+0.9.6 (2005-04-14)
+~~~~~~~~~~~~~~~~~~~
+
+- Fix build with gcc >= 3.4.
+
+0.9.5 (2005-04-08)
+~~~~~~~~~~~~~~~~~~~
+
+- Added ``/*!max:re2c */`` which emits ``#define YYMAXFILL <max>``
+ line. This allows to define buffers of the minimum required length.
+ Occurence must follow ``/*re2c */`` and cannot preceed it.
+- Changed re2c to two pass generation to output warning free code.
+- Fixed bug #1163046 re2c hangs when processing valid re-file.
+- Fixed bug #1022799 re2c scanner has buffering bug.
+
+0.9.4 (2005-03-12)
+~~~~~~~~~~~~~~~~~~~
+
+- Added ``--vernum`` support.
+- Fixed bug #1054496 incorrect code generated with ``-b`` option.
+- Fixed bug #1012748 re2c does not emit last line if ``\n`` missing.
+- Fixed bug #999104 ``--output=output`` option does not work as documented.
+- Fixed bug #999103 Invalid options prefixed with two dashes cause program
+ crash.
+
+0.9.3 (2004-05-26)
+~~~~~~~~~~~~~~~~~~~
+
+- Fixes one small possible bug in the generated output. ``ych`` instead of
+ ``yych`` is output in certain circumstances.
+
+0.9.2 (2004-05-26)
+~~~~~~~~~~~~~~~~~~~
+
+- Added ``-o`` option to specify the output file which also will set the
+ ``#line`` directives to something useful.
+- Print version to ``cout`` instead of ``cerr``.
+- Added ``-h`` and ``--`` style options.
+- Moved development to http://sourceforge.net/projects/re2c
+- Fixed bug #960144 minor cosmetic problem.
+- Fixed bug #953181 cannot compile with.
+- Fixed bug #939277 Windows support.
+- Fixed bug #914462 automake build patch
+- Fixed bug #891940 braced quantifiers: ``{\d+(,|,\d+)?}`` style.
+- Fixed bug #869298 Add case insensitive string literals.
+- Fixed bug #869297 Input buffer overrun.
+
+0.9.1 (2003-12-13)
+~~~~~~~~~~~~~~~~~~~
+
+- Removed rcs comments in source files.
+
+-------------------------
+re2c adopted (2003-12-09)
+-------------------------
+
+- Version 0.9.1 README::
+
+ Originally written by Peter Bumbulis (peter@csg.uwaterloo.ca)
+ Currently maintained by Brian Young (bayoung@acm.org)
+
+ The re2c distribution can be found at:
+ http://www.tildeslash.org/re2c/index.html
+
+ The source distribution is available from:
+ http://www.tildeslash.org/re2c/re2c-0.9.1.tar.gz
+
+ This distribution is a cleaned up version of the 0.5 release
+ maintained by me (Brian Young). Several bugs were fixed as well
+ as code cleanup for warning free compilation. It has been
+ developed and tested with egcs 1.0.2 and gcc 2.7.2.3 on Linux x86.
+ Peter Bumbulis' original release can be found at:
+ ftp://csg.uwaterloo.ca/pub/peter/re2c.0.5.tar.gz
+
+ re2c is a great tool for writing fast and flexible lexers.
+ It has served many people well for many years and it deserves
+ to be maintained more actively. re2c is on the order of 2-3
+ times faster than a flex based scanner, and its input model
+ is much more flexible.
+
+ Patches and requests for features will be entertained. Areas
+ of particular interest to me are porting (a Solaris and an NT
+ version will be forthcoming) and wide character support. Note
+ that the code is already quite portable and should be buildable
+ on any platform with minor makefile changes.
+
+- Version 0.5 Peter's original ANNOUNCE and README::
+
+ re2c is a tool for generating C-based recognizers from regular
+ expressions. re2c-based scanners are efficient: for programming
+ languages, given similar specifications, an re2c-based scanner
+ is typically almost twice as fast as a flex-based scanner with
+ little or no increase in size (possibly a decrease on cisc
+ architectures). Indeed, re2c-based scanners are quite competitive
+ with hand-crafted ones.
+
+ Unlike flex, re2c does not generate complete scanners: the user
+ must supply some interface code. While this code is not bulky
+ (about 50-100 lines for a flex-like scanner; see the man page
+ and examples in the distribution) careful coding is required for
+ efficiency (and correctness). One advantage of this arrangement
+ is that the generated code is not tied to any particular input
+ model. For example, re2c generated code can be used to scan
+ data from a null-byte terminated buffer as illustrated below.
+
+ Given the following source:
+
+ #define NULL ((char*) 0)
+ char *scan(char *p) {
+ char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT p
+ #define YYMARKER q
+ #define YYFILL(n)
+ /*!re2c
+ [0-9]+ {return YYCURSOR;}
+ [\000-\377] {return NULL;}
+ */
+ }
+
+ re2c will generate:
+
+ /* Generated by re2c on Sat Apr 16 11:40:58 1994 */
+ #line 1 "simple.re"
+ #define NULL ((char*) 0)
+ char *scan(char *p) {
+ char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT p
+ #define YYMARKER q
+ #define YYFILL(n)
+ {
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ goto yy0;
+ yy1: ++YYCURSOR;
+ yy0:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '/') goto yy4;
+ if(yych >= ':') goto yy4;
+ yy2: yych = *++YYCURSOR;
+ goto yy7;
+ yy3:
+ #line 10
+ {return YYCURSOR;}
+ yy4: yych = *++YYCURSOR;
+ yy5:
+ #line 11
+ {return NULL;}
+ yy6: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ yy7: if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy6;
+ goto yy3;
+ }
+ #line 12
+
+ }
+
+ Note that most compilers will perform dead-code elimination to
+ remove all YYCURSOR, YYLIMIT comparisions.
+
+ re2c was developed for a particular project (constructing a fast
+ REXX scanner of all things!) and so while it has some rough edges,
+ it should be quite usable. More information about re2c can be
+ found in the (admittedly skimpy) man page; the algorithms and
+ heuristics used are described in an upcoming LOPLAS article
+ (included in the distribution). Probably the best way to find out
+ more about re2c is to try the supplied examples. re2c is written in
+ C++, and is currently being developed under Linux using gcc 2.5.8.
+
+ Peter
--- /dev/null
+=============
+Release notes
+=============
+
+.. toctree::
+ :hidden:
+
+ /releases/changelog/changelog
+
+.. include:: /releases/release_notes/1_2_1.rst
+.. include:: /releases/release_notes/1_2.rst
+.. include:: /releases/release_notes/1_1_1.rst
+.. include:: /releases/release_notes/1_1.rst
+.. include:: /releases/release_notes/1_0_3.rst
+.. include:: /releases/release_notes/1_0_2.rst
+.. include:: /releases/release_notes/1_0_1.rst
+.. include:: /releases/release_notes/1_0.rst
+.. include:: /releases/release_notes/0_16.rst
+.. include:: /releases/release_notes/0_15_3.rst
+.. include:: /releases/release_notes/0_15_2.rst
+.. include:: /releases/release_notes/0_15_1.rst
+.. include:: /releases/release_notes/0_15.rst
--- /dev/null
+Release 0.15
+============
+
+This release started out in the spring of 2015 as a relatively simple code cleanup.
+
+It focused on the following problem: re2c used to repeat the whole generation process multiple times.
+Some parts of the generated program depend on the overall input statistics;
+they cannot be generated until the whole input has been processed.
+The usual strategy is to make stubs for all such things and fix them later.
+Instead, re2c used to process the whole input, gather statistics,
+discard the generated output, and regenerate it from scratch.
+Moreover, each generation pass further duplicated certain calculations (for similar reasons).
+As a result, the code generation phase was repeated four times.
+
+The problem here was not inefficiency: re2c is fast enough to allow the 4x overhead.
+The real problem was the complexity of the code: the developer has to think of multiple execution layers all the time.
+Some parts of code are only executed on certain layers and affect each other.
+Simple reasoning gets really hard.
+
+So the main purpose of this release was to simplify the code and make it easier to fix bugs and add new features.
+Very soon it became clear that some of the changes in code generation are hard to verify by hand.
+For example, even a minor rebalancing of ``if`` and ``switch`` statements
+may change the generated code significantly.
+It was clear that re2c needed an automatic verification tool,
+which lead to the idea of generating :ref:`skeleton programs <manual/manual:skeleton programs>`.
+
+Meanwhile some work was done on adding :ref:`warnings <manual/manual:warnings>`,
+updating the build system and fixing various bugs.
+A heart-warming consequence of the code simplification is that re2c now uses re2c more extensively:
+not only the main program, but also the command-line options, inplace configurations,
+and all kinds of escaped strings are parsed with re2c.
+Website has also been updated (feel free to suggest improvements).
+
+See the changelog :ref:`releases/changelog/changelog:0.15 (2015-11-22)` for details.
+
+
--- /dev/null
+Release 0.15.1
+==============
+
+This release fixes an error in the testing script
+(thanks to Sergei Trofimovich who reported the bug and suggested a quick fix).
+See the changelog :ref:`releases/changelog/changelog:0.15.1 (2015-11-22)` for details.
+
--- /dev/null
+Release 0.15.2
+==============
+
+This release fixes a bug in the build system:
+it adds a missing dependency of the lexer on the bison-generated header
+(`reported <https://bugs.gentoo.org/show_bug.cgi?id=566620>`_ on Gentoo bugtracker).
+See the changelog :ref:`releases/changelog/changelog:0.15.2 (2015-11-23)` for details.
--- /dev/null
+Release 0.15.3
+==============
+
+This release fixes multiple build-time and run-time failures on OS X, FreeBSD, and Windows.
+Most of the problems were reported and fixed by Oleksii Taran (on OS X)
+and Sergei Trofimovich (on FreeBSD and Windows).
+Thank you for your help!
+
+:ref:`Skeleton <manual/manual:skeleton programs>` coverage has been improved.
+
+See the changelog :ref:`releases/changelog/changelog:0.15.3 (2015-12-02)` for details.
+
--- /dev/null
+Release 0.16
+==============
+
+This release adds a very important step in the process of code generation:
+minimization of the underlying DFA (deterministic finite automaton).
+Simply speaking, this means that re2c now generates less code
+(while the generated code behaves exactly the same).
+
+DFA minimization is a very well-known technique
+and one might expect that any self-respecting lexer generator would definitely use it.
+So how could it be that re2c didn't?
+In fact, re2c did use a couple of self-invented tricks to compress the generated code
+(one interesting technique is the construction of a *tunnel* automaton).
+Some of these tricks were quite buggy (see `this bug report <https://bugs.gentoo.org/show_bug.cgi?id=518904>`_ for example).
+Now that re2c does canonical DFA minimization, all this stuff is obsolete and has been dropped.
+
+A lot of attention has been paid to the correctness of the DFA minimization.
+Usually, re2c uses a very simple criterion to validate changes:
+the generated code for all the tests in testsuite must remain the same.
+However, in the case of DFA minimization the generated code changes dramatically.
+It is impossible to verify the changes manually.
+
+One possible verification tool is the :ref:`skeleton<manual/manual:skeleton programs>` feature.
+Because skeleton is constructed prior to DFA minimization, it cannot be affected by any errors in its implementation.
+
+Another way to verify DFA minimization is by implementing two different algorithms
+and comparing the results. The minimization procedure has a very useful property:
+the miminal DFA is unique (with respect to state relabeling).
+We used the Moore and the so-called *table filling* algorithms:
+The Moore algorithm is fast, while table filling is very simple to implement.
+The ``--dfa-minimization <moore | table>`` option that allows choosing
+the particular algorithm (defaults to ``moore``), but it's only useful for debugging
+DFA minimization.
+
+A good side effect of messing with re2c internals is a significant speedup
+of code generation (see `this issue <https://github.com/skvadrik/re2c/issues/128>`_ for example).
+The test suite now runs twice as fast (at least).
+
+See the changelog :ref:`releases/changelog/changelog:0.16 (2016-01-21)` for details.
+
--- /dev/null
+Release 1.0
+===========
+
+This release is an important milestone in the history of re2c: it adds *submatch extraction*.
+It is a long-awaited feature; even as Peter Bumbulis released the first version of re2c back in 1993,
+he mentioned submatch extraction in his paper together with Donald D. Cowan
+`"RE2C: a more versatile scanner generator" <../../1994_bumbulis_cowan_re2c_a_more_versatile_scanner_generator.ps>`_
+as a useful feature that soon should be added to re2c.
+It seemed back then that submatch extraction is relatively easy to implement;
+like many other useful extensions, it was deemed to be no more than syntactic sugar on top of canonical regular expressions.
+
+As it turned out, this is not so:
+the problem of *parsing* with regular expressions is inherently more complex than *recognition*,
+and submatch extraction cannot be implemented using traditional DFA-based approach.
+Many authors studied this subject and developed algorithms suitable for their particular settings and problem domains.
+Some of them used NFA-based approach,
+others suggested algorithms based on multiple DFA or multiple passes over a single DFA.
+For re2c most of these algorithms are too heavyweight:
+they require complication of the underlying computational model and incur overhead even in simple cases.
+
+However, one algorithm is outstanding in this respect:
+it is the algorithm invented by Ville Laurikari in 2000 and described in his paper
+`"NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions"
+<http://laurikari.net/ville/spire2000-tnfa.pdf>`_.
+Laurikari algorithm is based on a single DFA extended with a fixed number of *registers*; it makes one pass over the input string,
+works in linear time and the required space does not depend on the input length.
+But what is most important, the added complexity depends on submatch detalization:
+on submatch-free regular expressions Laurikari automaton reduces to a simple DFA.
+
+When the work on submatch extraction feature started in early 2016,
+at first it seemed that Laurikari algorithm was still overly complicated.
+Re2c needed an algorithm that would support only *partial* submatch extraction,
+but the supported cases would be handled very efficiently.
+A lot of effort was spent on studying papers,
+and finally this lead to the development of a new algorithm.
+It soon became clear that the self-invented algorithm was in fact a special case of Laurikari algorithm,
+with one significant performance improvement: the use of lookahead symbol.
+Surprisingly, the original Laurikari algorithm has a strange deficiency:
+when recording submatches, the automata totally ignore the lookahead symbol
+and perform a lot of redundant operations that could be easily avoided.
+It was only logical to fix Laurikari algorithm.
+The new improved algorithm is described in the paper
+`"Tagged Deterministic Finite Automata with Lookahead" <../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf>`_
+
+Submatch extraction in re2c comes in two flavors:
+POSIX-compliant capturing groups (with true POSIX semantics)
+and standalone *tags* that use leftmost greedy disambiguation.
+Both features require a number of new API primitives and configurations;
+and they are barely documented yet (though I managed to add a section in the manual).
+The paper cited above has some interesting benchmark results;
+articles and examples will follow in the nearest future.
+As usually, you may expect a number of small bug-fix releases in the 1.0.x series.
+
+The following people contributed to this release:
+
+* Petr Skocik tidied up re2c documentation: fixed ubiquitous spelling errors
+ and established synchronization system between the online documentation,
+ manpage and help message displayed by re2c with ``--help`` option.
+
+* Sergei Trofimovich wrote a *fuzzer* that generates random regular expressions
+ and checks them on input data generated with re2c ``--skeleton`` option.
+ This fuzzer is most helpful; it has already found tens of bugs in the early implementation of submatch extraction.
+ Sergei also helped me with testing re2c on numerous platforms and computer architectures.
+
+* Abs62,
+ asmwarrior,
+ Ben Smith,
+ CRCinAU,
+ Derick Rethans,
+ Dimitri John Ledkov,
+ Eldar Zakirov,
+ jcfp,
+ Jean-Claude Wippler,
+ Jeff Trull,
+ Jérôme Dumesnil,
+ Jesse Buesking,
+ Julian Andres Klode,
+ Paulo Custodio,
+ Perry E. Metzger,
+ philippschaefer,
+ Ross Burton,
+ Rui Maciel,
+ Ryan Mast,
+ Samuel006,
+ sirzooro,
+ Tim Kelly
+ --- all these people contributed bug reports, patches and feedback. Thank you!
+
+* Many thanks to the early user of the new features João Paredes for his patience and encouraging comments on the subject.
+
+See the changelog :ref:`releases/changelog/changelog:1.0 (2017-08-11)` for details.
+
+
--- /dev/null
+Release 1.0.1
+=============
+
+This is a minor bug-fix release.
+It fixes a build failure on Mac OS X (thanks to ilovezf for the bug report).
+See the changelog :ref:`releases/changelog/changelog:1.0.1 (2017-08-11)` for details.
+
--- /dev/null
+Release 1.0.2
+=============
+
+This is another minor bug-fix release.
+It addresses some documentation issues (thanks to Ziris85 for the bug report).
+See the changelog :ref:`releases/changelog/changelog:1.0.2 (2017-08-26)` for details.
+
--- /dev/null
+Release 1.0.3
+=============
+
+Yet another minor bug-fix release.
+It fixes a build failure on Mac OS X (thanks to Ryan Shmidt for the bug report).
+See the changelog :ref:`releases/changelog/changelog:1.0.3 (2017-11-08)` for details.
--- /dev/null
+Release 1.1
+=============
+
+This release doesn't bring in any serious user-visible changes;
+most of the work concentrated on the internal POSIX disambiguation algorithm
+used for submatch extraction with ``--posix-captures`` option.
+The old algorithm, introduced in `release 1.0 <./1_0.html>`_, was based on the work of Chris Kuklewicz
+(outlined on this `haskell wiki page <https://wiki.haskell.org/index.php?title=Regular_expressions/Bounded_space_proposal&oldid=11475>`_
+and formalized in the paper `Tagged Deterministic Finite Automata with Lookahead
+<http://re2c.org/2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf>`_).
+Kuklewicz algorithm was replaced with a totally different algorithm
+based on the work of Satoshi Okui and Taro Suzuki (described in the paper
+"Disambiguation in Regular Expression Matching via Position Automata with Augmented Transitions", year 2013).
+The main effort in this release was in developing proper theoretical foundations for the new algorithm.
+As usual, there has been a couple of bug fixes.
+
+See the changelog :ref:`releases/changelog/changelog:1.1 (2018-08-27)` for details.
+
--- /dev/null
+Release 1.1.1
+=============
+
+This is a minor bug-fix release.
+It fixes a crash with ``-V`` ``--vernum`` option.
+The crash was reported and fixed by Mike Gilbert,
+and later rediscovered by Daniel J. Luke and Perry E. Metzger.
+Sergei Trofimovich made a unit test, as the ``-V`` ``--vernum`` option has already caused some troubles in the past.
+See the changelog :ref:`releases/changelog/changelog:1.1.1 (2018-08-30)` for details.
+Thanks everyone!
--- /dev/null
+Release 1.2
+===========
+
+This release adds a handful of useful features and finalizes two-year
+research effort on POSIX disambiguation.
+
+First and foremost, :ref:`EOF rule <manual/manual:eof rule>` has been added to
+re2c. It is a new method of checking for the end of input, which aims at being
+both generic and simple to use. Historically re2c has a
+:ref:`number of ways <manual/manual:eof handling>` to handle EOF situation. The
+simplest and the most efficient method is
+:ref:`using a sentinel symbol <manual/manual:using sentinel symbol>`, but it
+has limited applicability. The most widely used and generic method is
+:ref:`bounds checking with padding <manual/manual:bounds checking with padding>`,
+but it is rather complex and requires input buffering.
+Finally, it is possible to define custom EOF handling methods
+by :ref:`using the generic API <manual/manual:using generic api>`. However, such
+methods are not necessarily correct and are likely to be slower than other
+methods. The new method, EOF rule, tries to combine the simplicity and
+efficiency of the sentinel symbol and the generality of bounds checking.
+Essentially, all the user is required to do is to specify an arbitrary "fake"
+sentinel using ``re2c:eof`` configuration (zero is usually a good choice), to
+define a special EOF rule ``$``, and to make sure that the fake sentinel is
+always the last symbol in the input buffer. The lexer will then run without end
+of input checks until it hits the branch corresponding to the fake sentinel, at
+which point it will perform additional bounds checking. If indeed it is the end,
+the lexer will try to get more input. If this attempt fails, the lexer will
+either rollback to the last matched rule (or the default rule, if it has
+consumed some input but did not match), or else it will go to EOF rule.
+Depending on each particular case and the choice of sentinel, the performance of
+EOF rule may be slightly better or worse than bounds checking with padding.
+See the user manual for more details and examples.
+
+Another important new feature is the possibility to :ref:`include other files
+<manual/manual:include files>`. Re2c provides a directive
+``/*!include:re2c "file.re" */``, where ``file.re`` is the name of the included
+file.
+Re2c looks for included files in the directory of the including file and in the
+include locations, which can be specified with ``-I`` option. Include files
+may have further includes of their own. Re2c provides some predefined include
+files that can be found in the ``include/`` sub-directory of the project. These
+files contain useful definitions and form something like a standard library
+for re2c. Currently there is one available include, ``unicode_categories.re``.
+
+Re2c now allows to :ref:`generate header file <manual/manual:header files>`
+from the input file using option ``-t --type-header`` or
+``re2c:flags:t`` and ``re2c:flags:type-header`` configurations and the newly
+added directives ``/*!header:re2c:on*/`` and ``/*!header:re2c:off*/``.
+Header files may be needed in cases when re2c is used to generate definitions
+of constants, variables and structs that must be visible from other translation
+units.
+
+Re2c can now understand UTF8-encoded string literals and character classes in
+regular expressions. By default, re2c parses regular expressions like
+``"∀x ∃y"`` as a sequence of 1-byte ASCII code points
+``e2 88 80 78 20 e2 88 83 79`` (hexadecimal), and the users have to escape
+Unicode symbols manually: ``"\u2200x \u2203y"``. This is not what most users
+would expect, as demonstrated by multiple issues on the bugtracker. The new
+option ``--input-encoding <ascii | utf8>`` allows to change the default
+behavior and parse ``"∀x ∃y"`` as a sequence of 4-byte Unicode code points
+``2200 78 20 2203 79`` (hexadecimal). Note that the new option affects only
+parsing, and not the code generation.
+
+Re2c now allows to mix :ref:`reusable blocks <manual/manual:reusable blocks>`
+with normal blocks when ``-r --reuse`` option is used. This is very useful in
+cases when the input file contains many re2c blocks, and only some of them need
+to be reused (a good example is re2c own lexer, which has to use certain rules
+twice in order to generate ASCII and UTF8 lexer variants for
+``--input-encoding <ascii | utf8>`` option).
+
+It is now possible to specify location format in re2c-generated messages with
+``--location-format <gnu | msvc>`` option. As one might guess, possible
+arguments are GNU location format ``filename:line:column:`` (the default) and
+MSVC format ``filename(line,column)``. This option might help IDE users.
+Another new option is ``--verbose`` --- it prints a short "success" message in
+case re2c exits successfully.
+
+Flex compatibility mode (enabled with ``-F --flex-support`` option) has been
+improved: parsing errors and incorrect operator precedence in some rare cases
+have been fixed. Historically re2c allows to mix flex-style code with re2c-style
+code, which creates certain difficulties for the parser. Such difficulties can
+be resolved by passing parts of the parser context to the lexer.
+
+The difference operator ``/`` is now applied to its operands before encoding
+expansion. Re2c supports difference only for character classes, and encoding
+expansion in case of a variable-length encoding may transform even a simple
+character class into a complex graph (see
+`the graph <../../_images/utf8_any.png>`_ for ``[^]`` in UTF8 for example).
+Applying expansion after difference makes ``/`` applicable in more cases.
+
+Re2c now generates the output file atomically: it first creates a temporary file
+and writes the generated output into it, and then renames the temporary file to
+the output file.
+
+Documentation has been rearranged and updated, and the website has been
+fixed to look somewhat better on mobile devices (hopefully).
+
+From developers standpoint, re2c now has better debugging capabilities. Debug
+code has been moved in a separate subsystem and is no longer built in release
+binaries (debug builds are enabled with ``--enable-debug`` configure option).
+New debug options and passes have been added.
+
+This release has taken almost a year, mostly because of the time needed to
+formalize the extended algorithm for POSIX disambiguation and write a formal
+paper `Efficient POSIX Submatch Extraction on NFA
+<../../2019_borsotti_trofimovich_efficient_posix_submatch_extraction_on_nfa.pdf>`_.
+The algorithms described in the paper are implemented in an experimental
+library ``libre2c``. The library is intended as a playground for experiments
+and research, not a replacement for existing libraries like RE2. Having re2c
+as a library is convenient for benchmarking, testing and creating bindings to
+other languages.
+To build the library and benchmarks, configure re2c with ``--enable-libs`` option.
+
+Many people have contributed to this release.
+Angelo Borsotti co-authored the paper; his hard work has revealed multiple
+shortcomings and deficiencies in the algorithms used in re2c.
+Henri Salo helped with fuzz-testing re2c using the American Fuzzy Lop.
+Denis Naumov helped with Windows portability issues.
+Sergei Trofimovich fixed a number of bugs;
+he and Serghei Iakovlev helped with the Travis CI infrastructure.
+Wesley Terpstra used re2c in the open-source
+`wake build tool <https://github.com/sifive/wake>`_.
+Many thanks to them and all the others who contributed to this release!
+
+A lot of bugs have been fixed.
+See the changelog :ref:`releases/changelog/changelog:1.2 (2019-08-02)` for details.
--- /dev/null
+Release 1.2.1
+=============
+
+This is a minor release that improves some of the features introduced in 1.2.
+First, it is now possible to reset ``re2c:eof`` configuration to the
+default value by setting it to ``-1``. Second, re2c now installs standard
+include files to ``$(datadir)/re2c/stdlib``, where ``$(datadir)`` is
+``/usr/share`` by default (but can be configured otherwise). When looking for
+include files, re2c automatically tries this directory --- there is no need
+to add it manually with ``-I``.
+Both issues have been reported by Wesley W. Terpstra. Thank you!
+
+See the changelog :ref:`releases/changelog/changelog:1.2.1 (2019-08-11)` for details.
--- /dev/null
+/*
+ * basic.css
+ * ~~~~~~~~~
+ *
+ * Sphinx stylesheet -- basic theme.
+ *
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/* -- main layout ----------------------------------------------------------- */
+
+div.clearer {
+ clear: both;
+}
+
+/* -- relbar ---------------------------------------------------------------- */
+
+div.related {
+ width: 100%;
+ font-size: 90%;
+}
+
+div.related h3 {
+ display: none;
+}
+
+div.related ul {
+ margin: 0;
+ padding: 0 0 0 10px;
+ list-style: none;
+}
+
+div.related li {
+ display: inline;
+}
+
+div.related li.right {
+ float: right;
+ margin-right: 5px;
+}
+
+/* -- sidebar --------------------------------------------------------------- */
+
+div.sphinxsidebarwrapper {
+ padding: 10px 5px 0 10px;
+}
+
+div.sphinxsidebar {
+ float: left;
+ width: 230px;
+ margin-left: -100%;
+ font-size: 90%;
+ word-wrap: break-word;
+ overflow-wrap : break-word;
+}
+
+div.sphinxsidebar ul {
+ list-style: none;
+}
+
+div.sphinxsidebar ul ul,
+div.sphinxsidebar ul.want-points {
+ margin-left: 20px;
+ list-style: square;
+}
+
+div.sphinxsidebar ul ul {
+ margin-top: 0;
+ margin-bottom: 0;
+}
+
+div.sphinxsidebar form {
+ margin-top: 10px;
+}
+
+div.sphinxsidebar input {
+ border: 1px solid #98dbcc;
+ font-family: sans-serif;
+ font-size: 1em;
+}
+
+div.sphinxsidebar #searchbox input[type="text"] {
+ float: left;
+ width: 80%;
+ padding: 0.25em;
+ box-sizing: border-box;
+}
+
+div.sphinxsidebar #searchbox input[type="submit"] {
+ float: left;
+ width: 20%;
+ border-left: none;
+ padding: 0.25em;
+ box-sizing: border-box;
+}
+
+
+img {
+ border: 0;
+ max-width: 100%;
+}
+
+/* -- search page ----------------------------------------------------------- */
+
+ul.search {
+ margin: 10px 0 0 20px;
+ padding: 0;
+}
+
+ul.search li {
+ padding: 5px 0 5px 20px;
+ background-image: url(file.png);
+ background-repeat: no-repeat;
+ background-position: 0 7px;
+}
+
+ul.search li a {
+ font-weight: bold;
+}
+
+ul.search li div.context {
+ color: #888;
+ margin: 2px 0 0 30px;
+ text-align: left;
+}
+
+ul.keywordmatches li.goodmatch a {
+ font-weight: bold;
+}
+
+/* -- index page ------------------------------------------------------------ */
+
+table.contentstable {
+ width: 90%;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table.contentstable p.biglink {
+ line-height: 150%;
+}
+
+a.biglink {
+ font-size: 1.3em;
+}
+
+span.linkdescr {
+ font-style: italic;
+ padding-top: 5px;
+ font-size: 90%;
+}
+
+/* -- general index --------------------------------------------------------- */
+
+table.indextable {
+ width: 100%;
+}
+
+table.indextable td {
+ text-align: left;
+ vertical-align: top;
+}
+
+table.indextable ul {
+ margin-top: 0;
+ margin-bottom: 0;
+ list-style-type: none;
+}
+
+table.indextable > tbody > tr > td > ul {
+ padding-left: 0em;
+}
+
+table.indextable tr.pcap {
+ height: 10px;
+}
+
+table.indextable tr.cap {
+ margin-top: 10px;
+ background-color: #f2f2f2;
+}
+
+img.toggler {
+ margin-right: 3px;
+ margin-top: 3px;
+ cursor: pointer;
+}
+
+div.modindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+div.genindex-jumpbox {
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ margin: 1em 0 1em 0;
+ padding: 0.4em;
+}
+
+/* -- domain module index --------------------------------------------------- */
+
+table.modindextable td {
+ padding: 2px;
+ border-collapse: collapse;
+}
+
+/* -- general body styles --------------------------------------------------- */
+
+div.body {
+ min-width: 450px;
+ max-width: 800px;
+}
+
+div.body p, div.body dd, div.body li, div.body blockquote {
+ -moz-hyphens: auto;
+ -ms-hyphens: auto;
+ -webkit-hyphens: auto;
+ hyphens: auto;
+}
+
+a.headerlink {
+ visibility: hidden;
+}
+
+h1:hover > a.headerlink,
+h2:hover > a.headerlink,
+h3:hover > a.headerlink,
+h4:hover > a.headerlink,
+h5:hover > a.headerlink,
+h6:hover > a.headerlink,
+dt:hover > a.headerlink,
+caption:hover > a.headerlink,
+p.caption:hover > a.headerlink,
+div.code-block-caption:hover > a.headerlink {
+ visibility: visible;
+}
+
+div.body p.caption {
+ text-align: inherit;
+}
+
+div.body td {
+ text-align: left;
+}
+
+.first {
+ margin-top: 0 !important;
+}
+
+p.rubric {
+ margin-top: 30px;
+ font-weight: bold;
+}
+
+img.align-left, .figure.align-left, object.align-left {
+ clear: left;
+ float: left;
+ margin-right: 1em;
+}
+
+img.align-right, .figure.align-right, object.align-right {
+ clear: right;
+ float: right;
+ margin-left: 1em;
+}
+
+img.align-center, .figure.align-center, object.align-center {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.align-left {
+ text-align: left;
+}
+
+.align-center {
+ text-align: center;
+}
+
+.align-right {
+ text-align: right;
+}
+
+/* -- sidebars -------------------------------------------------------------- */
+
+div.sidebar {
+ margin: 0 0 0.5em 1em;
+ border: 1px solid #ddb;
+ padding: 7px 7px 0 7px;
+ background-color: #ffe;
+ width: 40%;
+ float: right;
+}
+
+p.sidebar-title {
+ font-weight: bold;
+}
+
+/* -- topics ---------------------------------------------------------------- */
+
+div.topic {
+ border: 1px solid #ccc;
+ padding: 7px 7px 0 7px;
+ margin: 10px 0 10px 0;
+}
+
+p.topic-title {
+ font-size: 1.1em;
+ font-weight: bold;
+ margin-top: 10px;
+}
+
+/* -- admonitions ----------------------------------------------------------- */
+
+div.admonition {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ padding: 7px;
+}
+
+div.admonition dt {
+ font-weight: bold;
+}
+
+div.admonition dl {
+ margin-bottom: 0;
+}
+
+p.admonition-title {
+ margin: 0px 10px 5px 0px;
+ font-weight: bold;
+}
+
+div.body p.centered {
+ text-align: center;
+ margin-top: 25px;
+}
+
+/* -- tables ---------------------------------------------------------------- */
+
+table.docutils {
+ border: 0;
+ border-collapse: collapse;
+}
+
+table.align-center {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+table caption span.caption-number {
+ font-style: italic;
+}
+
+table caption span.caption-text {
+}
+
+table.docutils td, table.docutils th {
+ padding: 1px 8px 1px 5px;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
+ border-bottom: 1px solid #aaa;
+}
+
+table.footnote td, table.footnote th {
+ border: 0 !important;
+}
+
+th {
+ text-align: left;
+ padding-right: 5px;
+}
+
+table.citation {
+ border-left: solid 1px gray;
+ margin-left: 1px;
+}
+
+table.citation td {
+ border-bottom: none;
+}
+
+/* -- figures --------------------------------------------------------------- */
+
+div.figure {
+ margin: 0.5em;
+ padding: 0.5em;
+}
+
+div.figure p.caption {
+ padding: 0.3em;
+}
+
+div.figure p.caption span.caption-number {
+ font-style: italic;
+}
+
+div.figure p.caption span.caption-text {
+}
+
+/* -- field list styles ----------------------------------------------------- */
+
+table.field-list td, table.field-list th {
+ border: 0 !important;
+}
+
+.field-list ul {
+ margin: 0;
+ padding-left: 1em;
+}
+
+.field-list p {
+ margin: 0;
+}
+
+.field-name {
+ -moz-hyphens: manual;
+ -ms-hyphens: manual;
+ -webkit-hyphens: manual;
+ hyphens: manual;
+}
+
+/* -- other body styles ----------------------------------------------------- */
+
+ol.arabic {
+ list-style: decimal;
+}
+
+ol.loweralpha {
+ list-style: lower-alpha;
+}
+
+ol.upperalpha {
+ list-style: upper-alpha;
+}
+
+ol.lowerroman {
+ list-style: lower-roman;
+}
+
+ol.upperroman {
+ list-style: upper-roman;
+}
+
+dl {
+ margin-bottom: 15px;
+}
+
+dd p {
+ margin-top: 0px;
+}
+
+dd ul, dd table {
+ margin-bottom: 10px;
+}
+
+dd {
+ margin-top: 3px;
+ margin-bottom: 10px;
+ margin-left: 30px;
+}
+
+dt:target, span.highlighted {
+ background-color: #fbe54e;
+}
+
+rect.highlighted {
+ fill: #fbe54e;
+}
+
+dl.glossary dt {
+ font-weight: bold;
+ font-size: 1.1em;
+}
+
+.optional {
+ font-size: 1.3em;
+}
+
+.sig-paren {
+ font-size: larger;
+}
+
+.versionmodified {
+ font-style: italic;
+}
+
+.system-message {
+ background-color: #fda;
+ padding: 5px;
+ border: 3px solid red;
+}
+
+.footnote:target {
+ background-color: #ffa;
+}
+
+.line-block {
+ display: block;
+ margin-top: 1em;
+ margin-bottom: 1em;
+}
+
+.line-block .line-block {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-left: 1.5em;
+}
+
+.guilabel, .menuselection {
+ font-family: sans-serif;
+}
+
+.accelerator {
+ text-decoration: underline;
+}
+
+.classifier {
+ font-style: oblique;
+}
+
+abbr, acronym {
+ border-bottom: dotted 1px;
+ cursor: help;
+}
+
+/* -- code displays --------------------------------------------------------- */
+
+pre {
+ overflow: auto;
+ overflow-y: hidden; /* fixes display issues on Chrome browsers */
+}
+
+span.pre {
+ -moz-hyphens: none;
+ -ms-hyphens: none;
+ -webkit-hyphens: none;
+ hyphens: none;
+}
+
+td.linenos pre {
+ padding: 5px 0px;
+ border: 0;
+ background-color: transparent;
+ color: #aaa;
+}
+
+table.highlighttable {
+ margin-left: 0.5em;
+}
+
+table.highlighttable td {
+ padding: 0 0.5em 0 0.5em;
+}
+
+div.code-block-caption {
+ padding: 2px 5px;
+ font-size: small;
+}
+
+div.code-block-caption code {
+ background-color: transparent;
+}
+
+div.code-block-caption + div > div.highlight > pre {
+ margin-top: 0;
+}
+
+div.code-block-caption span.caption-number {
+ padding: 0.1em 0.3em;
+ font-style: italic;
+}
+
+div.code-block-caption span.caption-text {
+}
+
+div.literal-block-wrapper {
+ padding: 1em 1em 0;
+}
+
+div.literal-block-wrapper div.highlight {
+ margin: 0;
+}
+
+code.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+code.descclassname {
+ background-color: transparent;
+}
+
+code.xref, a code {
+ background-color: transparent;
+ font-weight: bold;
+}
+
+h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
+ background-color: transparent;
+}
+
+.viewcode-link {
+ float: right;
+}
+
+.viewcode-back {
+ float: right;
+ font-family: sans-serif;
+}
+
+div.viewcode-block:target {
+ margin: -1px -10px;
+ padding: 0 10px;
+}
+
+/* -- math display ---------------------------------------------------------- */
+
+img.math {
+ vertical-align: middle;
+}
+
+div.body div.math p {
+ text-align: center;
+}
+
+span.eqno {
+ float: right;
+}
+
+span.eqno a.headerlink {
+ position: relative;
+ left: 0px;
+ z-index: 1;
+}
+
+div.math:hover a.headerlink {
+ visibility: visible;
+}
+
+/* -- printout stylesheet --------------------------------------------------- */
+
+@media print {
+ div.document,
+ div.documentwrapper,
+ div.bodywrapper {
+ margin: 0 !important;
+ width: 100%;
+ }
+
+ div.sphinxsidebar,
+ div.related,
+ div.footer,
+ #top-link {
+ display: none;
+ }
+}
\ No newline at end of file
--- /dev/null
+/*
+ * doctools.js
+ * ~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilities for all documentation.
+ *
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+/**
+ * select a different prefix for underscore
+ */
+$u = _.noConflict();
+
+/**
+ * make the code below compatible with browsers without
+ * an installed firebug like debugger
+if (!window.console || !console.firebug) {
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
+ "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
+ "profile", "profileEnd"];
+ window.console = {};
+ for (var i = 0; i < names.length; ++i)
+ window.console[names[i]] = function() {};
+}
+ */
+
+/**
+ * small helper function to urldecode strings
+ */
+jQuery.urldecode = function(x) {
+ return decodeURIComponent(x).replace(/\+/g, ' ');
+};
+
+/**
+ * small helper function to urlencode strings
+ */
+jQuery.urlencode = encodeURIComponent;
+
+/**
+ * This function returns the parsed url parameters of the
+ * current request. Multiple values per key are supported,
+ * it will always return arrays of strings for the value parts.
+ */
+jQuery.getQueryParameters = function(s) {
+ if (typeof s === 'undefined')
+ s = document.location.search;
+ var parts = s.substr(s.indexOf('?') + 1).split('&');
+ var result = {};
+ for (var i = 0; i < parts.length; i++) {
+ var tmp = parts[i].split('=', 2);
+ var key = jQuery.urldecode(tmp[0]);
+ var value = jQuery.urldecode(tmp[1]);
+ if (key in result)
+ result[key].push(value);
+ else
+ result[key] = [value];
+ }
+ return result;
+};
+
+/**
+ * highlight a given string on a jquery object by wrapping it in
+ * span elements with the given class name.
+ */
+jQuery.fn.highlightText = function(text, className) {
+ function highlight(node, addItems) {
+ if (node.nodeType === 3) {
+ var val = node.nodeValue;
+ var pos = val.toLowerCase().indexOf(text);
+ if (pos >= 0 &&
+ !jQuery(node.parentNode).hasClass(className) &&
+ !jQuery(node.parentNode).hasClass("nohighlight")) {
+ var span;
+ var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
+ if (isInSVG) {
+ span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
+ } else {
+ span = document.createElement("span");
+ span.className = className;
+ }
+ span.appendChild(document.createTextNode(val.substr(pos, text.length)));
+ node.parentNode.insertBefore(span, node.parentNode.insertBefore(
+ document.createTextNode(val.substr(pos + text.length)),
+ node.nextSibling));
+ node.nodeValue = val.substr(0, pos);
+ if (isInSVG) {
+ var bbox = span.getBBox();
+ var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
+ rect.x.baseVal.value = bbox.x;
+ rect.y.baseVal.value = bbox.y;
+ rect.width.baseVal.value = bbox.width;
+ rect.height.baseVal.value = bbox.height;
+ rect.setAttribute('class', className);
+ var parentOfText = node.parentNode.parentNode;
+ addItems.push({
+ "parent": node.parentNode,
+ "target": rect});
+ }
+ }
+ }
+ else if (!jQuery(node).is("button, select, textarea")) {
+ jQuery.each(node.childNodes, function() {
+ highlight(this, addItems);
+ });
+ }
+ }
+ var addItems = [];
+ var result = this.each(function() {
+ highlight(this, addItems);
+ });
+ for (var i = 0; i < addItems.length; ++i) {
+ jQuery(addItems[i].parent).before(addItems[i].target);
+ }
+ return result;
+};
+
+/*
+ * backward compatibility for jQuery.browser
+ * This will be supported until firefox bug is fixed.
+ */
+if (!jQuery.browser) {
+ jQuery.uaMatch = function(ua) {
+ ua = ua.toLowerCase();
+
+ var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
+ /(webkit)[ \/]([\w.]+)/.exec(ua) ||
+ /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
+ /(msie) ([\w.]+)/.exec(ua) ||
+ ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
+ [];
+
+ return {
+ browser: match[ 1 ] || "",
+ version: match[ 2 ] || "0"
+ };
+ };
+ jQuery.browser = {};
+ jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
+}
+
+/**
+ * Small JavaScript module for the documentation.
+ */
+var Documentation = {
+
+ init : function() {
+ this.fixFirefoxAnchorBug();
+ this.highlightSearchWords();
+ this.initIndexTable();
+
+ },
+
+ /**
+ * i18n support
+ */
+ TRANSLATIONS : {},
+ PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; },
+ LOCALE : 'unknown',
+
+ // gettext and ngettext don't access this so that the functions
+ // can safely bound to a different name (_ = Documentation.gettext)
+ gettext : function(string) {
+ var translated = Documentation.TRANSLATIONS[string];
+ if (typeof translated === 'undefined')
+ return string;
+ return (typeof translated === 'string') ? translated : translated[0];
+ },
+
+ ngettext : function(singular, plural, n) {
+ var translated = Documentation.TRANSLATIONS[singular];
+ if (typeof translated === 'undefined')
+ return (n == 1) ? singular : plural;
+ return translated[Documentation.PLURALEXPR(n)];
+ },
+
+ addTranslations : function(catalog) {
+ for (var key in catalog.messages)
+ this.TRANSLATIONS[key] = catalog.messages[key];
+ this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
+ this.LOCALE = catalog.locale;
+ },
+
+ /**
+ * add context elements like header anchor links
+ */
+ addContextElements : function() {
+ $('div[id] > :header:first').each(function() {
+ $('<a class="headerlink">\u00B6</a>').
+ attr('href', '#' + this.id).
+ attr('title', _('Permalink to this headline')).
+ appendTo(this);
+ });
+ $('dt[id]').each(function() {
+ $('<a class="headerlink">\u00B6</a>').
+ attr('href', '#' + this.id).
+ attr('title', _('Permalink to this definition')).
+ appendTo(this);
+ });
+ },
+
+ /**
+ * workaround a firefox stupidity
+ * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075
+ */
+ fixFirefoxAnchorBug : function() {
+ if (document.location.hash && $.browser.mozilla)
+ window.setTimeout(function() {
+ document.location.href += '';
+ }, 10);
+ },
+
+ /**
+ * highlight the search words provided in the url in the text
+ */
+ highlightSearchWords : function() {
+ var params = $.getQueryParameters();
+ var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
+ if (terms.length) {
+ var body = $('div.body');
+ if (!body.length) {
+ body = $('body');
+ }
+ window.setTimeout(function() {
+ $.each(terms, function() {
+ body.highlightText(this.toLowerCase(), 'highlighted');
+ });
+ }, 10);
+ $('<p class="highlight-link"><a href="javascript:Documentation.' +
+ 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
+ .appendTo($('#searchbox'));
+ }
+ },
+
+ /**
+ * init the domain index toggle buttons
+ */
+ initIndexTable : function() {
+ var togglers = $('img.toggler').click(function() {
+ var src = $(this).attr('src');
+ var idnum = $(this).attr('id').substr(7);
+ $('tr.cg-' + idnum).toggle();
+ if (src.substr(-9) === 'minus.png')
+ $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
+ else
+ $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
+ }).css('display', '');
+ if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
+ togglers.click();
+ }
+ },
+
+ /**
+ * helper function to hide the search marks again
+ */
+ hideSearchWords : function() {
+ $('#searchbox .highlight-link').fadeOut(300);
+ $('span.highlighted').removeClass('highlighted');
+ },
+
+ /**
+ * make the url absolute
+ */
+ makeURL : function(relativeURL) {
+ return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
+ },
+
+ /**
+ * get the current relative url
+ */
+ getCurrentURL : function() {
+ var path = document.location.pathname;
+ var parts = path.split(/\//);
+ $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
+ if (this === '..')
+ parts.pop();
+ });
+ var url = parts.join('/');
+ return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
+ },
+
+ initOnKeyListeners: function() {
+ $(document).keyup(function(event) {
+ var activeElementType = document.activeElement.tagName;
+ // don't navigate when in search box or textarea
+ if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
+ switch (event.keyCode) {
+ case 37: // left
+ var prevHref = $('link[rel="prev"]').prop('href');
+ if (prevHref) {
+ window.location.href = prevHref;
+ return false;
+ }
+ case 39: // right
+ var nextHref = $('link[rel="next"]').prop('href');
+ if (nextHref) {
+ window.location.href = nextHref;
+ return false;
+ }
+ }
+ }
+ });
+ }
+};
+
+// quick alias for translations
+_ = Documentation.gettext;
+
+$(document).ready(function() {
+ Documentation.init();
+});
\ No newline at end of file
--- /dev/null
+var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
+ VERSION: '1.2',
+ LANGUAGE: 'None',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '.html',
+ HAS_SOURCE: true,
+ SOURCELINK_SUFFIX: '.txt'
+};
\ No newline at end of file
--- /dev/null
+/*!
+ * jQuery JavaScript Library v3.2.1
+ * https://jquery.com/
+ *
+ * Includes Sizzle.js
+ * https://sizzlejs.com/
+ *
+ * Copyright JS Foundation and other contributors
+ * Released under the MIT license
+ * https://jquery.org/license
+ *
+ * Date: 2017-03-20T18:59Z
+ */
+( function( global, factory ) {
+
+ "use strict";
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
+
+var arr = [];
+
+var document = window.document;
+
+var getProto = Object.getPrototypeOf;
+
+var slice = arr.slice;
+
+var concat = arr.concat;
+
+var push = arr.push;
+
+var indexOf = arr.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
+var support = {};
+
+
+
+ function DOMEval( code, doc ) {
+ doc = doc || document;
+
+ var script = doc.createElement( "script" );
+
+ script.text = code;
+ doc.head.appendChild( script ).parentNode.removeChild( script );
+ }
+/* global Symbol */
+// Defining this global in .eslintrc.json would create a danger of using the global
+// unguarded in another place, it seems safer to define global only for this module
+
+
+
+var
+ version = "3.2.1",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Support: Android <=4.0 only
+ // Make sure we trim BOM and NBSP
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([a-z])/g,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+
+ // Return all the elements in a clean array
+ if ( num == null ) {
+ return slice.call( this );
+ }
+
+ // Return just the one element from the set
+ return num < 0 ? this[ num + this.length ] : this[ num ];
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ each: function( callback ) {
+ return jQuery.each( this, callback );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map( this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ } ) );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor();
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: arr.sort,
+ splice: arr.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var options, name, src, copy, copyIsArray, clone,
+ target = arguments[ 0 ] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // Skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
+ target = {};
+ }
+
+ // Extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+
+ // Only deal with non-null/undefined values
+ if ( ( options = arguments[ i ] ) != null ) {
+
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
+ ( copyIsArray = Array.isArray( copy ) ) ) ) {
+
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && Array.isArray( src ) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject( src ) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend( {
+
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ isFunction: function( obj ) {
+ return jQuery.type( obj ) === "function";
+ },
+
+ isWindow: function( obj ) {
+ return obj != null && obj === obj.window;
+ },
+
+ isNumeric: function( obj ) {
+
+ // As of jQuery 3.0, isNumeric is limited to
+ // strings and numbers (primitives or objects)
+ // that can be coerced to finite numbers (gh-2662)
+ var type = jQuery.type( obj );
+ return ( type === "number" || type === "string" ) &&
+
+ // parseFloat NaNs numeric-cast false positives ("")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ !isNaN( obj - parseFloat( obj ) );
+ },
+
+ isPlainObject: function( obj ) {
+ var proto, Ctor;
+
+ // Detect obvious negatives
+ // Use toString instead of jQuery.type to catch host objects
+ if ( !obj || toString.call( obj ) !== "[object Object]" ) {
+ return false;
+ }
+
+ proto = getProto( obj );
+
+ // Objects with no prototype (e.g., `Object.create( null )`) are plain
+ if ( !proto ) {
+ return true;
+ }
+
+ // Objects with prototype are plain iff they were constructed by a global Object function
+ Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
+ return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
+ },
+
+ isEmptyObject: function( obj ) {
+
+ /* eslint-disable no-unused-vars */
+ // See https://github.com/eslint/eslint/issues/6125
+ var name;
+
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+
+ // Support: Android <=2.3 only (functionish RegExp)
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call( obj ) ] || "object" :
+ typeof obj;
+ },
+
+ // Evaluates a script in a global context
+ globalEval: function( code ) {
+ DOMEval( code );
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Support: IE <=9 - 11, Edge 12 - 13
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ each: function( obj, callback ) {
+ var length, i = 0;
+
+ if ( isArrayLike( obj ) ) {
+ length = obj.length;
+ for ( ; i < length; i++ ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Support: Android <=4.0 only
+ trim: function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArrayLike( Object( arr ) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ return arr == null ? -1 : indexOf.call( arr, elem, i );
+ },
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ for ( ; j < len; j++ ) {
+ first[ i++ ] = second[ j ];
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var length, value,
+ i = 0,
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArrayLike( elems ) ) {
+ length = elems.length;
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var tmp, args, proxy;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: Date.now,
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+} );
+
+if ( typeof Symbol === "function" ) {
+ jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
+}
+
+// Populate the class2type map
+jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
+function( i, name ) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+} );
+
+function isArrayLike( obj ) {
+
+ // Support: real iOS 8.2 only (not reproducible in simulator)
+ // `in` check used to prevent JIT error (gh-2145)
+ // hasOwn isn't used here due to false negatives
+ // regarding Nodelist length in IE
+ var length = !!obj && "length" in obj && obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v2.3.3
+ * https://sizzlejs.com/
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2016-08-08
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ tokenize,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + 1 * new Date(),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf as it's faster than native
+ // https://jsperf.com/thor-indexof-vs-for/5
+ indexOf = function( list, elem ) {
+ var i = 0,
+ len = list.length;
+ for ( ; i < len; i++ ) {
+ if ( list[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+
+ // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
+
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
+ // Operator (capture 2)
+ "*([*^$|!~]?=)" + whitespace +
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+ "*\\]",
+
+ pseudos = ":(" + identifier + ")(?:\\((" +
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+ // 1. quoted (capture 3; capture 4 or capture 5)
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+ // 2. simple (capture 6)
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+ // 3. anything else (capture 2)
+ ".*" +
+ ")\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rwhitespace = new RegExp( whitespace + "+", "g" ),
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + identifier + ")" ),
+ "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
+ "TAG": new RegExp( "^(" + identifier + "|[*])" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+
+ // CSS escapes
+ // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox<24
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ },
+
+ // CSS string/identifier serialization
+ // https://drafts.csswg.org/cssom/#common-serializing-idioms
+ rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
+ fcssescape = function( ch, asCodePoint ) {
+ if ( asCodePoint ) {
+
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
+ if ( ch === "\0" ) {
+ return "\uFFFD";
+ }
+
+ // Control characters and (dependent upon position) numbers get escaped as code points
+ return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
+ }
+
+ // Other potentially-special ASCII characters get backslash-escaped
+ return "\\" + ch;
+ },
+
+ // Used for iframes
+ // See setDocument()
+ // Removing the function wrapper causes a "Permission Denied"
+ // error in IE
+ unloadHandler = function() {
+ setDocument();
+ },
+
+ disabledAncestor = addCombinator(
+ function( elem ) {
+ return elem.disabled === true && ("form" in elem || "label" in elem);
+ },
+ { dir: "parentNode", next: "legend" }
+ );
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var m, i, elem, nid, match, groups, newSelector,
+ newContext = context && context.ownerDocument,
+
+ // nodeType defaults to 9, since context defaults to document
+ nodeType = context ? context.nodeType : 9;
+
+ results = results || [];
+
+ // Return early from calls with invalid selector or context
+ if ( typeof selector !== "string" || !selector ||
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
+
+ return results;
+ }
+
+ // Try to shortcut find operations (as opposed to filters) in HTML documents
+ if ( !seed ) {
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+ context = context || document;
+
+ if ( documentIsHTML ) {
+
+ // If the selector is sufficiently simple, try using a "get*By*" DOM method
+ // (excepting DocumentFragment context, where the methods don't exist)
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
+
+ // ID selector
+ if ( (m = match[1]) ) {
+
+ // Document context
+ if ( nodeType === 9 ) {
+ if ( (elem = context.getElementById( m )) ) {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+
+ // Element context
+ } else {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( newContext && (elem = newContext.getElementById( m )) &&
+ contains( context, elem ) &&
+ elem.id === m ) {
+
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Type selector
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Class selector
+ } else if ( (m = match[3]) && support.getElementsByClassName &&
+ context.getElementsByClassName ) {
+
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // Take advantage of querySelectorAll
+ if ( support.qsa &&
+ !compilerCache[ selector + " " ] &&
+ (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+
+ if ( nodeType !== 1 ) {
+ newContext = context;
+ newSelector = selector;
+
+ // qSA looks outside Element context, which is not what we want
+ // Thanks to Andrew Dupont for this workaround technique
+ // Support: IE <=8
+ // Exclude object elements
+ } else if ( context.nodeName.toLowerCase() !== "object" ) {
+
+ // Capture the context ID, setting it first if necessary
+ if ( (nid = context.getAttribute( "id" )) ) {
+ nid = nid.replace( rcssescape, fcssescape );
+ } else {
+ context.setAttribute( "id", (nid = expando) );
+ }
+
+ // Prefix every selector in the list
+ groups = tokenize( selector );
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = "#" + nid + " " + toSelector( groups[i] );
+ }
+ newSelector = groups.join( "," );
+
+ // Expand context for sibling selectors
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
+ context;
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch ( qsaError ) {
+ } finally {
+ if ( nid === expando ) {
+ context.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {function(string, object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created element and returns a boolean result
+ */
+function assert( fn ) {
+ var el = document.createElement("fieldset");
+
+ try {
+ return !!fn( el );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( el.parentNode ) {
+ el.parentNode.removeChild( el );
+ }
+ // release memory in IE
+ el = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = arr.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ a.sourceIndex - b.sourceIndex;
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for :enabled/:disabled
+ * @param {Boolean} disabled true for :disabled; false for :enabled
+ */
+function createDisabledPseudo( disabled ) {
+
+ // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
+ return function( elem ) {
+
+ // Only certain elements can match :enabled or :disabled
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
+ if ( "form" in elem ) {
+
+ // Check for inherited disabledness on relevant non-disabled elements:
+ // * listed form-associated elements in a disabled fieldset
+ // https://html.spec.whatwg.org/multipage/forms.html#category-listed
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
+ // * option elements in a disabled optgroup
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
+ // All such elements have a "form" property.
+ if ( elem.parentNode && elem.disabled === false ) {
+
+ // Option elements defer to a parent optgroup if present
+ if ( "label" in elem ) {
+ if ( "label" in elem.parentNode ) {
+ return elem.parentNode.disabled === disabled;
+ } else {
+ return elem.disabled === disabled;
+ }
+ }
+
+ // Support: IE 6 - 11
+ // Use the isDisabled shortcut property to check for disabled fieldset ancestors
+ return elem.isDisabled === disabled ||
+
+ // Where there is no isDisabled, check manually
+ /* jshint -W018 */
+ elem.isDisabled !== !disabled &&
+ disabledAncestor( elem ) === disabled;
+ }
+
+ return elem.disabled === disabled;
+
+ // Try to winnow out elements that can't be disabled before trusting the disabled property.
+ // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
+ // even exist on them, let alone have a boolean value.
+ } else if ( "label" in elem ) {
+ return elem.disabled === disabled;
+ }
+
+ // Remaining elements are neither :enabled nor :disabled
+ return false;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== "undefined" && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare, subWindow,
+ doc = node ? node.ownerDocument || node : preferredDoc;
+
+ // Return early if doc is invalid or already selected
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Update global variables
+ document = doc;
+ docElem = document.documentElement;
+ documentIsHTML = !isXML( document );
+
+ // Support: IE 9-11, Edge
+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
+ if ( preferredDoc !== document &&
+ (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
+
+ // Support: IE 11, Edge
+ if ( subWindow.addEventListener ) {
+ subWindow.addEventListener( "unload", unloadHandler, false );
+
+ // Support: IE 9 - 10 only
+ } else if ( subWindow.attachEvent ) {
+ subWindow.attachEvent( "onunload", unloadHandler );
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties
+ // (excepting IE8 booleans)
+ support.attributes = assert(function( el ) {
+ el.className = "i";
+ return !el.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( el ) {
+ el.appendChild( document.createComment("") );
+ return !el.getElementsByTagName("*").length;
+ });
+
+ // Support: IE<9
+ support.getElementsByClassName = rnative.test( document.getElementsByClassName );
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programmatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( el ) {
+ docElem.appendChild( el ).id = expando;
+ return !document.getElementsByName || !document.getElementsByName( expando ).length;
+ });
+
+ // ID filter and find
+ if ( support.getById ) {
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var elem = context.getElementById( id );
+ return elem ? [ elem ] : [];
+ }
+ };
+ } else {
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== "undefined" &&
+ elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+
+ // Support: IE 6 - 7 only
+ // getElementById is not reliable as a find shortcut
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var node, i, elems,
+ elem = context.getElementById( id );
+
+ if ( elem ) {
+
+ // Verify the id attribute
+ node = elem.getAttributeNode("id");
+ if ( node && node.value === id ) {
+ return [ elem ];
+ }
+
+ // Fall back on getElementsByName
+ elems = context.getElementsByName( id );
+ i = 0;
+ while ( (elem = elems[i++]) ) {
+ node = elem.getAttributeNode("id");
+ if ( node && node.value === id ) {
+ return [ elem ];
+ }
+ }
+ }
+
+ return [];
+ }
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( tag );
+
+ // DocumentFragment nodes don't have gEBTN
+ } else if ( support.qsa ) {
+ return context.querySelectorAll( tag );
+ }
+ } :
+
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See https://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( el ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // https://bugs.jquery.com/ticket/12359
+ docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
+ "<select id='" + expando + "-\r\\' msallowcapture=''>" +
+ "<option selected=''></option></select>";
+
+ // Support: IE8, Opera 11-12.16
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ // The test attribute must be unknown in Opera but "safe" for WinRT
+ // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+ if ( el.querySelectorAll("[msallowcapture^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !el.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+ rbuggyQSA.push("~=");
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !el.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+
+ // Support: Safari 8+, iOS 8+
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
+ // In-page `selector#id sibling-combinator selector` fails
+ if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
+ rbuggyQSA.push(".#.+[+~]");
+ }
+ });
+
+ assert(function( el ) {
+ el.innerHTML = "<a href='' disabled='disabled'></a>" +
+ "<select disabled='disabled'><option/></select>";
+
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = document.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ el.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( el.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( el.querySelectorAll(":enabled").length !== 2 ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Support: IE9-11+
+ // IE's :disabled selector does not pick up the children of disabled fieldsets
+ docElem.appendChild( el ).disabled = true;
+ if ( el.querySelectorAll(":disabled").length !== 2 ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ el.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+ docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( el ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( el, "*" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( el, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully self-exclusive
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === document ? -1 :
+ b === document ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return document;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ !compilerCache[ expr + " " ] &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch (e) {}
+ }
+
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.escape = function( sel ) {
+ return (sel + "").replace( rcssescape, fcssescape );
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[6] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] ) {
+ match[2] = match[4] || match[5] || "";
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, uniqueCache, outerCache, node, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType,
+ diff = false;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) {
+
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+
+ // Seek `elem` from a previously-cached index
+
+ // ...in a gzip-friendly way
+ node = parent;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex && cache[ 2 ];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ } else {
+ // Use previously-cached element index if available
+ if ( useCache ) {
+ // ...in a gzip-friendly way
+ node = elem;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex;
+ }
+
+ // xml :nth-child(...)
+ // or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ if ( diff === false ) {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) &&
+ ++diff ) {
+
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ uniqueCache[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ // Don't keep the element (issue #299)
+ input[0] = null;
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ text = text.replace( runescape, funescape );
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": createDisabledPseudo( false ),
+ "disabled": createDisabledPseudo( true ),
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ skip = combinator.next,
+ key = skip || dir,
+ checkNonElements = base && key === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ return false;
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, uniqueCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
+
+ if ( skip && skip === elem.nodeName.toLowerCase() ) {
+ elem = elem[ dir ] || elem;
+ } else if ( (oldCache = uniqueCache[ key ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ uniqueCache[ key ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ // Avoid hanging onto element (issue #299)
+ checkContext = null;
+ return ret;
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context === document || context || outermost;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ if ( !context && elem.ownerDocument !== document ) {
+ setDocument( elem );
+ xml = !documentIsHTML;
+ }
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context || document, xml) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // `i` is now the count of elements visited above, and adding it to `matchedCount`
+ // makes the latter nonnegative.
+ matchedCount += i;
+
+ // Apply set filters to unmatched elements
+ // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
+ // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
+ // no element matchers and no seed.
+ // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
+ // case, which will result in a "00" `matchedCount` that differs from `i` but is also
+ // numerically zero.
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ // Save selector and tokenization
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ // Try to minimize operations if there is only one selector in the list and no seed
+ // (the latter of which guarantees us context)
+ if ( match.length === 1 ) {
+
+ // Reduce context if the leading compound selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ // Precompiled matchers will still verify ancestry, so step up a level
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function if one is not provided
+ // Provide `match` to avoid retokenization if we modified the selector above
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome 14-35+
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( el ) {
+ // Should return 1, but returns 4 (following)
+ return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( el ) {
+ el.innerHTML = "<a href='#'></a>";
+ return el.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( el ) {
+ el.innerHTML = "<input/>";
+ el.firstChild.setAttribute( "value", "" );
+ return el.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( el ) {
+ return el.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+
+// Deprecated
+jQuery.expr[ ":" ] = jQuery.expr.pseudos;
+jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+jQuery.escapeSelector = Sizzle.escape;
+
+
+
+
+var dir = function( elem, dir, until ) {
+ var matched = [],
+ truncate = until !== undefined;
+
+ while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
+ if ( elem.nodeType === 1 ) {
+ if ( truncate && jQuery( elem ).is( until ) ) {
+ break;
+ }
+ matched.push( elem );
+ }
+ }
+ return matched;
+};
+
+
+var siblings = function( n, elem ) {
+ var matched = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ matched.push( n );
+ }
+ }
+
+ return matched;
+};
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+
+
+function nodeName( elem, name ) {
+
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+
+};
+var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ return !!qualifier.call( elem, i, elem ) !== not;
+ } );
+ }
+
+ // Single element
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ } );
+ }
+
+ // Arraylike of elements (jQuery, arguments, Array)
+ if ( typeof qualifier !== "string" ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
+ } );
+ }
+
+ // Simple selector that can be filtered directly, removing non-Elements
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ // Complex selector, compare the two sets, removing non-Elements
+ qualifier = jQuery.filter( qualifier, elements );
+ return jQuery.grep( elements, function( elem ) {
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
+ } );
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ if ( elems.length === 1 && elem.nodeType === 1 ) {
+ return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
+ }
+
+ return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ } ) );
+};
+
+jQuery.fn.extend( {
+ find: function( selector ) {
+ var i, ret,
+ len = this.length,
+ self = this;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter( function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ } ) );
+ }
+
+ ret = this.pushStack( [] );
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ return len > 1 ? jQuery.uniqueSort( ret ) : ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], false ) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], true ) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+} );
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ // Shortcut simple #id case for speed
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
+
+ init = jQuery.fn.init = function( selector, context, root ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Method init() accepts an alternate rootjQuery
+ // so migrate can support jQuery.sub (gh-2101)
+ root = root || rootjQuery;
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector[ 0 ] === "<" &&
+ selector[ selector.length - 1 ] === ">" &&
+ selector.length >= 3 ) {
+
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && ( match[ 1 ] || !context ) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[ 1 ] ) {
+ context = context instanceof jQuery ? context[ 0 ] : context;
+
+ // Option to run scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[ 1 ],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[ 2 ] );
+
+ if ( elem ) {
+
+ // Inject the element directly into the jQuery object
+ this[ 0 ] = elem;
+ this.length = 1;
+ }
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || root ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this[ 0 ] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return root.ready !== undefined ?
+ root.ready( selector ) :
+
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+
+ // Methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend( {
+ has: function( target ) {
+ var targets = jQuery( target, this ),
+ l = targets.length;
+
+ return this.filter( function() {
+ var i = 0;
+ for ( ; i < l; i++ ) {
+ if ( jQuery.contains( this, targets[ i ] ) ) {
+ return true;
+ }
+ }
+ } );
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ targets = typeof selectors !== "string" && jQuery( selectors );
+
+ // Positional selectors never match, since there's no _selection_ context
+ if ( !rneedsContext.test( selectors ) ) {
+ for ( ; i < l; i++ ) {
+ for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
+
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && ( targets ?
+ targets.index( cur ) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector( cur, selectors ) ) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
+ },
+
+ // Determine the position of an element within the set
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // Index in selector
+ if ( typeof elem === "string" ) {
+ return indexOf.call( jQuery( elem ), this[ 0 ] );
+ }
+
+ // Locate the position of the desired element
+ return indexOf.call( this,
+
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[ 0 ] : elem
+ );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.uniqueSort(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ }
+} );
+
+function sibling( cur, dir ) {
+ while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
+ return cur;
+}
+
+jQuery.each( {
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return siblings( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return siblings( elem.firstChild );
+ },
+ contents: function( elem ) {
+ if ( nodeName( elem, "iframe" ) ) {
+ return elem.contentDocument;
+ }
+
+ // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
+ // Treat the template element as a regular one in browsers that
+ // don't support it.
+ if ( nodeName( elem, "template" ) ) {
+ elem = elem.content || elem;
+ }
+
+ return jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var matched = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ matched = jQuery.filter( selector, matched );
+ }
+
+ if ( this.length > 1 ) {
+
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ jQuery.uniqueSort( matched );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ matched.reverse();
+ }
+ }
+
+ return this.pushStack( matched );
+ };
+} );
+var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
+
+
+
+// Convert String-formatted options into Object-formatted ones
+function createOptions( options ) {
+ var object = {};
+ jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ } );
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ createOptions( options ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+
+ // Last fire value for non-forgettable lists
+ memory,
+
+ // Flag to know if list was already fired
+ fired,
+
+ // Flag to prevent firing
+ locked,
+
+ // Actual callback list
+ list = [],
+
+ // Queue of execution data for repeatable lists
+ queue = [],
+
+ // Index of currently firing callback (modified by add/remove as needed)
+ firingIndex = -1,
+
+ // Fire callbacks
+ fire = function() {
+
+ // Enforce single-firing
+ locked = locked || options.once;
+
+ // Execute callbacks for all pending executions,
+ // respecting firingIndex overrides and runtime changes
+ fired = firing = true;
+ for ( ; queue.length; firingIndex = -1 ) {
+ memory = queue.shift();
+ while ( ++firingIndex < list.length ) {
+
+ // Run callback and check for early termination
+ if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
+ options.stopOnFalse ) {
+
+ // Jump to end and forget the data so .add doesn't re-fire
+ firingIndex = list.length;
+ memory = false;
+ }
+ }
+ }
+
+ // Forget the data if we're done with it
+ if ( !options.memory ) {
+ memory = false;
+ }
+
+ firing = false;
+
+ // Clean up if we're done firing for good
+ if ( locked ) {
+
+ // Keep an empty list if we have data for future add calls
+ if ( memory ) {
+ list = [];
+
+ // Otherwise, this object is spent
+ } else {
+ list = "";
+ }
+ }
+ },
+
+ // Actual Callbacks object
+ self = {
+
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+
+ // If we have memory from a past run, we should fire after adding
+ if ( memory && !firing ) {
+ firingIndex = list.length - 1;
+ queue.push( memory );
+ }
+
+ ( function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ if ( jQuery.isFunction( arg ) ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
+
+ // Inspect recursively
+ add( arg );
+ }
+ } );
+ } )( arguments );
+
+ if ( memory && !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Remove a callback from the list
+ remove: function() {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+
+ // Handle firing indexes
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ } );
+ return this;
+ },
+
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ?
+ jQuery.inArray( fn, list ) > -1 :
+ list.length > 0;
+ },
+
+ // Remove all callbacks from the list
+ empty: function() {
+ if ( list ) {
+ list = [];
+ }
+ return this;
+ },
+
+ // Disable .fire and .add
+ // Abort any current/pending executions
+ // Clear all callbacks and values
+ disable: function() {
+ locked = queue = [];
+ list = memory = "";
+ return this;
+ },
+ disabled: function() {
+ return !list;
+ },
+
+ // Disable .fire
+ // Also disable .add unless we have memory (since it would have no effect)
+ // Abort any pending executions
+ lock: function() {
+ locked = queue = [];
+ if ( !memory && !firing ) {
+ list = memory = "";
+ }
+ return this;
+ },
+ locked: function() {
+ return !!locked;
+ },
+
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( !locked ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ queue.push( args );
+ if ( !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+function Identity( v ) {
+ return v;
+}
+function Thrower( ex ) {
+ throw ex;
+}
+
+function adoptValue( value, resolve, reject, noValue ) {
+ var method;
+
+ try {
+
+ // Check for promise aspect first to privilege synchronous behavior
+ if ( value && jQuery.isFunction( ( method = value.promise ) ) ) {
+ method.call( value ).done( resolve ).fail( reject );
+
+ // Other thenables
+ } else if ( value && jQuery.isFunction( ( method = value.then ) ) ) {
+ method.call( value, resolve, reject );
+
+ // Other non-thenables
+ } else {
+
+ // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
+ // * false: [ value ].slice( 0 ) => resolve( value )
+ // * true: [ value ].slice( 1 ) => resolve()
+ resolve.apply( undefined, [ value ].slice( noValue ) );
+ }
+
+ // For Promises/A+, convert exceptions into rejections
+ // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
+ // Deferred#then to conditionally suppress rejection.
+ } catch ( value ) {
+
+ // Support: Android 4.0 only
+ // Strict mode functions invoked without .call/.apply get global-object context
+ reject.apply( undefined, [ value ] );
+ }
+}
+
+jQuery.extend( {
+
+ Deferred: function( func ) {
+ var tuples = [
+
+ // action, add listener, callbacks,
+ // ... .then handlers, argument index, [final state]
+ [ "notify", "progress", jQuery.Callbacks( "memory" ),
+ jQuery.Callbacks( "memory" ), 2 ],
+ [ "resolve", "done", jQuery.Callbacks( "once memory" ),
+ jQuery.Callbacks( "once memory" ), 0, "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks( "once memory" ),
+ jQuery.Callbacks( "once memory" ), 1, "rejected" ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ "catch": function( fn ) {
+ return promise.then( null, fn );
+ },
+
+ // Keep pipe for back-compat
+ pipe: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+
+ return jQuery.Deferred( function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+
+ // Map tuples (progress, done, fail) to arguments (done, fail, progress)
+ var fn = jQuery.isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
+
+ // deferred.progress(function() { bind to newDefer or newDefer.notify })
+ // deferred.done(function() { bind to newDefer or newDefer.resolve })
+ // deferred.fail(function() { bind to newDefer or newDefer.reject })
+ deferred[ tuple[ 1 ] ]( function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .progress( newDefer.notify )
+ .done( newDefer.resolve )
+ .fail( newDefer.reject );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ](
+ this,
+ fn ? [ returned ] : arguments
+ );
+ }
+ } );
+ } );
+ fns = null;
+ } ).promise();
+ },
+ then: function( onFulfilled, onRejected, onProgress ) {
+ var maxDepth = 0;
+ function resolve( depth, deferred, handler, special ) {
+ return function() {
+ var that = this,
+ args = arguments,
+ mightThrow = function() {
+ var returned, then;
+
+ // Support: Promises/A+ section 2.3.3.3.3
+ // https://promisesaplus.com/#point-59
+ // Ignore double-resolution attempts
+ if ( depth < maxDepth ) {
+ return;
+ }
+
+ returned = handler.apply( that, args );
+
+ // Support: Promises/A+ section 2.3.1
+ // https://promisesaplus.com/#point-48
+ if ( returned === deferred.promise() ) {
+ throw new TypeError( "Thenable self-resolution" );
+ }
+
+ // Support: Promises/A+ sections 2.3.3.1, 3.5
+ // https://promisesaplus.com/#point-54
+ // https://promisesaplus.com/#point-75
+ // Retrieve `then` only once
+ then = returned &&
+
+ // Support: Promises/A+ section 2.3.4
+ // https://promisesaplus.com/#point-64
+ // Only check objects and functions for thenability
+ ( typeof returned === "object" ||
+ typeof returned === "function" ) &&
+ returned.then;
+
+ // Handle a returned thenable
+ if ( jQuery.isFunction( then ) ) {
+
+ // Special processors (notify) just wait for resolution
+ if ( special ) {
+ then.call(
+ returned,
+ resolve( maxDepth, deferred, Identity, special ),
+ resolve( maxDepth, deferred, Thrower, special )
+ );
+
+ // Normal processors (resolve) also hook into progress
+ } else {
+
+ // ...and disregard older resolution values
+ maxDepth++;
+
+ then.call(
+ returned,
+ resolve( maxDepth, deferred, Identity, special ),
+ resolve( maxDepth, deferred, Thrower, special ),
+ resolve( maxDepth, deferred, Identity,
+ deferred.notifyWith )
+ );
+ }
+
+ // Handle all other returned values
+ } else {
+
+ // Only substitute handlers pass on context
+ // and multiple values (non-spec behavior)
+ if ( handler !== Identity ) {
+ that = undefined;
+ args = [ returned ];
+ }
+
+ // Process the value(s)
+ // Default process is resolve
+ ( special || deferred.resolveWith )( that, args );
+ }
+ },
+
+ // Only normal processors (resolve) catch and reject exceptions
+ process = special ?
+ mightThrow :
+ function() {
+ try {
+ mightThrow();
+ } catch ( e ) {
+
+ if ( jQuery.Deferred.exceptionHook ) {
+ jQuery.Deferred.exceptionHook( e,
+ process.stackTrace );
+ }
+
+ // Support: Promises/A+ section 2.3.3.3.4.1
+ // https://promisesaplus.com/#point-61
+ // Ignore post-resolution exceptions
+ if ( depth + 1 >= maxDepth ) {
+
+ // Only substitute handlers pass on context
+ // and multiple values (non-spec behavior)
+ if ( handler !== Thrower ) {
+ that = undefined;
+ args = [ e ];
+ }
+
+ deferred.rejectWith( that, args );
+ }
+ }
+ };
+
+ // Support: Promises/A+ section 2.3.3.3.1
+ // https://promisesaplus.com/#point-57
+ // Re-resolve promises immediately to dodge false rejection from
+ // subsequent errors
+ if ( depth ) {
+ process();
+ } else {
+
+ // Call an optional hook to record the stack, in case of exception
+ // since it's otherwise lost when execution goes async
+ if ( jQuery.Deferred.getStackHook ) {
+ process.stackTrace = jQuery.Deferred.getStackHook();
+ }
+ window.setTimeout( process );
+ }
+ };
+ }
+
+ return jQuery.Deferred( function( newDefer ) {
+
+ // progress_handlers.add( ... )
+ tuples[ 0 ][ 3 ].add(
+ resolve(
+ 0,
+ newDefer,
+ jQuery.isFunction( onProgress ) ?
+ onProgress :
+ Identity,
+ newDefer.notifyWith
+ )
+ );
+
+ // fulfilled_handlers.add( ... )
+ tuples[ 1 ][ 3 ].add(
+ resolve(
+ 0,
+ newDefer,
+ jQuery.isFunction( onFulfilled ) ?
+ onFulfilled :
+ Identity
+ )
+ );
+
+ // rejected_handlers.add( ... )
+ tuples[ 2 ][ 3 ].add(
+ resolve(
+ 0,
+ newDefer,
+ jQuery.isFunction( onRejected ) ?
+ onRejected :
+ Thrower
+ )
+ );
+ } ).promise();
+ },
+
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 5 ];
+
+ // promise.progress = list.add
+ // promise.done = list.add
+ // promise.fail = list.add
+ promise[ tuple[ 1 ] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(
+ function() {
+
+ // state = "resolved" (i.e., fulfilled)
+ // state = "rejected"
+ state = stateString;
+ },
+
+ // rejected_callbacks.disable
+ // fulfilled_callbacks.disable
+ tuples[ 3 - i ][ 2 ].disable,
+
+ // progress_callbacks.lock
+ tuples[ 0 ][ 2 ].lock
+ );
+ }
+
+ // progress_handlers.fire
+ // fulfilled_handlers.fire
+ // rejected_handlers.fire
+ list.add( tuple[ 3 ].fire );
+
+ // deferred.notify = function() { deferred.notifyWith(...) }
+ // deferred.resolve = function() { deferred.resolveWith(...) }
+ // deferred.reject = function() { deferred.rejectWith(...) }
+ deferred[ tuple[ 0 ] ] = function() {
+ deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
+ return this;
+ };
+
+ // deferred.notifyWith = list.fireWith
+ // deferred.resolveWith = list.fireWith
+ // deferred.rejectWith = list.fireWith
+ deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
+ } );
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( singleValue ) {
+ var
+
+ // count of uncompleted subordinates
+ remaining = arguments.length,
+
+ // count of unprocessed arguments
+ i = remaining,
+
+ // subordinate fulfillment data
+ resolveContexts = Array( i ),
+ resolveValues = slice.call( arguments ),
+
+ // the master Deferred
+ master = jQuery.Deferred(),
+
+ // subordinate callback factory
+ updateFunc = function( i ) {
+ return function( value ) {
+ resolveContexts[ i ] = this;
+ resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( !( --remaining ) ) {
+ master.resolveWith( resolveContexts, resolveValues );
+ }
+ };
+ };
+
+ // Single- and empty arguments are adopted like Promise.resolve
+ if ( remaining <= 1 ) {
+ adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
+ !remaining );
+
+ // Use .then() to unwrap secondary thenables (cf. gh-3000)
+ if ( master.state() === "pending" ||
+ jQuery.isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
+
+ return master.then();
+ }
+ }
+
+ // Multiple arguments are aggregated like Promise.all array elements
+ while ( i-- ) {
+ adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
+ }
+
+ return master.promise();
+ }
+} );
+
+
+// These usually indicate a programmer mistake during development,
+// warn about them ASAP rather than swallowing them by default.
+var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
+
+jQuery.Deferred.exceptionHook = function( error, stack ) {
+
+ // Support: IE 8 - 9 only
+ // Console exists when dev tools are open, which can happen at any time
+ if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
+ window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
+ }
+};
+
+
+
+
+jQuery.readyException = function( error ) {
+ window.setTimeout( function() {
+ throw error;
+ } );
+};
+
+
+
+
+// The deferred used on DOM ready
+var readyList = jQuery.Deferred();
+
+jQuery.fn.ready = function( fn ) {
+
+ readyList
+ .then( fn )
+
+ // Wrap jQuery.readyException in a function so that the lookup
+ // happens at the time of error handling instead of callback
+ // registration.
+ .catch( function( error ) {
+ jQuery.readyException( error );
+ } );
+
+ return this;
+};
+
+jQuery.extend( {
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+ }
+} );
+
+jQuery.ready.then = readyList.then;
+
+// The ready event handler and self cleanup method
+function completed() {
+ document.removeEventListener( "DOMContentLoaded", completed );
+ window.removeEventListener( "load", completed );
+ jQuery.ready();
+}
+
+// Catch cases where $(document).ready() is called
+// after the browser event has already occurred.
+// Support: IE <=9 - 10 only
+// Older IE sometimes signals "interactive" too soon
+if ( document.readyState === "complete" ||
+ ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
+
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ window.setTimeout( jQuery.ready );
+
+} else {
+
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed );
+}
+
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ len = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ access( elems, fn, i, key[ i ], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < len; i++ ) {
+ fn(
+ elems[ i ], key, raw ?
+ value :
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )
+ );
+ }
+ }
+ }
+
+ if ( chainable ) {
+ return elems;
+ }
+
+ // Gets
+ if ( bulk ) {
+ return fn.call( elems );
+ }
+
+ return len ? fn( elems[ 0 ], key ) : emptyGet;
+};
+var acceptData = function( owner ) {
+
+ // Accepts only:
+ // - Node
+ // - Node.ELEMENT_NODE
+ // - Node.DOCUMENT_NODE
+ // - Object
+ // - Any
+ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
+};
+
+
+
+
+function Data() {
+ this.expando = jQuery.expando + Data.uid++;
+}
+
+Data.uid = 1;
+
+Data.prototype = {
+
+ cache: function( owner ) {
+
+ // Check if the owner object already has a cache
+ var value = owner[ this.expando ];
+
+ // If not, create one
+ if ( !value ) {
+ value = {};
+
+ // We can accept data for non-element nodes in modern browsers,
+ // but we should not, see #8335.
+ // Always return an empty object.
+ if ( acceptData( owner ) ) {
+
+ // If it is a node unlikely to be stringify-ed or looped over
+ // use plain assignment
+ if ( owner.nodeType ) {
+ owner[ this.expando ] = value;
+
+ // Otherwise secure it in a non-enumerable property
+ // configurable must be true to allow the property to be
+ // deleted when data is removed
+ } else {
+ Object.defineProperty( owner, this.expando, {
+ value: value,
+ configurable: true
+ } );
+ }
+ }
+ }
+
+ return value;
+ },
+ set: function( owner, data, value ) {
+ var prop,
+ cache = this.cache( owner );
+
+ // Handle: [ owner, key, value ] args
+ // Always use camelCase key (gh-2257)
+ if ( typeof data === "string" ) {
+ cache[ jQuery.camelCase( data ) ] = value;
+
+ // Handle: [ owner, { properties } ] args
+ } else {
+
+ // Copy the properties one-by-one to the cache object
+ for ( prop in data ) {
+ cache[ jQuery.camelCase( prop ) ] = data[ prop ];
+ }
+ }
+ return cache;
+ },
+ get: function( owner, key ) {
+ return key === undefined ?
+ this.cache( owner ) :
+
+ // Always use camelCase key (gh-2257)
+ owner[ this.expando ] && owner[ this.expando ][ jQuery.camelCase( key ) ];
+ },
+ access: function( owner, key, value ) {
+
+ // In cases where either:
+ //
+ // 1. No key was specified
+ // 2. A string key was specified, but no value provided
+ //
+ // Take the "read" path and allow the get method to determine
+ // which value to return, respectively either:
+ //
+ // 1. The entire cache object
+ // 2. The data stored at the key
+ //
+ if ( key === undefined ||
+ ( ( key && typeof key === "string" ) && value === undefined ) ) {
+
+ return this.get( owner, key );
+ }
+
+ // When the key is not a string, or both a key and value
+ // are specified, set or extend (existing objects) with either:
+ //
+ // 1. An object of properties
+ // 2. A key and value
+ //
+ this.set( owner, key, value );
+
+ // Since the "set" path can have two possible entry points
+ // return the expected data based on which path was taken[*]
+ return value !== undefined ? value : key;
+ },
+ remove: function( owner, key ) {
+ var i,
+ cache = owner[ this.expando ];
+
+ if ( cache === undefined ) {
+ return;
+ }
+
+ if ( key !== undefined ) {
+
+ // Support array or space separated string of keys
+ if ( Array.isArray( key ) ) {
+
+ // If key is an array of keys...
+ // We always set camelCase keys, so remove that.
+ key = key.map( jQuery.camelCase );
+ } else {
+ key = jQuery.camelCase( key );
+
+ // If a key with the spaces exists, use it.
+ // Otherwise, create an array by matching non-whitespace
+ key = key in cache ?
+ [ key ] :
+ ( key.match( rnothtmlwhite ) || [] );
+ }
+
+ i = key.length;
+
+ while ( i-- ) {
+ delete cache[ key[ i ] ];
+ }
+ }
+
+ // Remove the expando if there's no more data
+ if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
+
+ // Support: Chrome <=35 - 45
+ // Webkit & Blink performance suffers when deleting properties
+ // from DOM nodes, so set to undefined instead
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
+ if ( owner.nodeType ) {
+ owner[ this.expando ] = undefined;
+ } else {
+ delete owner[ this.expando ];
+ }
+ }
+ },
+ hasData: function( owner ) {
+ var cache = owner[ this.expando ];
+ return cache !== undefined && !jQuery.isEmptyObject( cache );
+ }
+};
+var dataPriv = new Data();
+
+var dataUser = new Data();
+
+
+
+// Implementation Summary
+//
+// 1. Enforce API surface and semantic compatibility with 1.9.x branch
+// 2. Improve the module's maintainability by reducing the storage
+// paths to a single mechanism.
+// 3. Use the same single mechanism to support "private" and "user" data.
+// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
+// 5. Avoid exposing implementation details on user objects (eg. expando properties)
+// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /[A-Z]/g;
+
+function getData( data ) {
+ if ( data === "true" ) {
+ return true;
+ }
+
+ if ( data === "false" ) {
+ return false;
+ }
+
+ if ( data === "null" ) {
+ return null;
+ }
+
+ // Only convert to a number if it doesn't change the string
+ if ( data === +data + "" ) {
+ return +data;
+ }
+
+ if ( rbrace.test( data ) ) {
+ return JSON.parse( data );
+ }
+
+ return data;
+}
+
+function dataAttr( elem, key, data ) {
+ var name;
+
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+ name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = getData( data );
+ } catch ( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ dataUser.set( elem, key, data );
+ } else {
+ data = undefined;
+ }
+ }
+ return data;
+}
+
+jQuery.extend( {
+ hasData: function( elem ) {
+ return dataUser.hasData( elem ) || dataPriv.hasData( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return dataUser.access( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ dataUser.remove( elem, name );
+ },
+
+ // TODO: Now that all calls to _data and _removeData have been replaced
+ // with direct calls to dataPriv methods, these can be deprecated.
+ _data: function( elem, name, data ) {
+ return dataPriv.access( elem, name, data );
+ },
+
+ _removeData: function( elem, name ) {
+ dataPriv.remove( elem, name );
+ }
+} );
+
+jQuery.fn.extend( {
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[ 0 ],
+ attrs = elem && elem.attributes;
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = dataUser.get( elem );
+
+ if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+
+ // Support: IE 11 only
+ // The attrs elements can be null (#14894)
+ if ( attrs[ i ] ) {
+ name = attrs[ i ].name;
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice( 5 ) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ }
+ dataPriv.set( elem, "hasDataAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each( function() {
+ dataUser.set( this, key );
+ } );
+ }
+
+ return access( this, function( value ) {
+ var data;
+
+ // The calling jQuery object (element matches) is not empty
+ // (and therefore has an element appears at this[ 0 ]) and the
+ // `value` parameter was not undefined. An empty jQuery object
+ // will result in `undefined` for elem = this[ 0 ] which will
+ // throw an exception if an attempt to read a data cache is made.
+ if ( elem && value === undefined ) {
+
+ // Attempt to get data from the cache
+ // The key will always be camelCased in Data
+ data = dataUser.get( elem, key );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // Attempt to "discover" the data in
+ // HTML5 custom data-* attrs
+ data = dataAttr( elem, key );
+ if ( data !== undefined ) {
+ return data;
+ }
+
+ // We tried really hard, but the data doesn't exist.
+ return;
+ }
+
+ // Set the data...
+ this.each( function() {
+
+ // We always store the camelCased key
+ dataUser.set( this, key, value );
+ } );
+ }, null, value, arguments.length > 1, null, true );
+ },
+
+ removeData: function( key ) {
+ return this.each( function() {
+ dataUser.remove( this, key );
+ } );
+ }
+} );
+
+
+jQuery.extend( {
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = dataPriv.get( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || Array.isArray( data ) ) {
+ queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // Clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // Not public - generate a queueHooks object, or return the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
+ empty: jQuery.Callbacks( "once memory" ).add( function() {
+ dataPriv.remove( elem, [ type + "queue", key ] );
+ } )
+ } );
+ }
+} );
+
+jQuery.fn.extend( {
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[ 0 ], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each( function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // Ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ } );
+ },
+ dequeue: function( type ) {
+ return this.each( function() {
+ jQuery.dequeue( this, type );
+ } );
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+} );
+var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
+
+var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
+
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHiddenWithinTree = function( elem, el ) {
+
+ // isHiddenWithinTree might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+
+ // Inline style trumps all
+ return elem.style.display === "none" ||
+ elem.style.display === "" &&
+
+ // Otherwise, check computed style
+ // Support: Firefox <=43 - 45
+ // Disconnected elements can have computed display: none, so first confirm that elem is
+ // in the document.
+ jQuery.contains( elem.ownerDocument, elem ) &&
+
+ jQuery.css( elem, "display" ) === "none";
+ };
+
+var swap = function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+
+
+
+function adjustCSS( elem, prop, valueParts, tween ) {
+ var adjusted,
+ scale = 1,
+ maxIterations = 20,
+ currentValue = tween ?
+ function() {
+ return tween.cur();
+ } :
+ function() {
+ return jQuery.css( elem, prop, "" );
+ },
+ initial = currentValue(),
+ unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
+ rcssNum.exec( jQuery.css( elem, prop ) );
+
+ if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
+
+ // Trust units reported by jQuery.css
+ unit = unit || initialInUnit[ 3 ];
+
+ // Make sure we update the tween properties later on
+ valueParts = valueParts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ initialInUnit = +initial || 1;
+
+ do {
+
+ // If previous iteration zeroed out, double until we get *something*.
+ // Use string for doubling so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ initialInUnit = initialInUnit / scale;
+ jQuery.style( elem, prop, initialInUnit + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // Break the loop if scale is unchanged or perfect, or if we've just had enough.
+ } while (
+ scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
+ );
+ }
+
+ if ( valueParts ) {
+ initialInUnit = +initialInUnit || +initial || 0;
+
+ // Apply relative offset (+=/-=) if specified
+ adjusted = valueParts[ 1 ] ?
+ initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
+ +valueParts[ 2 ];
+ if ( tween ) {
+ tween.unit = unit;
+ tween.start = initialInUnit;
+ tween.end = adjusted;
+ }
+ }
+ return adjusted;
+}
+
+
+var defaultDisplayMap = {};
+
+function getDefaultDisplay( elem ) {
+ var temp,
+ doc = elem.ownerDocument,
+ nodeName = elem.nodeName,
+ display = defaultDisplayMap[ nodeName ];
+
+ if ( display ) {
+ return display;
+ }
+
+ temp = doc.body.appendChild( doc.createElement( nodeName ) );
+ display = jQuery.css( temp, "display" );
+
+ temp.parentNode.removeChild( temp );
+
+ if ( display === "none" ) {
+ display = "block";
+ }
+ defaultDisplayMap[ nodeName ] = display;
+
+ return display;
+}
+
+function showHide( elements, show ) {
+ var display, elem,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ // Determine new display value for elements that need to change
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ display = elem.style.display;
+ if ( show ) {
+
+ // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
+ // check is required in this first loop unless we have a nonempty display value (either
+ // inline or about-to-be-restored)
+ if ( display === "none" ) {
+ values[ index ] = dataPriv.get( elem, "display" ) || null;
+ if ( !values[ index ] ) {
+ elem.style.display = "";
+ }
+ }
+ if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
+ values[ index ] = getDefaultDisplay( elem );
+ }
+ } else {
+ if ( display !== "none" ) {
+ values[ index ] = "none";
+
+ // Remember what we're overwriting
+ dataPriv.set( elem, "display", display );
+ }
+ }
+ }
+
+ // Set the display of the elements in a second loop to avoid constant reflow
+ for ( index = 0; index < length; index++ ) {
+ if ( values[ index ] != null ) {
+ elements[ index ].style.display = values[ index ];
+ }
+ }
+
+ return elements;
+}
+
+jQuery.fn.extend( {
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each( function() {
+ if ( isHiddenWithinTree( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ } );
+ }
+} );
+var rcheckableType = ( /^(?:checkbox|radio)$/i );
+
+var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i );
+
+var rscriptType = ( /^$|\/(?:java|ecma)script/i );
+
+
+
+// We have to close these tags to support XHTML (#13200)
+var wrapMap = {
+
+ // Support: IE <=9 only
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+
+ // XHTML parsers do not magically insert elements in the
+ // same way that tag soup parsers do. So we cannot shorten
+ // this by omitting <tbody> or other required elements.
+ thead: [ 1, "<table>", "</table>" ],
+ col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+ _default: [ 0, "", "" ]
+};
+
+// Support: IE <=9 only
+wrapMap.optgroup = wrapMap.option;
+
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+
+function getAll( context, tag ) {
+
+ // Support: IE <=9 - 11 only
+ // Use typeof to avoid zero-argument method invocation on host objects (#15151)
+ var ret;
+
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ ret = context.getElementsByTagName( tag || "*" );
+
+ } else if ( typeof context.querySelectorAll !== "undefined" ) {
+ ret = context.querySelectorAll( tag || "*" );
+
+ } else {
+ ret = [];
+ }
+
+ if ( tag === undefined || tag && nodeName( context, tag ) ) {
+ return jQuery.merge( [ context ], ret );
+ }
+
+ return ret;
+}
+
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ dataPriv.set(
+ elems[ i ],
+ "globalEval",
+ !refElements || dataPriv.get( refElements[ i ], "globalEval" )
+ );
+ }
+}
+
+
+var rhtml = /<|&#?\w+;/;
+
+function buildFragment( elems, context, scripts, selection, ignored ) {
+ var elem, tmp, tag, wrap, contains, j,
+ fragment = context.createDocumentFragment(),
+ nodes = [],
+ i = 0,
+ l = elems.length;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
+
+ // Deserialize a standard representation
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+ tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
+
+ // Descend through wrappers to the right content
+ j = wrap[ 0 ];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Remember the top-level container
+ tmp = fragment.firstChild;
+
+ // Ensure the created nodes are orphaned (#12392)
+ tmp.textContent = "";
+ }
+ }
+ }
+
+ // Remove wrapper from fragment
+ fragment.textContent = "";
+
+ i = 0;
+ while ( ( elem = nodes[ i++ ] ) ) {
+
+ // Skip elements already in the context collection (trac-4087)
+ if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
+ if ( ignored ) {
+ ignored.push( elem );
+ }
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( fragment.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( ( elem = tmp[ j++ ] ) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ return fragment;
+}
+
+
+( function() {
+ var fragment = document.createDocumentFragment(),
+ div = fragment.appendChild( document.createElement( "div" ) ),
+ input = document.createElement( "input" );
+
+ // Support: Android 4.0 - 4.3 only
+ // Check state lost if the name is set (#11217)
+ // Support: Windows Web Apps (WWA)
+ // `name` and `type` must use .setAttribute for WWA (#14901)
+ input.setAttribute( "type", "radio" );
+ input.setAttribute( "checked", "checked" );
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+
+ // Support: Android <=4.1 only
+ // Older WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE <=11 only
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ div.innerHTML = "<textarea>x</textarea>";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+} )();
+var documentElement = document.documentElement;
+
+
+
+var
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+// Support: IE <=9 only
+// See #13393 for more info
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+function on( elem, types, selector, data, fn, one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ on( elem, type, selector, data, types[ type ], one );
+ }
+ return elem;
+ }
+
+ if ( data == null && fn == null ) {
+
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return elem;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return elem.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ } );
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+
+ var handleObjIn, eventHandle, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = dataPriv.get( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Ensure that invalid selectors throw exceptions at attach time
+ // Evaluate against documentElement in case elem is a non-element node (e.g., document)
+ if ( selector ) {
+ jQuery.find.matchesSelector( documentElement, selector );
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !( events = elemData.events ) ) {
+ events = elemData.events = {};
+ }
+ if ( !( eventHandle = elemData.handle ) ) {
+ eventHandle = elemData.handle = function( e ) {
+
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
+ jQuery.event.dispatch.apply( elem, arguments ) : undefined;
+ };
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend( {
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join( "." )
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !( handlers = events[ type ] ) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener if the special events handler returns false
+ if ( !special.setup ||
+ special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+
+ var j, origCount, tmp,
+ events, t, handleObj,
+ special, handlers, type, namespaces, origType,
+ elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
+
+ if ( !elemData || !( events = elemData.events ) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[ 2 ] &&
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector ||
+ selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown ||
+ special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove data and the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ dataPriv.remove( elem, "handle events" );
+ }
+ },
+
+ dispatch: function( nativeEvent ) {
+
+ // Make a writable jQuery.Event from the native event object
+ var event = jQuery.event.fix( nativeEvent );
+
+ var i, j, ret, matched, handleObj, handlerQueue,
+ args = new Array( arguments.length ),
+ handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[ 0 ] = event;
+
+ for ( i = 1; i < arguments.length; i++ ) {
+ args[ i ] = arguments[ i ];
+ }
+
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( ( handleObj = matched.handlers[ j++ ] ) &&
+ !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or 2) have namespace(s)
+ // a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
+ handleObj.handler ).apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( ( event.result = ret ) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var i, handleObj, sel, matchedHandlers, matchedSelectors,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ if ( delegateCount &&
+
+ // Support: IE <=9
+ // Black-hole SVG <use> instance trees (trac-13180)
+ cur.nodeType &&
+
+ // Support: Firefox <=42
+ // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
+ // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
+ // Support: IE 11 only
+ // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
+ !( event.type === "click" && event.button >= 1 ) ) {
+
+ for ( ; cur !== this; cur = cur.parentNode || this ) {
+
+ // Don't check non-elements (#13208)
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
+ matchedHandlers = [];
+ matchedSelectors = {};
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matchedSelectors[ sel ] === undefined ) {
+ matchedSelectors[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) > -1 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matchedSelectors[ sel ] ) {
+ matchedHandlers.push( handleObj );
+ }
+ }
+ if ( matchedHandlers.length ) {
+ handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ cur = this;
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
+ }
+
+ return handlerQueue;
+ },
+
+ addProp: function( name, hook ) {
+ Object.defineProperty( jQuery.Event.prototype, name, {
+ enumerable: true,
+ configurable: true,
+
+ get: jQuery.isFunction( hook ) ?
+ function() {
+ if ( this.originalEvent ) {
+ return hook( this.originalEvent );
+ }
+ } :
+ function() {
+ if ( this.originalEvent ) {
+ return this.originalEvent[ name ];
+ }
+ },
+
+ set: function( value ) {
+ Object.defineProperty( this, name, {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value: value
+ } );
+ }
+ } );
+ },
+
+ fix: function( originalEvent ) {
+ return originalEvent[ jQuery.expando ] ?
+ originalEvent :
+ new jQuery.Event( originalEvent );
+ },
+
+ special: {
+ load: {
+
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ this.focus();
+ return false;
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Support: Firefox 20+
+ // Firefox doesn't alert if the returnValue field is not set.
+ if ( event.result !== undefined && event.originalEvent ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ }
+};
+
+jQuery.removeEvent = function( elem, type, handle ) {
+
+ // This "if" is needed for plain objects
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle );
+ }
+};
+
+jQuery.Event = function( src, props ) {
+
+ // Allow instantiation without the 'new' keyword
+ if ( !( this instanceof jQuery.Event ) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = src.defaultPrevented ||
+ src.defaultPrevented === undefined &&
+
+ // Support: Android <=2.3 only
+ src.returnValue === false ?
+ returnTrue :
+ returnFalse;
+
+ // Create target properties
+ // Support: Safari <=6 - 7 only
+ // Target should not be a text node (#504, #13143)
+ this.target = ( src.target && src.target.nodeType === 3 ) ?
+ src.target.parentNode :
+ src.target;
+
+ this.currentTarget = src.currentTarget;
+ this.relatedTarget = src.relatedTarget;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ constructor: jQuery.Event,
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+ isSimulated: false,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+
+ if ( e && !this.isSimulated ) {
+ e.preventDefault();
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+
+ if ( e && !this.isSimulated ) {
+ e.stopPropagation();
+ }
+ },
+ stopImmediatePropagation: function() {
+ var e = this.originalEvent;
+
+ this.isImmediatePropagationStopped = returnTrue;
+
+ if ( e && !this.isSimulated ) {
+ e.stopImmediatePropagation();
+ }
+
+ this.stopPropagation();
+ }
+};
+
+// Includes all common event props including KeyEvent and MouseEvent specific props
+jQuery.each( {
+ altKey: true,
+ bubbles: true,
+ cancelable: true,
+ changedTouches: true,
+ ctrlKey: true,
+ detail: true,
+ eventPhase: true,
+ metaKey: true,
+ pageX: true,
+ pageY: true,
+ shiftKey: true,
+ view: true,
+ "char": true,
+ charCode: true,
+ key: true,
+ keyCode: true,
+ button: true,
+ buttons: true,
+ clientX: true,
+ clientY: true,
+ offsetX: true,
+ offsetY: true,
+ pointerId: true,
+ pointerType: true,
+ screenX: true,
+ screenY: true,
+ targetTouches: true,
+ toElement: true,
+ touches: true,
+
+ which: function( event ) {
+ var button = event.button;
+
+ // Add which for key events
+ if ( event.which == null && rkeyEvent.test( event.type ) ) {
+ return event.charCode != null ? event.charCode : event.keyCode;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
+ if ( button & 1 ) {
+ return 1;
+ }
+
+ if ( button & 2 ) {
+ return 3;
+ }
+
+ if ( button & 4 ) {
+ return 2;
+ }
+
+ return 0;
+ }
+
+ return event.which;
+ }
+}, jQuery.event.addProp );
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+// so that event delegation works in jQuery.
+// Do the same for pointerenter/pointerleave and pointerover/pointerout
+//
+// Support: Safari 7 only
+// Safari sends mouseenter too often; see:
+// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
+// for the description of the bug (it existed in older Chrome versions as well).
+jQuery.each( {
+ mouseenter: "mouseover",
+ mouseleave: "mouseout",
+ pointerenter: "pointerover",
+ pointerleave: "pointerout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mouseenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+} );
+
+jQuery.fn.extend( {
+
+ on: function( types, selector, data, fn ) {
+ return on( this, types, selector, data, fn );
+ },
+ one: function( types, selector, data, fn ) {
+ return on( this, types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ?
+ handleObj.origType + "." + handleObj.namespace :
+ handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each( function() {
+ jQuery.event.remove( this, types, fn, selector );
+ } );
+ }
+} );
+
+
+var
+
+ /* eslint-disable max-len */
+
+ // See https://github.com/eslint/eslint/issues/3229
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
+
+ /* eslint-enable */
+
+ // Support: IE <=10 - 11, Edge 12 - 13
+ // In IE/Edge using regex groups here causes severe slowdowns.
+ // See https://connect.microsoft.com/IE/feedback/details/1736512/
+ rnoInnerhtml = /<script|<style|<link/i,
+
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptTypeMasked = /^true\/(.*)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
+
+// Prefer a tbody over its parent table for containing new rows
+function manipulationTarget( elem, content ) {
+ if ( nodeName( elem, "table" ) &&
+ nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
+
+ return jQuery( ">tbody", elem )[ 0 ] || elem;
+ }
+
+ return elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+
+ if ( match ) {
+ elem.type = match[ 1 ];
+ } else {
+ elem.removeAttribute( "type" );
+ }
+
+ return elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+ var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
+
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ // 1. Copy private data: events, handlers, etc.
+ if ( dataPriv.hasData( src ) ) {
+ pdataOld = dataPriv.access( src );
+ pdataCur = dataPriv.set( dest, pdataOld );
+ events = pdataOld.events;
+
+ if ( events ) {
+ delete pdataCur.handle;
+ pdataCur.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+ }
+
+ // 2. Copy user data
+ if ( dataUser.hasData( src ) ) {
+ udataOld = dataUser.access( src );
+ udataCur = jQuery.extend( {}, udataOld );
+
+ dataUser.set( dest, udataCur );
+ }
+}
+
+// Fix IE bugs, see support tests
+function fixInput( src, dest ) {
+ var nodeName = dest.nodeName.toLowerCase();
+
+ // Fails to persist the checked state of a cloned checkbox or radio button.
+ if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+ dest.checked = src.checked;
+
+ // Fails to return the selected option to the default selected state when cloning options
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+
+function domManip( collection, args, callback, ignored ) {
+
+ // Flatten any nested arrays
+ args = concat.apply( [], args );
+
+ var fragment, first, scripts, hasScripts, node, doc,
+ i = 0,
+ l = collection.length,
+ iNoClone = l - 1,
+ value = args[ 0 ],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction ||
+ ( l > 1 && typeof value === "string" &&
+ !support.checkClone && rchecked.test( value ) ) ) {
+ return collection.each( function( index ) {
+ var self = collection.eq( index );
+ if ( isFunction ) {
+ args[ 0 ] = value.call( this, index, self.html() );
+ }
+ domManip( self, args, callback, ignored );
+ } );
+ }
+
+ if ( l ) {
+ fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ // Require either new content or an interest in ignored elements to invoke the callback
+ if ( first || ignored ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item
+ // instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( collection[ i ], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !dataPriv.access( node, "globalEval" ) &&
+ jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+
+ // Optional AJAX dependency, but won't run scripts if not present
+ if ( jQuery._evalUrl ) {
+ jQuery._evalUrl( node.src );
+ }
+ } else {
+ DOMEval( node.textContent.replace( rcleanScript, "" ), doc );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return collection;
+}
+
+function remove( elem, selector, keepData ) {
+ var node,
+ nodes = selector ? jQuery.filter( selector, elem ) : elem,
+ i = 0;
+
+ for ( ; ( node = nodes[ i ] ) != null; i++ ) {
+ if ( !keepData && node.nodeType === 1 ) {
+ jQuery.cleanData( getAll( node ) );
+ }
+
+ if ( node.parentNode ) {
+ if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
+ setGlobalEval( getAll( node, "script" ) );
+ }
+ node.parentNode.removeChild( node );
+ }
+ }
+
+ return elem;
+}
+
+jQuery.extend( {
+ htmlPrefilter: function( html ) {
+ return html.replace( rxhtmlTag, "<$1></$2>" );
+ },
+
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var i, l, srcElements, destElements,
+ clone = elem.cloneNode( true ),
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ // Fix IE cloning issues
+ if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
+ !jQuery.isXMLDoc( elem ) ) {
+
+ // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
+ fixInput( srcElements[ i ], destElements[ i ] );
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {
+ cloneCopyEvent( srcElements[ i ], destElements[ i ] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ // Return the cloned set
+ return clone;
+ },
+
+ cleanData: function( elems ) {
+ var data, elem, type,
+ special = jQuery.event.special,
+ i = 0;
+
+ for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
+ if ( acceptData( elem ) ) {
+ if ( ( data = elem[ dataPriv.expando ] ) ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ // Support: Chrome <=35 - 45+
+ // Assign undefined instead of using delete, see Data#remove
+ elem[ dataPriv.expando ] = undefined;
+ }
+ if ( elem[ dataUser.expando ] ) {
+
+ // Support: Chrome <=35 - 45+
+ // Assign undefined instead of using delete, see Data#remove
+ elem[ dataUser.expando ] = undefined;
+ }
+ }
+ }
+ }
+} );
+
+jQuery.fn.extend( {
+ detach: function( selector ) {
+ return remove( this, selector, true );
+ },
+
+ remove: function( selector ) {
+ return remove( this, selector );
+ },
+
+ text: function( value ) {
+ return access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().each( function() {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ this.textContent = value;
+ }
+ } );
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ } );
+ },
+
+ prepend: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ } );
+ },
+
+ before: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ } );
+ },
+
+ after: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ } );
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; ( elem = this[ i ] ) != null; i++ ) {
+ if ( elem.nodeType === 1 ) {
+
+ // Prevent memory leaks
+ jQuery.cleanData( getAll( elem, false ) );
+
+ // Remove any remaining nodes
+ elem.textContent = "";
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function() {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ } );
+ },
+
+ html: function( value ) {
+ return access( this, function( value ) {
+ var elem = this[ 0 ] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined && elem.nodeType === 1 ) {
+ return elem.innerHTML;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
+
+ value = jQuery.htmlPrefilter( value );
+
+ try {
+ for ( ; i < l; i++ ) {
+ elem = this[ i ] || {};
+
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch ( e ) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var ignored = [];
+
+ // Make the changes, replacing each non-ignored context element with the new content
+ return domManip( this, arguments, function( elem ) {
+ var parent = this.parentNode;
+
+ if ( jQuery.inArray( this, ignored ) < 0 ) {
+ jQuery.cleanData( getAll( this ) );
+ if ( parent ) {
+ parent.replaceChild( elem, this );
+ }
+ }
+
+ // Force callback invocation
+ }, ignored );
+ }
+} );
+
+jQuery.each( {
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1,
+ i = 0;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone( true );
+ jQuery( insert[ i ] )[ original ]( elems );
+
+ // Support: Android <=4.0 only, PhantomJS 1 only
+ // .get() because push.apply(_, arraylike) throws on ancient WebKit
+ push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+} );
+var rmargin = ( /^margin/ );
+
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
+
+var getStyles = function( elem ) {
+
+ // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
+ // IE throws on elements created in popups
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
+ var view = elem.ownerDocument.defaultView;
+
+ if ( !view || !view.opener ) {
+ view = window;
+ }
+
+ return view.getComputedStyle( elem );
+ };
+
+
+
+( function() {
+
+ // Executing both pixelPosition & boxSizingReliable tests require only one layout
+ // so they're executed at the same time to save the second computation.
+ function computeStyleTests() {
+
+ // This is a singleton, we need to execute it only once
+ if ( !div ) {
+ return;
+ }
+
+ div.style.cssText =
+ "box-sizing:border-box;" +
+ "position:relative;display:block;" +
+ "margin:auto;border:1px;padding:1px;" +
+ "top:1%;width:50%";
+ div.innerHTML = "";
+ documentElement.appendChild( container );
+
+ var divStyle = window.getComputedStyle( div );
+ pixelPositionVal = divStyle.top !== "1%";
+
+ // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
+ reliableMarginLeftVal = divStyle.marginLeft === "2px";
+ boxSizingReliableVal = divStyle.width === "4px";
+
+ // Support: Android 4.0 - 4.3 only
+ // Some styles come back with percentage values, even though they shouldn't
+ div.style.marginRight = "50%";
+ pixelMarginRightVal = divStyle.marginRight === "4px";
+
+ documentElement.removeChild( container );
+
+ // Nullify the div so it wouldn't be stored in the memory and
+ // it will also be a sign that checks already performed
+ div = null;
+ }
+
+ var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
+ container = document.createElement( "div" ),
+ div = document.createElement( "div" );
+
+ // Finish early in limited (non-browser) environments
+ if ( !div.style ) {
+ return;
+ }
+
+ // Support: IE <=9 - 11 only
+ // Style of cloned element affects source element cloned (#8908)
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
+ "padding:0;margin-top:1px;position:absolute";
+ container.appendChild( div );
+
+ jQuery.extend( support, {
+ pixelPosition: function() {
+ computeStyleTests();
+ return pixelPositionVal;
+ },
+ boxSizingReliable: function() {
+ computeStyleTests();
+ return boxSizingReliableVal;
+ },
+ pixelMarginRight: function() {
+ computeStyleTests();
+ return pixelMarginRightVal;
+ },
+ reliableMarginLeft: function() {
+ computeStyleTests();
+ return reliableMarginLeftVal;
+ }
+ } );
+} )();
+
+
+function curCSS( elem, name, computed ) {
+ var width, minWidth, maxWidth, ret,
+
+ // Support: Firefox 51+
+ // Retrieving style before computed somehow
+ // fixes an issue with getting wrong values
+ // on detached elements
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+
+ // getPropertyValue is needed for:
+ // .css('filter') (IE 9 only, #12537)
+ // .css('--customProperty) (#3144)
+ if ( computed ) {
+ ret = computed.getPropertyValue( name ) || computed[ name ];
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Android Browser returns percentage for some values,
+ // but width seems to be reliably pixels.
+ // This is against the CSSOM draft spec:
+ // https://drafts.csswg.org/cssom/#resolved-values
+ if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ return ret !== undefined ?
+
+ // Support: IE <=9 - 11 only
+ // IE returns zIndex value as an integer.
+ ret + "" :
+ ret;
+}
+
+
+function addGetHookIf( conditionFn, hookFn ) {
+
+ // Define the hook, we'll check on the first run if it's really needed.
+ return {
+ get: function() {
+ if ( conditionFn() ) {
+
+ // Hook not needed (or it's not possible to use it due
+ // to missing dependency), remove it.
+ delete this.get;
+ return;
+ }
+
+ // Hook needed; redefine it so that the support test is not executed again.
+ return ( this.get = hookFn ).apply( this, arguments );
+ }
+ };
+}
+
+
+var
+
+ // Swappable if display is none or starts with table
+ // except "table", "table-cell", or "table-caption"
+ // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rcustomProp = /^--/,
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: "0",
+ fontWeight: "400"
+ },
+
+ cssPrefixes = [ "Webkit", "Moz", "ms" ],
+ emptyStyle = document.createElement( "div" ).style;
+
+// Return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( name ) {
+
+ // Shortcut for names that are not vendor prefixed
+ if ( name in emptyStyle ) {
+ return name;
+ }
+
+ // Check for vendor prefixed names
+ var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in emptyStyle ) {
+ return name;
+ }
+ }
+}
+
+// Return a property mapped along what jQuery.cssProps suggests or to
+// a vendor prefixed property.
+function finalPropName( name ) {
+ var ret = jQuery.cssProps[ name ];
+ if ( !ret ) {
+ ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name;
+ }
+ return ret;
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+
+ // Any relative (+/-) values have already been
+ // normalized at this point
+ var matches = rcssNum.exec( value );
+ return matches ?
+
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i,
+ val = 0;
+
+ // If we already have the right measurement, avoid augmentation
+ if ( extra === ( isBorderBox ? "border" : "content" ) ) {
+ i = 4;
+
+ // Otherwise initialize for horizontal or vertical properties
+ } else {
+ i = name === "width" ? 1 : 0;
+ }
+
+ for ( ; i < 4; i += 2 ) {
+
+ // Both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // At this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+
+ // At this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // At this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with computed style
+ var valueIsBorderBox,
+ styles = getStyles( elem ),
+ val = curCSS( elem, name, styles ),
+ isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test( val ) ) {
+ return val;
+ }
+
+ // Check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox &&
+ ( support.boxSizingReliable() || val === elem.style[ name ] );
+
+ // Fall back to offsetWidth/Height when value is "auto"
+ // This happens for inline elements with no explicit setting (gh-3571)
+ if ( val === "auto" ) {
+ val = elem[ "offset" + name[ 0 ].toUpperCase() + name.slice( 1 ) ];
+ }
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+
+ // Use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+jQuery.extend( {
+
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "animationIterationCount": true,
+ "columnCount": true,
+ "fillOpacity": true,
+ "flexGrow": true,
+ "flexShrink": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ "float": "cssFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ isCustomProp = rcustomProp.test( name ),
+ style = elem.style;
+
+ // Make sure that we're working with the right name. We don't
+ // want to query the value if it is a CSS custom property
+ // since they are user-defined.
+ if ( !isCustomProp ) {
+ name = finalPropName( origName );
+ }
+
+ // Gets hook for the prefixed version, then unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // Convert "+=" or "-=" to relative numbers (#7345)
+ if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
+ value = adjustCSS( elem, name, ret );
+
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that null and NaN values aren't set (#7116)
+ if ( value == null || value !== value ) {
+ return;
+ }
+
+ // If a number was passed in, add the unit (except for certain CSS properties)
+ if ( type === "number" ) {
+ value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
+ }
+
+ // background-* props affect original clone's values
+ if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !( "set" in hooks ) ||
+ ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
+
+ if ( isCustomProp ) {
+ style.setProperty( name, value );
+ } else {
+ style[ name ] = value;
+ }
+ }
+
+ } else {
+
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks &&
+ ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
+
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var val, num, hooks,
+ origName = jQuery.camelCase( name ),
+ isCustomProp = rcustomProp.test( name );
+
+ // Make sure that we're working with the right name. We don't
+ // want to modify the value if it is a CSS custom property
+ // since they are user-defined.
+ if ( !isCustomProp ) {
+ name = finalPropName( origName );
+ }
+
+ // Try prefixed name followed by the unprefixed name
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ // Convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Make numeric if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || isFinite( num ) ? num || 0 : val;
+ }
+
+ return val;
+ }
+} );
+
+jQuery.each( [ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+
+ // Certain elements can have dimension info if we invisibly show them
+ // but it must have a current display style that would benefit
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
+
+ // Support: Safari 8+
+ // Table columns in Safari have non-zero offsetWidth & zero
+ // getBoundingClientRect().width unless display is changed.
+ // Support: IE <=11 only
+ // Running getBoundingClientRect on a disconnected node
+ // in IE throws an error.
+ ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
+ swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ } ) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var matches,
+ styles = extra && getStyles( elem ),
+ subtract = extra && augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ );
+
+ // Convert to pixels if value adjustment is needed
+ if ( subtract && ( matches = rcssNum.exec( value ) ) &&
+ ( matches[ 3 ] || "px" ) !== "px" ) {
+
+ elem.style[ name ] = value;
+ value = jQuery.css( elem, name );
+ }
+
+ return setPositiveNumber( elem, value, subtract );
+ }
+ };
+} );
+
+jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
+ function( elem, computed ) {
+ if ( computed ) {
+ return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
+ elem.getBoundingClientRect().left -
+ swap( elem, { marginLeft: 0 }, function() {
+ return elem.getBoundingClientRect().left;
+ } )
+ ) + "px";
+ }
+ }
+);
+
+// These hooks are used by animate to expand properties
+jQuery.each( {
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // Assumes a single number if not a string
+ parts = typeof value === "string" ? value.split( " " ) : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+} );
+
+jQuery.fn.extend( {
+ css: function( name, value ) {
+ return access( this, function( elem, name, value ) {
+ var styles, len,
+ map = {},
+ i = 0;
+
+ if ( Array.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ }
+} );
+
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || jQuery.easing._default;
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ // Use a property on the element directly when it is not a DOM element,
+ // or when there is no matching style property that exists.
+ if ( tween.elem.nodeType !== 1 ||
+ tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // Passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails.
+ // Simple values such as "10px" are parsed to Float;
+ // complex values such as "rotate(1rad)" are returned as-is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+
+ // Use step hook for back compat.
+ // Use cssHook if its there.
+ // Use .style if available and use plain properties where available.
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.nodeType === 1 &&
+ ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
+ jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE <=9 only
+// Panic based approach to setting things on disconnected nodes
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
+ },
+ _default: "swing"
+};
+
+jQuery.fx = Tween.prototype.init;
+
+// Back compat <1.8 extension point
+jQuery.fx.step = {};
+
+
+
+
+var
+ fxNow, inProgress,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rrun = /queueHooks$/;
+
+function schedule() {
+ if ( inProgress ) {
+ if ( document.hidden === false && window.requestAnimationFrame ) {
+ window.requestAnimationFrame( schedule );
+ } else {
+ window.setTimeout( schedule, jQuery.fx.interval );
+ }
+
+ jQuery.fx.tick();
+ }
+}
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ window.setTimeout( function() {
+ fxNow = undefined;
+ } );
+ return ( fxNow = jQuery.now() );
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ i = 0,
+ attrs = { height: type };
+
+ // If we include width, step value is 1 to do all cssExpand values,
+ // otherwise step value is 2 to skip over Left and Right
+ includeWidth = includeWidth ? 1 : 0;
+ for ( ; i < 4; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
+
+ // We're done with this property
+ return tween;
+ }
+ }
+}
+
+function defaultPrefilter( elem, props, opts ) {
+ var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
+ isBox = "width" in props || "height" in props,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHiddenWithinTree( elem ),
+ dataShow = dataPriv.get( elem, "fxshow" );
+
+ // Queue-skipping animations hijack the fx hooks
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always( function() {
+
+ // Ensure the complete handler is called before this completes
+ anim.always( function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ } );
+ } );
+ }
+
+ // Detect show/hide animations
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.test( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+
+ // Pretend to be hidden if this is a "show" and
+ // there is still data from a stopped show/hide
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+ hidden = true;
+
+ // Ignore all other no-op show/hide data
+ } else {
+ continue;
+ }
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+ }
+ }
+
+ // Bail out if this is a no-op like .hide().hide()
+ propTween = !jQuery.isEmptyObject( props );
+ if ( !propTween && jQuery.isEmptyObject( orig ) ) {
+ return;
+ }
+
+ // Restrict "overflow" and "display" styles during box animations
+ if ( isBox && elem.nodeType === 1 ) {
+
+ // Support: IE <=9 - 11, Edge 12 - 13
+ // Record all 3 overflow attributes because IE does not infer the shorthand
+ // from identically-valued overflowX and overflowY
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Identify a display type, preferring old show/hide data over the CSS cascade
+ restoreDisplay = dataShow && dataShow.display;
+ if ( restoreDisplay == null ) {
+ restoreDisplay = dataPriv.get( elem, "display" );
+ }
+ display = jQuery.css( elem, "display" );
+ if ( display === "none" ) {
+ if ( restoreDisplay ) {
+ display = restoreDisplay;
+ } else {
+
+ // Get nonempty value(s) by temporarily forcing visibility
+ showHide( [ elem ], true );
+ restoreDisplay = elem.style.display || restoreDisplay;
+ display = jQuery.css( elem, "display" );
+ showHide( [ elem ] );
+ }
+ }
+
+ // Animate inline elements as inline-block
+ if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
+ if ( jQuery.css( elem, "float" ) === "none" ) {
+
+ // Restore the original display value at the end of pure show/hide animations
+ if ( !propTween ) {
+ anim.done( function() {
+ style.display = restoreDisplay;
+ } );
+ if ( restoreDisplay == null ) {
+ display = style.display;
+ restoreDisplay = display === "none" ? "" : display;
+ }
+ }
+ style.display = "inline-block";
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ anim.always( function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ } );
+ }
+
+ // Implement show/hide animations
+ propTween = false;
+ for ( prop in orig ) {
+
+ // General show/hide setup for this element animation
+ if ( !propTween ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
+ }
+
+ // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+
+ // Show elements before animating them
+ if ( hidden ) {
+ showHide( [ elem ], true );
+ }
+
+ /* eslint-disable no-loop-func */
+
+ anim.done( function() {
+
+ /* eslint-enable no-loop-func */
+
+ // The final step of a "hide" animation is actually hiding the element
+ if ( !hidden ) {
+ showHide( [ elem ] );
+ }
+ dataPriv.remove( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ } );
+ }
+
+ // Per-property setup
+ propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = propTween.start;
+ if ( hidden ) {
+ propTween.end = propTween.start;
+ propTween.start = 0;
+ }
+ }
+ }
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( Array.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // Not quite $.extend, this won't overwrite existing keys.
+ // Reusing 'index' because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = Animation.prefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+
+ // Don't match elem in the :animated selector
+ delete tick.elem;
+ } ),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+
+ // Support: Android 2.3 only
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ] );
+
+ // If there's more to do, yield
+ if ( percent < 1 && length ) {
+ return remaining;
+ }
+
+ // If this was an empty animation, synthesize a final progress notification
+ if ( !length ) {
+ deferred.notifyWith( elem, [ animation, 1, 0 ] );
+ }
+
+ // Resolve the animation and report its conclusion
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ },
+ animation = deferred.promise( {
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, {
+ specialEasing: {},
+ easing: jQuery.easing._default
+ }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+
+ // If we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // Resolve when we played the last frame; otherwise, reject
+ if ( gotoEnd ) {
+ deferred.notifyWith( elem, [ animation, 1, 0 ] );
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ } ),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length; index++ ) {
+ result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ if ( jQuery.isFunction( result.stop ) ) {
+ jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
+ jQuery.proxy( result.stop, result );
+ }
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ // Attach callbacks from options
+ animation
+ .progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ } )
+ );
+
+ return animation;
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+ tweeners: {
+ "*": [ function( prop, value ) {
+ var tween = this.createTween( prop, value );
+ adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
+ return tween;
+ } ]
+ },
+
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.match( rnothtmlwhite );
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length; index++ ) {
+ prop = props[ index ];
+ Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
+ Animation.tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilters: [ defaultPrefilter ],
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ Animation.prefilters.unshift( callback );
+ } else {
+ Animation.prefilters.push( callback );
+ }
+ }
+} );
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ // Go to the end state if fx are off
+ if ( jQuery.fx.off ) {
+ opt.duration = 0;
+
+ } else {
+ if ( typeof opt.duration !== "number" ) {
+ if ( opt.duration in jQuery.fx.speeds ) {
+ opt.duration = jQuery.fx.speeds[ opt.duration ];
+
+ } else {
+ opt.duration = jQuery.fx.speeds._default;
+ }
+ }
+ }
+
+ // Normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.fn.extend( {
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // Show any hidden elements after setting opacity to 0
+ return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
+
+ // Animate to the value specified
+ .end().animate( { opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || dataPriv.get( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each( function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = dataPriv.get( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this &&
+ ( type == null || timers[ index ].queue === type ) ) {
+
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // Start the next in the queue if the last step wasn't forced.
+ // Timers currently will call their complete callbacks, which
+ // will dequeue but only if they were gotoEnd.
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ } );
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each( function() {
+ var index,
+ data = dataPriv.get( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // Enable finishing flag on private data
+ data.finish = true;
+
+ // Empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // Look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // Look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // Turn off finishing flag
+ delete data.finish;
+ } );
+ }
+} );
+
+jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+} );
+
+// Generate shortcuts for custom animations
+jQuery.each( {
+ slideDown: genFx( "show" ),
+ slideUp: genFx( "hide" ),
+ slideToggle: genFx( "toggle" ),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+} );
+
+jQuery.timers = [];
+jQuery.fx.tick = function() {
+ var timer,
+ i = 0,
+ timers = jQuery.timers;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+
+ // Run the timer and safely remove it when done (allowing for external removal)
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ jQuery.timers.push( timer );
+ jQuery.fx.start();
+};
+
+jQuery.fx.interval = 13;
+jQuery.fx.start = function() {
+ if ( inProgress ) {
+ return;
+ }
+
+ inProgress = true;
+ schedule();
+};
+
+jQuery.fx.stop = function() {
+ inProgress = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+
+ // Default speed
+ _default: 400
+};
+
+
+// Based off of the plugin by Clint Helfers, with permission.
+// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
+jQuery.fn.delay = function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = window.setTimeout( next, time );
+ hooks.stop = function() {
+ window.clearTimeout( timeout );
+ };
+ } );
+};
+
+
+( function() {
+ var input = document.createElement( "input" ),
+ select = document.createElement( "select" ),
+ opt = select.appendChild( document.createElement( "option" ) );
+
+ input.type = "checkbox";
+
+ // Support: Android <=4.3 only
+ // Default value for a checkbox should be "on"
+ support.checkOn = input.value !== "";
+
+ // Support: IE <=11 only
+ // Must access selectedIndex to make default options select
+ support.optSelected = opt.selected;
+
+ // Support: IE <=11 only
+ // An input loses its value after becoming a radio
+ input = document.createElement( "input" );
+ input.value = "t";
+ input.type = "radio";
+ support.radioValue = input.value === "t";
+} )();
+
+
+var boolHook,
+ attrHandle = jQuery.expr.attrHandle;
+
+jQuery.fn.extend( {
+ attr: function( name, value ) {
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each( function() {
+ jQuery.removeAttr( this, name );
+ } );
+ }
+} );
+
+jQuery.extend( {
+ attr: function( elem, name, value ) {
+ var ret, hooks,
+ nType = elem.nodeType;
+
+ // Don't get/set attributes on text, comment and attribute nodes
+ if ( nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === "undefined" ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // Attribute hooks are determined by the lowercase version
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
+ }
+
+ if ( value !== undefined ) {
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return;
+ }
+
+ if ( hooks && "set" in hooks &&
+ ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
+ return ret;
+ }
+
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
+ return ret;
+ }
+
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ? undefined : ret;
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !support.radioValue && value === "radio" &&
+ nodeName( elem, "input" ) ) {
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name,
+ i = 0,
+
+ // Attribute names can contain non-HTML whitespace characters
+ // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
+ attrNames = value && value.match( rnothtmlwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( ( name = attrNames[ i++ ] ) ) {
+ elem.removeAttribute( name );
+ }
+ }
+ }
+} );
+
+// Hooks for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else {
+ elem.setAttribute( name, name );
+ }
+ return name;
+ }
+};
+
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+ var getter = attrHandle[ name ] || jQuery.find.attr;
+
+ attrHandle[ name ] = function( elem, name, isXML ) {
+ var ret, handle,
+ lowercaseName = name.toLowerCase();
+
+ if ( !isXML ) {
+
+ // Avoid an infinite loop by temporarily removing this function from the getter
+ handle = attrHandle[ lowercaseName ];
+ attrHandle[ lowercaseName ] = ret;
+ ret = getter( elem, name, isXML ) != null ?
+ lowercaseName :
+ null;
+ attrHandle[ lowercaseName ] = handle;
+ }
+ return ret;
+ };
+} );
+
+
+
+
+var rfocusable = /^(?:input|select|textarea|button)$/i,
+ rclickable = /^(?:a|area)$/i;
+
+jQuery.fn.extend( {
+ prop: function( name, value ) {
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ return this.each( function() {
+ delete this[ jQuery.propFix[ name ] || name ];
+ } );
+ }
+} );
+
+jQuery.extend( {
+ prop: function( elem, name, value ) {
+ var ret, hooks,
+ nType = elem.nodeType;
+
+ // Don't get/set properties on text, comment and attribute nodes
+ if ( nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks &&
+ ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
+ return ret;
+ }
+
+ return ( elem[ name ] = value );
+ }
+
+ if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
+ return ret;
+ }
+
+ return elem[ name ];
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+
+ // Support: IE <=9 - 11 only
+ // elem.tabIndex doesn't always return the
+ // correct value when it hasn't been explicitly set
+ // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ if ( tabindex ) {
+ return parseInt( tabindex, 10 );
+ }
+
+ if (
+ rfocusable.test( elem.nodeName ) ||
+ rclickable.test( elem.nodeName ) &&
+ elem.href
+ ) {
+ return 0;
+ }
+
+ return -1;
+ }
+ }
+ },
+
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ }
+} );
+
+// Support: IE <=11 only
+// Accessing the selectedIndex property
+// forces the browser to respect setting selected
+// on the option
+// The getter ensures a default option is selected
+// when in an optgroup
+// eslint rule "no-unused-expressions" is disabled for this code
+// since it considers such accessions noop
+if ( !support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+
+ /* eslint no-unused-expressions: "off" */
+
+ var parent = elem.parentNode;
+ if ( parent && parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ return null;
+ },
+ set: function( elem ) {
+
+ /* eslint no-unused-expressions: "off" */
+
+ var parent = elem.parentNode;
+ if ( parent ) {
+ parent.selectedIndex;
+
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ }
+ };
+}
+
+jQuery.each( [
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+} );
+
+
+
+
+ // Strip and collapse whitespace according to HTML spec
+ // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
+ function stripAndCollapse( value ) {
+ var tokens = value.match( rnothtmlwhite ) || [];
+ return tokens.join( " " );
+ }
+
+
+function getClass( elem ) {
+ return elem.getAttribute && elem.getAttribute( "class" ) || "";
+}
+
+jQuery.fn.extend( {
+ addClass: function( value ) {
+ var classes, elem, cur, curValue, clazz, j, finalValue,
+ i = 0;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each( function( j ) {
+ jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
+ } );
+ }
+
+ if ( typeof value === "string" && value ) {
+ classes = value.match( rnothtmlwhite ) || [];
+
+ while ( ( elem = this[ i++ ] ) ) {
+ curValue = getClass( elem );
+ cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
+
+ if ( cur ) {
+ j = 0;
+ while ( ( clazz = classes[ j++ ] ) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+
+ // Only assign if different to avoid unneeded rendering.
+ finalValue = stripAndCollapse( cur );
+ if ( curValue !== finalValue ) {
+ elem.setAttribute( "class", finalValue );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, curValue, clazz, j, finalValue,
+ i = 0;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each( function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
+ } );
+ }
+
+ if ( !arguments.length ) {
+ return this.attr( "class", "" );
+ }
+
+ if ( typeof value === "string" && value ) {
+ classes = value.match( rnothtmlwhite ) || [];
+
+ while ( ( elem = this[ i++ ] ) ) {
+ curValue = getClass( elem );
+
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
+
+ if ( cur ) {
+ j = 0;
+ while ( ( clazz = classes[ j++ ] ) ) {
+
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+
+ // Only assign if different to avoid unneeded rendering.
+ finalValue = stripAndCollapse( cur );
+ if ( curValue !== finalValue ) {
+ elem.setAttribute( "class", finalValue );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each( function( i ) {
+ jQuery( this ).toggleClass(
+ value.call( this, i, getClass( this ), stateVal ),
+ stateVal
+ );
+ } );
+ }
+
+ return this.each( function() {
+ var className, i, self, classNames;
+
+ if ( type === "string" ) {
+
+ // Toggle individual class names
+ i = 0;
+ self = jQuery( this );
+ classNames = value.match( rnothtmlwhite ) || [];
+
+ while ( ( className = classNames[ i++ ] ) ) {
+
+ // Check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( value === undefined || type === "boolean" ) {
+ className = getClass( this );
+ if ( className ) {
+
+ // Store className if set
+ dataPriv.set( this, "__className__", className );
+ }
+
+ // If the element has a class name or if we're passed `false`,
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ if ( this.setAttribute ) {
+ this.setAttribute( "class",
+ className || value === false ?
+ "" :
+ dataPriv.get( this, "__className__" ) || ""
+ );
+ }
+ }
+ } );
+ },
+
+ hasClass: function( selector ) {
+ var className, elem,
+ i = 0;
+
+ className = " " + selector + " ";
+ while ( ( elem = this[ i++ ] ) ) {
+ if ( elem.nodeType === 1 &&
+ ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+} );
+
+
+
+
+var rreturn = /\r/g;
+
+jQuery.fn.extend( {
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[ 0 ];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] ||
+ jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks &&
+ "get" in hooks &&
+ ( ret = hooks.get( elem, "value" ) ) !== undefined
+ ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ // Handle most common string cases
+ if ( typeof ret === "string" ) {
+ return ret.replace( rreturn, "" );
+ }
+
+ // Handle cases where value is null/undef or number
+ return ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each( function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+
+ } else if ( typeof val === "number" ) {
+ val += "";
+
+ } else if ( Array.isArray( val ) ) {
+ val = jQuery.map( val, function( value ) {
+ return value == null ? "" : value + "";
+ } );
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ } );
+ }
+} );
+
+jQuery.extend( {
+ valHooks: {
+ option: {
+ get: function( elem ) {
+
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+
+ // Support: IE <=10 - 11 only
+ // option.text throws exceptions (#14686, #14858)
+ // Strip and collapse whitespace
+ // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
+ stripAndCollapse( jQuery.text( elem ) );
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option, i,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one",
+ values = one ? null : [],
+ max = one ? index + 1 : options.length;
+
+ if ( index < 0 ) {
+ i = max;
+
+ } else {
+ i = one ? index : 0;
+ }
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // Support: IE <=9 only
+ // IE8-9 doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+
+ // Don't return options that are disabled or in a disabled optgroup
+ !option.disabled &&
+ ( !option.parentNode.disabled ||
+ !nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+
+ /* eslint-disable no-cond-assign */
+
+ if ( option.selected =
+ jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
+ ) {
+ optionSet = true;
+ }
+
+ /* eslint-enable no-cond-assign */
+ }
+
+ // Force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+ return values;
+ }
+ }
+ }
+} );
+
+// Radios and checkboxes getter/setter
+jQuery.each( [ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( Array.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
+ }
+ }
+ };
+ if ( !support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ return elem.getAttribute( "value" ) === null ? "on" : elem.value;
+ };
+ }
+} );
+
+
+
+
+// Return jQuery for attributes-only inclusion
+
+
+var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
+
+jQuery.extend( jQuery.event, {
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+
+ var i, cur, tmp, bubbleType, ontype, handle, special,
+ eventPath = [ elem || document ],
+ type = hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf( "." ) > -1 ) {
+
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split( "." );
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf( ":" ) < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join( "." );
+ event.rnamespace = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === ( elem.ownerDocument || document ) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
+ dataPriv.get( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && handle.apply && acceptData( cur ) ) {
+ event.result = handle.apply( cur, data );
+ if ( event.result === false ) {
+ event.preventDefault();
+ }
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( ( !special._default ||
+ special._default.apply( eventPath.pop(), data ) === false ) &&
+ acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name as the event.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ elem[ type ]();
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ // Piggyback on a donor event to simulate a different one
+ // Used only for `focus(in | out)` events
+ simulate: function( type, elem, event ) {
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true
+ }
+ );
+
+ jQuery.event.trigger( e, null, elem );
+ }
+
+} );
+
+jQuery.fn.extend( {
+
+ trigger: function( type, data ) {
+ return this.each( function() {
+ jQuery.event.trigger( type, data, this );
+ } );
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[ 0 ];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+} );
+
+
+jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup contextmenu" ).split( " " ),
+ function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+} );
+
+jQuery.fn.extend( {
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+} );
+
+
+
+
+support.focusin = "onfocusin" in window;
+
+
+// Support: Firefox <=44
+// Firefox doesn't have focus(in | out) events
+// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
+//
+// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
+// focus(in | out) events fire after focus & blur events,
+// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
+// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
+if ( !support.focusin ) {
+ jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
+ var handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ var doc = this.ownerDocument || this,
+ attaches = dataPriv.access( doc, fix );
+
+ if ( !attaches ) {
+ doc.addEventListener( orig, handler, true );
+ }
+ dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
+ },
+ teardown: function() {
+ var doc = this.ownerDocument || this,
+ attaches = dataPriv.access( doc, fix ) - 1;
+
+ if ( !attaches ) {
+ doc.removeEventListener( orig, handler, true );
+ dataPriv.remove( doc, fix );
+
+ } else {
+ dataPriv.access( doc, fix, attaches );
+ }
+ }
+ };
+ } );
+}
+var location = window.location;
+
+var nonce = jQuery.now();
+
+var rquery = ( /\?/ );
+
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+
+ // Support: IE 9 - 11 only
+ // IE throws on parseFromString with invalid input.
+ try {
+ xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
+ } catch ( e ) {
+ xml = undefined;
+ }
+
+ if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+
+var
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( Array.isArray( obj ) ) {
+
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams(
+ prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
+ v,
+ traditional,
+ add
+ );
+ }
+ } );
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, valueOrFunction ) {
+
+ // If value is a function, invoke it and use its return value
+ var value = jQuery.isFunction( valueOrFunction ) ?
+ valueOrFunction() :
+ valueOrFunction;
+
+ s[ s.length ] = encodeURIComponent( key ) + "=" +
+ encodeURIComponent( value == null ? "" : value );
+ };
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ } );
+
+ } else {
+
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" );
+};
+
+jQuery.fn.extend( {
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map( function() {
+
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ } )
+ .filter( function() {
+ var type = this.type;
+
+ // Use .is( ":disabled" ) so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !rcheckableType.test( type ) );
+ } )
+ .map( function( i, elem ) {
+ var val = jQuery( this ).val();
+
+ if ( val == null ) {
+ return null;
+ }
+
+ if ( Array.isArray( val ) ) {
+ return jQuery.map( val, function( val ) {
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ } );
+ }
+
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ } ).get();
+ }
+} );
+
+
+var
+ r20 = /%20/g,
+ rhash = /#.*$/,
+ rantiCache = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
+
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat( "*" ),
+
+ // Anchor tag for parsing the document origin
+ originAnchor = document.createElement( "a" );
+ originAnchor.href = location.href;
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+
+ // For each dataType in the dataTypeExpression
+ while ( ( dataType = dataTypes[ i++ ] ) ) {
+
+ // Prepend if requested
+ if ( dataType[ 0 ] === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
+
+ // Otherwise append
+ } else {
+ ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if ( typeof dataTypeOrTransport === "string" &&
+ !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ } );
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var key, deep,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+
+ var ct, type, finalDataType, firstDataType,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while ( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s.throws ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return {
+ state: "parsererror",
+ error: conv ? e : "No conversion from " + prev + " to " + current
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+
+jQuery.extend( {
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: location.href,
+ type: "GET",
+ isLocal: rlocalProtocol.test( location.protocol ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /\bxml\b/,
+ html: /\bhtml/,
+ json: /\bjson\b/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": JSON.parse,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var transport,
+
+ // URL without anti-cache param
+ cacheURL,
+
+ // Response headers
+ responseHeadersString,
+ responseHeaders,
+
+ // timeout handle
+ timeoutTimer,
+
+ // Url cleanup var
+ urlAnchor,
+
+ // Request state (becomes false upon send and true upon completion)
+ completed,
+
+ // To know if global events are to be dispatched
+ fireGlobals,
+
+ // Loop variable
+ i,
+
+ // uncached part of the url
+ uncached,
+
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+
+ // Callbacks context
+ callbackContext = s.context || s,
+
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context &&
+ ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks( "once memory" ),
+
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+
+ // Default abort message
+ strAbort = "canceled",
+
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( completed ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return completed ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ if ( completed == null ) {
+ name = requestHeadersNames[ name.toLowerCase() ] =
+ requestHeadersNames[ name.toLowerCase() ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( completed == null ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( completed ) {
+
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ } else {
+
+ // Lazy-add the new callbacks in a way that preserves old ones
+ for ( code in map ) {
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR );
+
+ // Add protocol if not provided (prefilters might expect it)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || location.href ) + "" )
+ .replace( rprotocol, location.protocol + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
+
+ // A cross-domain request is in order when the origin doesn't match the current origin.
+ if ( s.crossDomain == null ) {
+ urlAnchor = document.createElement( "a" );
+
+ // Support: IE <=8 - 11, Edge 12 - 13
+ // IE throws exception on accessing the href property if url is malformed,
+ // e.g. http://example.com:80x/
+ try {
+ urlAnchor.href = s.url;
+
+ // Support: IE <=8 - 11 only
+ // Anchor's host property isn't correctly set when s.url is relative
+ urlAnchor.href = urlAnchor.href;
+ s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
+ urlAnchor.protocol + "//" + urlAnchor.host;
+ } catch ( e ) {
+
+ // If there is an error parsing the URL, assume it is crossDomain,
+ // it can be rejected by the transport if it is invalid
+ s.crossDomain = true;
+ }
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( completed ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+ fireGlobals = jQuery.event && s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ // Remove hash to simplify url manipulation
+ cacheURL = s.url.replace( rhash, "" );
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // Remember the hash so we can put it back
+ uncached = s.url.slice( cacheURL.length );
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
+
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add or update anti-cache param if needed
+ if ( s.cache === false ) {
+ cacheURL = cacheURL.replace( rantiCache, "$1" );
+ uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
+ }
+
+ // Put hash and anti-cache on the URL that will be requested (gh-1732)
+ s.url = cacheURL + uncached;
+
+ // Change '%20' to '+' if this is encoded form body content (gh-2658)
+ } else if ( s.data && s.processData &&
+ ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
+ s.data = s.data.replace( r20, "+" );
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
+ s.accepts[ s.dataTypes[ 0 ] ] +
+ ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend &&
+ ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
+
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // Aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ completeDeferred.add( s.complete );
+ jqXHR.done( s.success );
+ jqXHR.fail( s.error );
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+
+ // If request was aborted inside ajaxSend, stop there
+ if ( completed ) {
+ return jqXHR;
+ }
+
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = window.setTimeout( function() {
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ completed = false;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+
+ // Rethrow post-completion exceptions
+ if ( completed ) {
+ throw e;
+ }
+
+ // Propagate others as results
+ done( -1, e );
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Ignore repeat invocations
+ if ( completed ) {
+ return;
+ }
+
+ completed = true;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ window.clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader( "Last-Modified" );
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader( "etag" );
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+
+ // Extract error from statusText and normalize for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+} );
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+
+ // Shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ // The url can be an options object (which then must have .url)
+ return jQuery.ajax( jQuery.extend( {
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ }, jQuery.isPlainObject( url ) && url ) );
+ };
+} );
+
+
+jQuery._evalUrl = function( url ) {
+ return jQuery.ajax( {
+ url: url,
+
+ // Make this explicit, since user can override this through ajaxSetup (#11264)
+ type: "GET",
+ dataType: "script",
+ cache: true,
+ async: false,
+ global: false,
+ "throws": true
+ } );
+};
+
+
+jQuery.fn.extend( {
+ wrapAll: function( html ) {
+ var wrap;
+
+ if ( this[ 0 ] ) {
+ if ( jQuery.isFunction( html ) ) {
+ html = html.call( this[ 0 ] );
+ }
+
+ // The elements to wrap the target around
+ wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
+
+ if ( this[ 0 ].parentNode ) {
+ wrap.insertBefore( this[ 0 ] );
+ }
+
+ wrap.map( function() {
+ var elem = this;
+
+ while ( elem.firstElementChild ) {
+ elem = elem.firstElementChild;
+ }
+
+ return elem;
+ } ).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each( function( i ) {
+ jQuery( this ).wrapInner( html.call( this, i ) );
+ } );
+ }
+
+ return this.each( function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ } );
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each( function( i ) {
+ jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
+ } );
+ },
+
+ unwrap: function( selector ) {
+ this.parent( selector ).not( "body" ).each( function() {
+ jQuery( this ).replaceWith( this.childNodes );
+ } );
+ return this;
+ }
+} );
+
+
+jQuery.expr.pseudos.hidden = function( elem ) {
+ return !jQuery.expr.pseudos.visible( elem );
+};
+jQuery.expr.pseudos.visible = function( elem ) {
+ return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
+};
+
+
+
+
+jQuery.ajaxSettings.xhr = function() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch ( e ) {}
+};
+
+var xhrSuccessStatus = {
+
+ // File protocol always yields status code 0, assume 200
+ 0: 200,
+
+ // Support: IE <=9 only
+ // #1450: sometimes IE returns 1223 when it should be 204
+ 1223: 204
+ },
+ xhrSupported = jQuery.ajaxSettings.xhr();
+
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+support.ajax = xhrSupported = !!xhrSupported;
+
+jQuery.ajaxTransport( function( options ) {
+ var callback, errorCallback;
+
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( support.cors || xhrSupported && !options.crossDomain ) {
+ return {
+ send: function( headers, complete ) {
+ var i,
+ xhr = options.xhr();
+
+ xhr.open(
+ options.type,
+ options.url,
+ options.async,
+ options.username,
+ options.password
+ );
+
+ // Apply custom fields if provided
+ if ( options.xhrFields ) {
+ for ( i in options.xhrFields ) {
+ xhr[ i ] = options.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( options.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( options.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Set headers
+ for ( i in headers ) {
+ xhr.setRequestHeader( i, headers[ i ] );
+ }
+
+ // Callback
+ callback = function( type ) {
+ return function() {
+ if ( callback ) {
+ callback = errorCallback = xhr.onload =
+ xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
+
+ if ( type === "abort" ) {
+ xhr.abort();
+ } else if ( type === "error" ) {
+
+ // Support: IE <=9 only
+ // On a manual native abort, IE9 throws
+ // errors on any property access that is not readyState
+ if ( typeof xhr.status !== "number" ) {
+ complete( 0, "error" );
+ } else {
+ complete(
+
+ // File: protocol always yields status 0; see #8605, #14207
+ xhr.status,
+ xhr.statusText
+ );
+ }
+ } else {
+ complete(
+ xhrSuccessStatus[ xhr.status ] || xhr.status,
+ xhr.statusText,
+
+ // Support: IE <=9 only
+ // IE9 has no XHR2 but throws on binary (trac-11426)
+ // For XHR2 non-text, let the caller handle it (gh-2498)
+ ( xhr.responseType || "text" ) !== "text" ||
+ typeof xhr.responseText !== "string" ?
+ { binary: xhr.response } :
+ { text: xhr.responseText },
+ xhr.getAllResponseHeaders()
+ );
+ }
+ }
+ };
+ };
+
+ // Listen to events
+ xhr.onload = callback();
+ errorCallback = xhr.onerror = callback( "error" );
+
+ // Support: IE 9 only
+ // Use onreadystatechange to replace onabort
+ // to handle uncaught aborts
+ if ( xhr.onabort !== undefined ) {
+ xhr.onabort = errorCallback;
+ } else {
+ xhr.onreadystatechange = function() {
+
+ // Check readyState before timeout as it changes
+ if ( xhr.readyState === 4 ) {
+
+ // Allow onerror to be called first,
+ // but that will not handle a native abort
+ // Also, save errorCallback to a variable
+ // as xhr.onerror cannot be accessed
+ window.setTimeout( function() {
+ if ( callback ) {
+ errorCallback();
+ }
+ } );
+ }
+ };
+ }
+
+ // Create the abort callback
+ callback = callback( "abort" );
+
+ try {
+
+ // Do send the request (this may raise an exception)
+ xhr.send( options.hasContent && options.data || null );
+ } catch ( e ) {
+
+ // #14683: Only rethrow if this hasn't been notified as an error yet
+ if ( callback ) {
+ throw e;
+ }
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback();
+ }
+ }
+ };
+ }
+} );
+
+
+
+
+// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
+jQuery.ajaxPrefilter( function( s ) {
+ if ( s.crossDomain ) {
+ s.contents.script = false;
+ }
+} );
+
+// Install script dataType
+jQuery.ajaxSetup( {
+ accepts: {
+ script: "text/javascript, application/javascript, " +
+ "application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /\b(?:java|ecma)script\b/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+} );
+
+// Handle cache's special case and crossDomain
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ }
+} );
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function( s ) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+ var script, callback;
+ return {
+ send: function( _, complete ) {
+ script = jQuery( "<script>" ).prop( {
+ charset: s.scriptCharset,
+ src: s.url
+ } ).on(
+ "load error",
+ callback = function( evt ) {
+ script.remove();
+ callback = null;
+ if ( evt ) {
+ complete( evt.type === "error" ? 404 : 200, evt.type );
+ }
+ }
+ );
+
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ document.head.appendChild( script[ 0 ] );
+ },
+ abort: function() {
+ if ( callback ) {
+ callback();
+ }
+ }
+ };
+ }
+} );
+
+
+
+
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup( {
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+} );
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" &&
+ ( s.contentType || "" )
+ .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
+ rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters[ "script json" ] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // Force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always( function() {
+
+ // If previous value didn't exist - remove it
+ if ( overwritten === undefined ) {
+ jQuery( window ).removeProp( callbackName );
+
+ // Otherwise restore preexisting value
+ } else {
+ window[ callbackName ] = overwritten;
+ }
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+
+ // Make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // Save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ } );
+
+ // Delegate to script
+ return "script";
+ }
+} );
+
+
+
+
+// Support: Safari 8 only
+// In Safari 8 documents created via document.implementation.createHTMLDocument
+// collapse sibling forms: the second one becomes a child of the first one.
+// Because of that, this security measure has to be disabled in Safari 8.
+// https://bugs.webkit.org/show_bug.cgi?id=137337
+support.createHTMLDocument = ( function() {
+ var body = document.implementation.createHTMLDocument( "" ).body;
+ body.innerHTML = "<form></form><form></form>";
+ return body.childNodes.length === 2;
+} )();
+
+
+// Argument "data" should be string of html
+// context (optional): If specified, the fragment will be created in this context,
+// defaults to document
+// keepScripts (optional): If true, will include scripts passed in the html string
+jQuery.parseHTML = function( data, context, keepScripts ) {
+ if ( typeof data !== "string" ) {
+ return [];
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+
+ var base, parsed, scripts;
+
+ if ( !context ) {
+
+ // Stop scripts or inline event handlers from being executed immediately
+ // by using document.implementation
+ if ( support.createHTMLDocument ) {
+ context = document.implementation.createHTMLDocument( "" );
+
+ // Set the base href for the created document
+ // so any parsed elements with URLs
+ // are based on the document's URL (gh-2965)
+ base = context.createElement( "base" );
+ base.href = document.location.href;
+ context.head.appendChild( base );
+ } else {
+ context = document;
+ }
+ }
+
+ parsed = rsingleTag.exec( data );
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[ 1 ] ) ];
+ }
+
+ parsed = buildFragment( [ data ], context, scripts );
+
+ if ( scripts && scripts.length ) {
+ jQuery( scripts ).remove();
+ }
+
+ return jQuery.merge( [], parsed.childNodes );
+};
+
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+ var selector, type, response,
+ self = this,
+ off = url.indexOf( " " );
+
+ if ( off > -1 ) {
+ selector = stripAndCollapse( url.slice( off ) );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax( {
+ url: url,
+
+ // If "type" variable is undefined, then "GET" method will be used.
+ // Make value of this field explicit since
+ // user can override it through ajaxSetup method
+ type: type || "GET",
+ dataType: "html",
+ data: params
+ } ).done( function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ // If the request succeeds, this function gets "data", "status", "jqXHR"
+ // but they are ignored because response was set above.
+ // If it fails, this function gets "jqXHR", "status", "error"
+ } ).always( callback && function( jqXHR, status ) {
+ self.each( function() {
+ callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
+ } );
+ } );
+ }
+
+ return this;
+};
+
+
+
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [
+ "ajaxStart",
+ "ajaxStop",
+ "ajaxComplete",
+ "ajaxError",
+ "ajaxSuccess",
+ "ajaxSend"
+], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
+ return this.on( type, fn );
+ };
+} );
+
+
+
+
+jQuery.expr.pseudos.animated = function( elem ) {
+ return jQuery.grep( jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ } ).length;
+};
+
+
+
+
+jQuery.offset = {
+ setOffset: function( elem, options, i ) {
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+ position = jQuery.css( elem, "position" ),
+ curElem = jQuery( elem ),
+ props = {};
+
+ // Set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ curOffset = curElem.offset();
+ curCSSTop = jQuery.css( elem, "top" );
+ curCSSLeft = jQuery.css( elem, "left" );
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
+ ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
+
+ // Need to be able to calculate position if either
+ // top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+
+ // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
+ options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+jQuery.fn.extend( {
+ offset: function( options ) {
+
+ // Preserve chaining for setter
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each( function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ } );
+ }
+
+ var doc, docElem, rect, win,
+ elem = this[ 0 ];
+
+ if ( !elem ) {
+ return;
+ }
+
+ // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
+ // Support: IE <=11 only
+ // Running getBoundingClientRect on a
+ // disconnected node in IE throws an error
+ if ( !elem.getClientRects().length ) {
+ return { top: 0, left: 0 };
+ }
+
+ rect = elem.getBoundingClientRect();
+
+ doc = elem.ownerDocument;
+ docElem = doc.documentElement;
+ win = doc.defaultView;
+
+ return {
+ top: rect.top + win.pageYOffset - docElem.clientTop,
+ left: rect.left + win.pageXOffset - docElem.clientLeft
+ };
+ },
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ elem = this[ 0 ],
+ parentOffset = { top: 0, left: 0 };
+
+ // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
+ // because it is its only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+
+ // Assume getBoundingClientRect is there when computed position is fixed
+ offset = elem.getBoundingClientRect();
+
+ } else {
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset = {
+ top: parentOffset.top + jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ),
+ left: parentOffset.left + jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true )
+ };
+ }
+
+ // Subtract parent offsets and element margins
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
+ };
+ },
+
+ // This method will return documentElement in the following cases:
+ // 1) For the element inside the iframe without offsetParent, this method will return
+ // documentElement of the parent window
+ // 2) For the hidden or detached element
+ // 3) For body or html element, i.e. in case of the html node - it will return itself
+ //
+ // but those exceptions were never presented as a real life use-cases
+ // and might be considered as more preferable results.
+ //
+ // This logic, however, is not guaranteed and can change at any point in the future
+ offsetParent: function() {
+ return this.map( function() {
+ var offsetParent = this.offsetParent;
+
+ while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+
+ return offsetParent || documentElement;
+ } );
+ }
+} );
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
+ var top = "pageYOffset" === prop;
+
+ jQuery.fn[ method ] = function( val ) {
+ return access( this, function( elem, method, val ) {
+
+ // Coalesce documents and windows
+ var win;
+ if ( jQuery.isWindow( elem ) ) {
+ win = elem;
+ } else if ( elem.nodeType === 9 ) {
+ win = elem.defaultView;
+ }
+
+ if ( val === undefined ) {
+ return win ? win[ prop ] : elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : win.pageXOffset,
+ top ? val : win.pageYOffset
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length );
+ };
+} );
+
+// Support: Safari <=7 - 9.1, Chrome <=37 - 49
+// Add the top/left cssHooks using jQuery.fn.position
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
+// getComputedStyle returns percent when specified for top/left/bottom/right;
+// rather than make the css module depend on the offset module, just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
+ function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+
+ // If curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ );
+} );
+
+
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
+ function( defaultExtra, funcName ) {
+
+ // Margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+
+ // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
+ return funcName.indexOf( "outer" ) === 0 ?
+ elem[ "inner" + name ] :
+ elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
+ // whichever is greatest
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable );
+ };
+ } );
+} );
+
+
+jQuery.fn.extend( {
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ?
+ this.off( selector, "**" ) :
+ this.off( types, selector || "**", fn );
+ }
+} );
+
+jQuery.holdReady = function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+};
+jQuery.isArray = Array.isArray;
+jQuery.parseJSON = JSON.parse;
+jQuery.nodeName = nodeName;
+
+
+
+
+// Register as a named AMD module, since jQuery can be concatenated with other
+// files that may use define, but not via a proper concatenation script that
+// understands anonymous AMD modules. A named AMD is safest and most robust
+// way to register. Lowercase jquery is used because AMD module names are
+// derived from file names, and jQuery is normally delivered in a lowercase
+// file name. Do this after creating the global so that if an AMD module wants
+// to call noConflict to hide this version of jQuery, it will work.
+
+// Note that for maximum portability, libraries that are not jQuery should
+// declare themselves as anonymous modules, and avoid setting a global if an
+// AMD loader is present. jQuery is a special case. For more information, see
+// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
+
+if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function() {
+ return jQuery;
+ } );
+}
+
+
+
+
+var
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$;
+
+jQuery.noConflict = function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+};
+
+// Expose jQuery and $ identifiers, even in AMD
+// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (#13566)
+if ( !noGlobal ) {
+ window.jQuery = window.$ = jQuery;
+}
+
+
+
+
+return jQuery;
+} );
--- /dev/null
+/*! jQuery v3.2.1 | (c) JS Foundation and other contributors | jquery.org/license */
+!function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){"use strict";var c=[],d=a.document,e=Object.getPrototypeOf,f=c.slice,g=c.concat,h=c.push,i=c.indexOf,j={},k=j.toString,l=j.hasOwnProperty,m=l.toString,n=m.call(Object),o={};function p(a,b){b=b||d;var c=b.createElement("script");c.text=a,b.head.appendChild(c).parentNode.removeChild(c)}var q="3.2.1",r=function(a,b){return new r.fn.init(a,b)},s=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,t=/^-ms-/,u=/-([a-z])/g,v=function(a,b){return b.toUpperCase()};r.fn=r.prototype={jquery:q,constructor:r,length:0,toArray:function(){return f.call(this)},get:function(a){return null==a?f.call(this):a<0?this[a+this.length]:this[a]},pushStack:function(a){var b=r.merge(this.constructor(),a);return b.prevObject=this,b},each:function(a){return r.each(this,a)},map:function(a){return this.pushStack(r.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(f.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(a<0?b:0);return this.pushStack(c>=0&&c<b?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:h,sort:c.sort,splice:c.splice},r.extend=r.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||r.isFunction(g)||(g={}),h===i&&(g=this,h--);h<i;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(r.isPlainObject(d)||(e=Array.isArray(d)))?(e?(e=!1,f=c&&Array.isArray(c)?c:[]):f=c&&r.isPlainObject(c)?c:{},g[b]=r.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},r.extend({expando:"jQuery"+(q+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===r.type(a)},isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){var b=r.type(a);return("number"===b||"string"===b)&&!isNaN(a-parseFloat(a))},isPlainObject:function(a){var b,c;return!(!a||"[object Object]"!==k.call(a))&&(!(b=e(a))||(c=l.call(b,"constructor")&&b.constructor,"function"==typeof c&&m.call(c)===n))},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?j[k.call(a)]||"object":typeof a},globalEval:function(a){p(a)},camelCase:function(a){return a.replace(t,"ms-").replace(u,v)},each:function(a,b){var c,d=0;if(w(a)){for(c=a.length;d<c;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(s,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(w(Object(a))?r.merge(c,"string"==typeof a?[a]:a):h.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:i.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;d<c;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;f<g;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,f=0,h=[];if(w(a))for(d=a.length;f<d;f++)e=b(a[f],f,c),null!=e&&h.push(e);else for(f in a)e=b(a[f],f,c),null!=e&&h.push(e);return g.apply([],h)},guid:1,proxy:function(a,b){var c,d,e;if("string"==typeof b&&(c=a[b],b=a,a=c),r.isFunction(a))return d=f.call(arguments,2),e=function(){return a.apply(b||this,d.concat(f.call(arguments)))},e.guid=a.guid=a.guid||r.guid++,e},now:Date.now,support:o}),"function"==typeof Symbol&&(r.fn[Symbol.iterator]=c[Symbol.iterator]),r.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){j["[object "+b+"]"]=b.toLowerCase()});function w(a){var b=!!a&&"length"in a&&a.length,c=r.type(a);return"function"!==c&&!r.isWindow(a)&&("array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",M="\\["+K+"*("+L+")(?:"+K+"*([*^$|!~]?=)"+K+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+L+"))|)"+K+"*\\]",N=":("+L+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+M+")*)|.*)\\)|)",O=new RegExp(K+"+","g"),P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c<b;c+=2)a.push(c);return a}),odd:pa(function(a,b){for(var c=1;c<b;c+=2)a.push(c);return a}),lt:pa(function(a,b,c){for(var d=c<0?c+b:c;--d>=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function ra(){}ra.prototype=d.filters=d.pseudos,d.setFilters=new ra,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){c&&!(e=Q.exec(h))||(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function sa(a){for(var b=0,c=a.length,d="";b<c;b++)d+=a[b].value;return d}function ta(a,b,c){var d=b.dir,e=b.next,f=e||d,g=c&&"parentNode"===f,h=x++;return b.first?function(b,c,e){while(b=b[d])if(1===b.nodeType||g)return a(b,c,e);return!1}:function(b,c,i){var j,k,l,m=[w,h];if(i){while(b=b[d])if((1===b.nodeType||g)&&a(b,c,i))return!0}else while(b=b[d])if(1===b.nodeType||g)if(l=b[u]||(b[u]={}),k=l[b.uniqueID]||(l[b.uniqueID]={}),e&&e===b.nodeName.toLowerCase())b=b[d]||b;else{if((j=k[f])&&j[0]===w&&j[1]===h)return m[2]=j[2];if(k[f]=m,m[2]=a(b,c,i))return!0}return!1}}function ua(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d<e;d++)ga(a,b[d],c);return c}function wa(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;h<i;h++)(f=a[h])&&(c&&!c(f,d,e)||(g.push(f),j&&b.push(h)));return g}function xa(a,b,c,d,e,f){return d&&!d[u]&&(d=xa(d)),e&&!e[u]&&(e=xa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||va(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:wa(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=wa(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i<f;i++)if(c=d.relative[a[i].type])m=[ta(ua(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;e<f;e++)if(d.relative[a[e].type])break;return xa(i>1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i<e&&ya(a.slice(i,e)),e<f&&ya(a=a.slice(e)),e<f&&sa(a))}m.push(c)}return ua(m)}function za(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b<d;b++)if(r.contains(e[b],this))return!0}));for(c=this.pushStack([]),b=0;b<d;b++)r.find(a,e[b],c);return d>1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a<c;a++)if(r.contains(this,b[a]))return!0})},closest:function(a,b){var c,d=0,e=this.length,f=[],g="string"!=typeof a&&r(a);if(!A.test(a))for(;d<e;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){r.each(b,function(b,c){r.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==r.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return r.each(arguments,function(a,b){var c;while((c=r.inArray(b,f,c))>-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b<f)){if(a=d.apply(h,i),a===c.promise())throw new TypeError("Thenable self-resolution");j=a&&("object"==typeof a||"function"==typeof a)&&a.then,r.isFunction(j)?e?j.call(a,g(f,c,N,e),g(f,c,O,e)):(f++,j.call(a,g(f,c,N,e),g(f,c,O,e),g(f,c,N,c.notifyWith))):(d!==N&&(h=void 0,i=[a]),(e||c.resolveWith)(h,i))}},k=e?j:function(){try{j()}catch(a){r.Deferred.exceptionHook&&r.Deferred.exceptionHook(a,k.stackTrace),b+1>=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S),
+a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h<i;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},U=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function V(){this.expando=r.expando+V.uid++}V.uid=1,V.prototype={cache:function(a){var b=a[this.expando];return b||(b={},U(a)&&(a.nodeType?a[this.expando]=b:Object.defineProperty(a,this.expando,{value:b,configurable:!0}))),b},set:function(a,b,c){var d,e=this.cache(a);if("string"==typeof b)e[r.camelCase(b)]=c;else for(d in b)e[r.camelCase(d)]=b[d];return e},get:function(a,b){return void 0===b?this.cache(a):a[this.expando]&&a[this.expando][r.camelCase(b)]},access:function(a,b,c){return void 0===b||b&&"string"==typeof b&&void 0===c?this.get(a,b):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d=a[this.expando];if(void 0!==d){if(void 0!==b){Array.isArray(b)?b=b.map(r.camelCase):(b=r.camelCase(b),b=b in d?[b]:b.match(L)||[]),c=b.length;while(c--)delete d[b[c]]}(void 0===b||r.isEmptyObject(d))&&(a.nodeType?a[this.expando]=void 0:delete a[this.expando])}},hasData:function(a){var b=a[this.expando];return void 0!==b&&!r.isEmptyObject(b)}};var W=new V,X=new V,Y=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function $(a){return"true"===a||"false"!==a&&("null"===a?null:a===+a+""?+a:Y.test(a)?JSON.parse(a):a)}function _(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(Z,"-$&").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c=$(c)}catch(e){}X.set(a,b,c)}else c=void 0;return c}r.extend({hasData:function(a){return X.hasData(a)||W.hasData(a)},data:function(a,b,c){return X.access(a,b,c)},removeData:function(a,b){X.remove(a,b)},_data:function(a,b,c){return W.access(a,b,c)},_removeData:function(a,b){W.remove(a,b)}}),r.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=X.get(f),1===f.nodeType&&!W.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=r.camelCase(d.slice(5)),_(f,d,e[d])));W.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){X.set(this,a)}):T(this,function(b){var c;if(f&&void 0===b){if(c=X.get(f,a),void 0!==c)return c;if(c=_(f,a),void 0!==c)return c}else this.each(function(){X.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?r.queue(this[0],a):void 0===b?this:this.each(function(){var c=r.queue(this,a,b);r._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=r.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=W.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var aa=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ba=new RegExp("^(?:([+-])=|)("+aa+")([a-z%]*)$","i"),ca=["Top","Right","Bottom","Left"],da=function(a,b){return a=b||a,"none"===a.style.display||""===a.style.display&&r.contains(a.ownerDocument,a)&&"none"===r.css(a,"display")},ea=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};function fa(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return r.css(a,b,"")},i=h(),j=c&&c[3]||(r.cssNumber[b]?"":"px"),k=(r.cssNumber[b]||"px"!==j&&+i)&&ba.exec(r.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,r.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var ga={};function ha(a){var b,c=a.ownerDocument,d=a.nodeName,e=ga[d];return e?e:(b=c.body.appendChild(c.createElement(d)),e=r.css(b,"display"),b.parentNode.removeChild(b),"none"===e&&(e="block"),ga[d]=e,e)}function ia(a,b){for(var c,d,e=[],f=0,g=a.length;f<g;f++)d=a[f],d.style&&(c=d.style.display,b?("none"===c&&(e[f]=W.get(d,"display")||null,e[f]||(d.style.display="")),""===d.style.display&&da(d)&&(e[f]=ha(d))):"none"!==c&&(e[f]="none",W.set(d,"display",c)));for(f=0;f<g;f++)null!=e[f]&&(a[f].style.display=e[f]);return a}r.fn.extend({show:function(){return ia(this,!0)},hide:function(){return ia(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){da(this)?r(this).show():r(this).hide()})}});var ja=/^(?:checkbox|radio)$/i,ka=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c<d;c++)W.set(a[c],"globalEval",!b||W.get(b[c],"globalEval"))}var pa=/<|&#?\w+;/;function qa(a,b,c,d,e){for(var f,g,h,i,j,k,l=b.createDocumentFragment(),m=[],n=0,o=a.length;n<o;n++)if(f=a[n],f||0===f)if("object"===r.type(f))r.merge(m,f.nodeType?[f]:f);else if(pa.test(f)){g=g||l.appendChild(b.createElement("div")),h=(ka.exec(f)||["",""])[1].toLowerCase(),i=ma[h]||ma._default,g.innerHTML=i[1]+r.htmlPrefilter(f)+i[2],k=i[0];while(k--)g=g.lastChild;r.merge(m,g.childNodes),g=l.firstChild,g.textContent=""}else m.push(b.createTextNode(f));l.textContent="",n=0;while(f=m[n++])if(d&&r.inArray(f,d)>-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c<arguments.length;c++)i[c]=arguments[c];if(b.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,b)!==!1){h=r.event.handlers.call(this,b,j),c=0;while((f=h[c++])&&!b.isPropagationStopped()){b.currentTarget=f.elem,d=0;while((g=f.handlers[d++])&&!b.isImmediatePropagationStopped())b.rnamespace&&!b.rnamespace.test(g.namespace)||(b.handleObj=g,b.data=g.data,e=((r.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(b.result=e)===!1&&(b.preventDefault(),b.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,b),b.result}},handlers:function(a,b){var c,d,e,f,g,h=[],i=b.delegateCount,j=a.target;if(i&&j.nodeType&&!("click"===a.type&&a.button>=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c<i;c++)d=b[c],e=d.selector+" ",void 0===g[e]&&(g[e]=d.needsContext?r(e,this).index(j)>-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i<b.length&&h.push({elem:j,handlers:b.slice(i)}),h},addProp:function(a,b){Object.defineProperty(r.Event.prototype,a,{enumerable:!0,configurable:!0,get:r.isFunction(b)?function(){if(this.originalEvent)return b(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[a]},set:function(b){Object.defineProperty(this,a,{enumerable:!0,configurable:!0,writable:!0,value:b})}})},fix:function(a){return a[r.expando]?a:new r.Event(a)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==xa()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===xa()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&B(this,"input"))return this.click(),!1},_default:function(a){return B(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}}},r.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)},r.Event=function(a,b){return this instanceof r.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?va:wa,this.target=a.target&&3===a.target.nodeType?a.target.parentNode:a.target,this.currentTarget=a.currentTarget,this.relatedTarget=a.relatedTarget):this.type=a,b&&r.extend(this,b),this.timeStamp=a&&a.timeStamp||r.now(),void(this[r.expando]=!0)):new r.Event(a,b)},r.Event.prototype={constructor:r.Event,isDefaultPrevented:wa,isPropagationStopped:wa,isImmediatePropagationStopped:wa,isSimulated:!1,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=va,a&&!this.isSimulated&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=va,a&&!this.isSimulated&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=va,a&&!this.isSimulated&&a.stopImmediatePropagation(),this.stopPropagation()}},r.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(a){var b=a.button;return null==a.which&&sa.test(a.type)?null!=a.charCode?a.charCode:a.keyCode:!a.which&&void 0!==b&&ta.test(a.type)?1&b?1:2&b?3:4&b?2:0:a.which}},r.event.addProp),r.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return e&&(e===d||r.contains(d,e))||(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),r.fn.extend({on:function(a,b,c,d){return ya(this,a,b,c,d)},one:function(a,b,c,d){return ya(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,r(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return b!==!1&&"function"!=typeof b||(c=b,b=void 0),c===!1&&(c=wa),this.each(function(){r.event.remove(this,a,c,b)})}});var za=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/<script|<style|<link/i,Ba=/checked\s*(?:[^=]|=\s*.checked.)/i,Ca=/^true\/(.*)/,Da=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c<d;c++)r.event.add(b,e,j[e][c])}X.hasData(a)&&(h=X.access(a),i=r.extend({},h),X.set(b,i))}}function Ia(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ja.test(a.type)?b.checked=a.checked:"input"!==c&&"textarea"!==c||(b.defaultValue=a.defaultValue)}function Ja(a,b,c,d){b=g.apply([],b);var e,f,h,i,j,k,l=0,m=a.length,n=m-1,q=b[0],s=r.isFunction(q);if(s||m>1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l<m;l++)j=e,l!==n&&(j=r.clone(j,!0,!0),i&&r.merge(h,na(j,"script"))),c.call(a[l],j,l);if(i)for(k=h[h.length-1].ownerDocument,r.map(h,Ga),l=0;l<i;l++)j=h[l],la.test(j.type||"")&&!W.access(j,"globalEval")&&r.contains(k,j)&&(j.src?r._evalUrl&&r._evalUrl(j.src):p(j.textContent.replace(Da,""),k))}return a}function Ka(a,b,c){for(var d,e=b?r.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||r.cleanData(na(d)),d.parentNode&&(c&&r.contains(d.ownerDocument,d)&&oa(na(d,"script")),d.parentNode.removeChild(d));return a}r.extend({htmlPrefilter:function(a){return a.replace(za,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d<e;d++)Ia(f[d],g[d]);if(b)if(c)for(f=f||na(a),g=g||na(h),d=0,e=f.length;d<e;d++)Ha(f[d],g[d]);else Ha(a,h);return g=na(h,"script"),g.length>0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c<d;c++)b=this[c]||{},1===b.nodeType&&(r.cleanData(na(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ja(this,arguments,function(b){var c=this.parentNode;r.inArray(this,a)<0&&(r.cleanData(na(this)),c&&c.replaceChild(b,this))},a)}}),r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(a){for(var c,d=[],e=r(a),f=e.length-1,g=0;g<=f;g++)c=g===f?this:this.clone(!0),r(e[g])[b](c),h.apply(d,c.get());return this.pushStack(d)}});var La=/^margin/,Ma=new RegExp("^("+aa+")(?!px)[a-z%]+$","i"),Na=function(b){var c=b.ownerDocument.defaultView;return c&&c.opener||(c=a),c.getComputedStyle(b)};!function(){function b(){if(i){i.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i.innerHTML="",ra.appendChild(h);var b=a.getComputedStyle(i);c="1%"!==b.top,g="2px"===b.marginLeft,e="4px"===b.width,i.style.marginRight="50%",f="4px"===b.marginRight,ra.removeChild(h),i=null}}var c,e,f,g,h=d.createElement("div"),i=d.createElement("div");i.style&&(i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",o.clearCloneStyle="content-box"===i.style.backgroundClip,h.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",h.appendChild(i),r.extend(o,{pixelPosition:function(){return b(),c},boxSizingReliable:function(){return b(),e},pixelMarginRight:function(){return b(),f},reliableMarginLeft:function(){return b(),g}}))}();function Oa(a,b,c){var d,e,f,g,h=a.style;return c=c||Na(a),c&&(g=c.getPropertyValue(b)||c[b],""!==g||r.contains(a.ownerDocument,a)||(g=r.style(a,b)),!o.pixelMarginRight()&&Ma.test(g)&&La.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function Pa(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Qa=/^(none|table(?!-c[ea]).+)/,Ra=/^--/,Sa={position:"absolute",visibility:"hidden",display:"block"},Ta={letterSpacing:"0",fontWeight:"400"},Ua=["Webkit","Moz","ms"],Va=d.createElement("div").style;function Wa(a){if(a in Va)return a;var b=a[0].toUpperCase()+a.slice(1),c=Ua.length;while(c--)if(a=Ua[c]+b,a in Va)return a}function Xa(a){var b=r.cssProps[a];return b||(b=r.cssProps[a]=Wa(a)||a),b}function Ya(a,b,c){var d=ba.exec(b);return d?Math.max(0,d[2]-(c||0))+(d[3]||"px"):b}function Za(a,b,c,d,e){var f,g=0;for(f=c===(d?"border":"content")?4:"width"===b?1:0;f<4;f+=2)"margin"===c&&(g+=r.css(a,c+ca[f],!0,e)),d?("content"===c&&(g-=r.css(a,"padding"+ca[f],!0,e)),"margin"!==c&&(g-=r.css(a,"border"+ca[f]+"Width",!0,e))):(g+=r.css(a,"padding"+ca[f],!0,e),"padding"!==c&&(g+=r.css(a,"border"+ca[f]+"Width",!0,e)));return g}function $a(a,b,c){var d,e=Na(a),f=Oa(a,b,e),g="border-box"===r.css(a,"boxSizing",!1,e);return Ma.test(f)?f:(d=g&&(o.boxSizingReliable()||f===a.style[b]),"auto"===f&&(f=a["offset"+b[0].toUpperCase()+b.slice(1)]),f=parseFloat(f)||0,f+Za(a,b,c||(g?"border":"content"),d,e)+"px")}r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Oa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=r.camelCase(b),i=Ra.test(b),j=a.style;return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:j[b]:(f=typeof c,"string"===f&&(e=ba.exec(c))&&e[1]&&(c=fa(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(r.cssNumber[h]?"":"px")),o.clearCloneStyle||""!==c||0!==b.indexOf("background")||(j[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i?j.setProperty(b,c):j[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=r.camelCase(b),i=Ra.test(b);return i||(b=Xa(h)),g=r.cssHooks[b]||r.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=Oa(a,b,d)),"normal"===e&&b in Ta&&(e=Ta[b]),""===c||c?(f=parseFloat(e),c===!0||isFinite(f)?f||0:e):e}}),r.each(["height","width"],function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return!Qa.test(r.css(a,"display"))||a.getClientRects().length&&a.getBoundingClientRect().width?$a(a,b,d):ea(a,Sa,function(){return $a(a,b,d)})},set:function(a,c,d){var e,f=d&&Na(a),g=d&&Za(a,b,d,"border-box"===r.css(a,"boxSizing",!1,f),f);return g&&(e=ba.exec(c))&&"px"!==(e[3]||"px")&&(a.style[b]=c,c=r.css(a,b)),Ya(a,c,g)}}}),r.cssHooks.marginLeft=Pa(o.reliableMarginLeft,function(a,b){if(b)return(parseFloat(Oa(a,"marginLeft"))||a.getBoundingClientRect().left-ea(a,{marginLeft:0},function(){return a.getBoundingClientRect().left}))+"px"}),r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];d<4;d++)e[a+ca[d]+b]=f[d]||f[d-2]||f[0];return e}},La.test(a)||(r.cssHooks[a+b].set=Ya)}),r.fn.extend({css:function(a,b){return T(this,function(a,b,c){var d,e,f={},g=0;if(Array.isArray(b)){for(d=Na(a),e=b.length;g<e;g++)f[b[g]]=r.css(a,b[g],!1,d);return f}return void 0!==c?r.style(a,b,c):r.css(a,b)},a,b,arguments.length>1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f<g;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,k,l="width"in b||"height"in b,m=this,n={},o=a.style,p=a.nodeType&&da(a),q=W.get(a,"fxshow");c.queue||(g=r._queueHooks(a,"fx"),null==g.unqueued&&(g.unqueued=0,h=g.empty.fire,g.empty.fire=function(){g.unqueued||h()}),g.unqueued++,m.always(function(){m.always(function(){g.unqueued--,r.queue(a,"fx").length||g.empty.fire()})}));for(d in b)if(e=b[d],cb.test(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}n[d]=q&&q[d]||r.style(a,d)}if(i=!r.isEmptyObject(b),i||!r.isEmptyObject(n)){l&&1===a.nodeType&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=q&&q.display,null==j&&(j=W.get(a,"display")),k=r.css(a,"display"),"none"===k&&(j?k=j:(ia([a],!0),j=a.style.display||j,k=r.css(a,"display"),ia([a]))),("inline"===k||"inline-block"===k&&null!=j)&&"none"===r.css(a,"float")&&(i||(m.done(function(){o.display=j}),null==j&&(k=o.display,j="none"===k?"":k)),o.display="inline-block")),c.overflow&&(o.overflow="hidden",m.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]})),i=!1;for(d in n)i||(q?"hidden"in q&&(p=q.hidden):q=W.access(a,"fxshow",{display:j}),f&&(q.hidden=!p),p&&ia([a],!0),m.done(function(){p||ia([a]),W.remove(a,"fxshow");for(d in n)r.style(a,d,n[d])})),i=hb(p?q[d]:0,d,m),d in q||(q[d]=i.start,p&&(i.end=i.start,i.start=0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=r.camelCase(c),e=b[d],f=a[c],Array.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=r.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=kb.prefilters.length,h=r.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=ab||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;g<i;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),f<1&&i?c:(i||h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:r.extend({},b),opts:r.extend(!0,{specialEasing:{},easing:r.easing._default},c),originalProperties:b,originalOptions:c,startTime:ab||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=r.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;c<d;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);f<g;f++)if(d=kb.prefilters[f].call(j,a,k,j.opts))return r.isFunction(d.stop)&&(r._queueHooks(j.elem,j.opts.queue).stop=r.proxy(d.stop,d)),d;return r.map(k,hb,j),r.isFunction(j.opts.start)&&j.opts.start.call(a,j),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always),r.fx.timer(r.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j}r.Animation=r.extend(kb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return fa(c.elem,a,ba.exec(b),c),c}]},tweener:function(a,b){r.isFunction(a)?(b=a,a=["*"]):a=a.match(L);for(var c,d=0,e=a.length;d<e;d++)c=a[d],kb.tweeners[c]=kb.tweeners[c]||[],kb.tweeners[c].unshift(b)},prefilters:[ib],prefilter:function(a,b){b?kb.prefilters.unshift(a):kb.prefilters.push(a)}}),r.speed=function(a,b,c){var d=a&&"object"==typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};return r.fx.off?d.duration=0:"number"!=typeof d.duration&&(d.duration in r.fx.speeds?d.duration=r.fx.speeds[d.duration]:d.duration=r.fx.speeds._default),null!=d.queue&&d.queue!==!0||(d.queue="fx"),d.old=d.complete,d.complete=function(){r.isFunction(d.old)&&d.old.call(this),d.queue&&r.dequeue(this,d.queue)},d},r.fn.extend({fadeTo:function(a,b,c,d){return this.filter(da).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=r.isEmptyObject(a),f=r.speed(b,c,d),g=function(){var b=kb(this,r.extend({},a),f);(e||W.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=r.timers,g=W.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&db.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));!b&&c||r.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=W.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=r.timers,g=d?d.length:0;for(c.finish=!0,r.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;b<g;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),r.each(["toggle","show","hide"],function(a,b){var c=r.fn[b];r.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),r.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),r.timers=[],r.fx.tick=function(){var a,b=0,c=r.timers;for(ab=r.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||r.fx.stop(),ab=void 0},r.fx.timer=function(a){r.timers.push(a),r.fx.start()},r.fx.interval=13,r.fx.start=function(){bb||(bb=!0,eb())},r.fx.stop=function(){bb=null},r.fx.speeds={slow:600,fast:200,_default:400},r.fn.delay=function(b,c){return b=r.fx?r.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a=d.createElement("input"),b=d.createElement("select"),c=b.appendChild(d.createElement("option"));a.type="checkbox",o.checkOn=""!==a.value,o.optSelected=c.selected,a=d.createElement("input"),a.value="t",a.type="radio",o.radioValue="t"===a.value}();var lb,mb=r.expr.attrHandle;r.fn.extend({attr:function(a,b){return T(this,r.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b),
+null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d<i;d++)if(c=e[d],(c.selected||d===f)&&!c.disabled&&(!c.parentNode.disabled||!B(c.parentNode,"optgroup"))){if(b=r(c).val(),g)return b;h.push(b)}return h},set:function(a,b){var c,d,e=a.options,f=r.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=r.inArray(r.valHooks.option.get(d),f)>-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r("<script>").prop({charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&f("error"===a.type?404:200,a.type)}),d.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Tb=[],Ub=/(=)\?(?=&|$)|\?\?/;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Tb.pop()||r.expando+"_"+ub++;return this[a]=!0,a}}),r.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Ub.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ub.test(b.data)&&"data");if(h||"jsonp"===b.dataTypes[0])return e=b.jsonpCallback=r.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Ub,"$1"+e):b.jsonp!==!1&&(b.url+=(vb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||r.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?r(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Tb.push(e)),g&&r.isFunction(f)&&f(g[0]),g=f=void 0}),"script"}),o.createHTMLDocument=function(){var a=d.implementation.createHTMLDocument("").body;return a.innerHTML="<form></form><form></form>",2===a.childNodes.length}(),r.parseHTML=function(a,b,c){if("string"!=typeof a)return[];"boolean"==typeof b&&(c=b,b=!1);var e,f,g;return b||(o.createHTMLDocument?(b=d.implementation.createHTMLDocument(""),e=b.createElement("base"),e.href=d.location.href,b.head.appendChild(e)):b=d),f=C.exec(a),g=!c&&[],f?[b.createElement(f[1])]:(f=qa([a],b,g),g&&g.length&&r(g).remove(),r.merge([],f.childNodes))},r.fn.load=function(a,b,c){var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=pb(a.slice(h)),a=a.slice(0,h)),r.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&r.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?r("<div>").append(r.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(this,f||[a.responseText,b,a])})}),this},r.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){r.fn[b]=function(a){return this.on(b,a)}}),r.expr.pseudos.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length},r.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=r.css(a,"position"),l=r(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=r.css(a,"top"),i=r.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),r.isFunction(b)&&(b=b.call(a,c,r.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},r.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){r.offset.setOffset(this,a,b)});var b,c,d,e,f=this[0];if(f)return f.getClientRects().length?(d=f.getBoundingClientRect(),b=f.ownerDocument,c=b.documentElement,e=b.defaultView,{top:d.top+e.pageYOffset-c.clientTop,left:d.left+e.pageXOffset-c.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===r.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),B(a[0],"html")||(d=a.offset()),d={top:d.top+r.css(a[0],"borderTopWidth",!0),left:d.left+r.css(a[0],"borderLeftWidth",!0)}),{top:b.top-d.top-r.css(c,"marginTop",!0),left:b.left-d.left-r.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===r.css(a,"position"))a=a.offsetParent;return a||ra})}}),r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c="pageYOffset"===b;r.fn[a]=function(d){return T(this,function(a,d,e){var f;return r.isWindow(a)?f=a:9===a.nodeType&&(f=a.defaultView),void 0===e?f?f[b]:a[d]:void(f?f.scrollTo(c?f.pageXOffset:e,c?e:f.pageYOffset):a[d]=e)},a,d,arguments.length)}}),r.each(["top","left"],function(a,b){r.cssHooks[b]=Pa(o.pixelPosition,function(a,c){if(c)return c=Oa(a,b),Ma.test(c)?r(a).position()[b]+"px":c})}),r.each({Height:"height",Width:"width"},function(a,b){r.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){r.fn[d]=function(e,f){var g=arguments.length&&(c||"boolean"!=typeof e),h=c||(e===!0||f===!0?"margin":"border");return T(this,function(b,c,e){var f;return r.isWindow(b)?0===d.indexOf("outer")?b["inner"+a]:b.document.documentElement["client"+a]:9===b.nodeType?(f=b.documentElement,Math.max(b.body["scroll"+a],f["scroll"+a],b.body["offset"+a],f["offset"+a],f["client"+a])):void 0===e?r.css(b,c,h):r.style(b,c,e,h)},b,g?e:void 0,g)}})}),r.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),r.holdReady=function(a){a?r.readyWait++:r.ready(!0)},r.isArray=Array.isArray,r.parseJSON=JSON.parse,r.nodeName=B,"function"==typeof define&&define.amd&&define("jquery",[],function(){return r});var Vb=a.jQuery,Wb=a.$;return r.noConflict=function(b){return a.$===r&&(a.$=Wb),b&&a.jQuery===r&&(a.jQuery=Vb),r},b||(a.jQuery=a.$=r),r});
--- /dev/null
+
+.highlighttable td.code { width: 100%; }
+
+.linenos {
+ color: darkgray;
+ font-size: 85%; /* must be in sync with .highlight */
+}
+
+.highlight {
+ border: 1px solid darkgray;
+ border-left: 4px solid darkgray;
+ padding: 0 1em 0 1em;
+ background-color: aliceblue;
+ display: block;
+ overflow: auto;
+ font-size: 85%; /* must be in sync with .linenos */
+ color: darkslategray;
+}
+
+.highlight .c { color: darkolivegreen; } /* Comment */
+.highlight .cm { color: darkolivegreen; } /* Comment.Multiline */
+.highlight .c1 { color: darkolivegreen; } /* Comment.Single */
+.highlight .cp { color: darkolivegreen; } /* Comment.Preproc */
+
+.highlight .k { color: steelblue; font-weight: bold; } /* Keyword */
+.highlight .kt { color: midnightblue; } /* Keyword.Type */
+
+.highlight .m { color: darkslateblue; } /* Literal.Number */
+.highlight .mf { color: darkslateblue; } /* Literal.Number.Float */
+.highlight .mh { color: darkslateblue; } /* Literal.Number.Hex */
+.highlight .mi { color: darkslateblue; } /* Literal.Number.Integer */
+.highlight .mo { color: darkslateblue; } /* Literal.Number.Oct */
+.highlight .il { color: darkslateblue; } /* Literal.Number.Integer.Long */
+
+.highlight .s { color: rosybrown; } /* Literal.String */
+.highlight .sb { color: rosybrown; } /* Literal.String.Backtick */
+.highlight .sc { color: rosybrown; } /* Literal.String.Char */
+.highlight .sd { color: rosybrown; } /* Literal.String.Doc */
+.highlight .s2 { color: rosybrown; } /* Literal.String.Double */
+.highlight .se { color: rosybrown; } /* Literal.String.Escape */
+.highlight .sh { color: rosybrown; } /* Literal.String.Heredoc */
+.highlight .si { color: rosybrown; } /* Literal.String.Interpol */
+.highlight .sx { color: rosybrown; } /* Literal.String.Other */
+.highlight .sr { color: rosybrown; } /* Literal.String.Regex */
+.highlight .s1 { color: rosybrown; } /* Literal.String.Single */
+.highlight .ss { color: rosybrown; } /* Literal.String.Symbol */
+
+/*.highlight .o { } /* Operator */
+/*.highlight .ow { } /* Operator.Word */
+
+/*.highlight .ge { } /* Generic.Emph */
+
+/*.highlight .gd { } /* Generic.Deleted */
+/*.highlight .gi { } /* Generic.Inserted */
+
+/*.highlight .na { } /* Name.Attribute */
+/*.highlight .nb { } /* Name.Builtin */
+/*.highlight .nc { } /* Name.Class */
+/*.highlight .no { } /* Name.Constant */
+/*.highlight .nd { } /* Name.Decorator */
+/*.highlight .ni { } /* Name.Entity */
+/*.highlight .ne { } /* Name.Exception */
+/*.highlight .nf { } /* Name.Function */
+/*.highlight .nl { } /* Name.Label */
+/*.highlight .nn { } /* Name.Namespace */
+/*.highlight .nt { } /* Name.Tag */
+/*.highlight .nv { } /* Name.Variable */
+/*.highlight .bp { } /* Name.Builtin.Pseudo */
+/*.highlight .vc { } /* Name.Variable.Class */
+/*.highlight .vg { } /* Name.Variable.Global */
+/*.highlight .vi { } /* Name.Variable.Instance */
+
--- /dev/null
+/*
+ * searchtools.js_t
+ * ~~~~~~~~~~~~~~~~
+ *
+ * Sphinx JavaScript utilities for the full-text search.
+ *
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+
+/* Non-minified version JS is _stemmer.js if file is provided */
+/**
+ * Porter Stemmer
+ */
+var Stemmer = function() {
+
+ var step2list = {
+ ational: 'ate',
+ tional: 'tion',
+ enci: 'ence',
+ anci: 'ance',
+ izer: 'ize',
+ bli: 'ble',
+ alli: 'al',
+ entli: 'ent',
+ eli: 'e',
+ ousli: 'ous',
+ ization: 'ize',
+ ation: 'ate',
+ ator: 'ate',
+ alism: 'al',
+ iveness: 'ive',
+ fulness: 'ful',
+ ousness: 'ous',
+ aliti: 'al',
+ iviti: 'ive',
+ biliti: 'ble',
+ logi: 'log'
+ };
+
+ var step3list = {
+ icate: 'ic',
+ ative: '',
+ alize: 'al',
+ iciti: 'ic',
+ ical: 'ic',
+ ful: '',
+ ness: ''
+ };
+
+ var c = "[^aeiou]"; // consonant
+ var v = "[aeiouy]"; // vowel
+ var C = c + "[^aeiouy]*"; // consonant sequence
+ var V = v + "[aeiou]*"; // vowel sequence
+
+ var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
+ var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
+ var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
+ var s_v = "^(" + C + ")?" + v; // vowel in stem
+
+ this.stemWord = function (w) {
+ var stem;
+ var suffix;
+ var firstch;
+ var origword = w;
+
+ if (w.length < 3)
+ return w;
+
+ var re;
+ var re2;
+ var re3;
+ var re4;
+
+ firstch = w.substr(0,1);
+ if (firstch == "y")
+ w = firstch.toUpperCase() + w.substr(1);
+
+ // Step 1a
+ re = /^(.+?)(ss|i)es$/;
+ re2 = /^(.+?)([^s])s$/;
+
+ if (re.test(w))
+ w = w.replace(re,"$1$2");
+ else if (re2.test(w))
+ w = w.replace(re2,"$1$2");
+
+ // Step 1b
+ re = /^(.+?)eed$/;
+ re2 = /^(.+?)(ed|ing)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ re = new RegExp(mgr0);
+ if (re.test(fp[1])) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+ }
+ else if (re2.test(w)) {
+ var fp = re2.exec(w);
+ stem = fp[1];
+ re2 = new RegExp(s_v);
+ if (re2.test(stem)) {
+ w = stem;
+ re2 = /(at|bl|iz)$/;
+ re3 = new RegExp("([^aeiouylsz])\\1$");
+ re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+ if (re2.test(w))
+ w = w + "e";
+ else if (re3.test(w)) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+ else if (re4.test(w))
+ w = w + "e";
+ }
+ }
+
+ // Step 1c
+ re = /^(.+?)y$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(s_v);
+ if (re.test(stem))
+ w = stem + "i";
+ }
+
+ // Step 2
+ re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ suffix = fp[2];
+ re = new RegExp(mgr0);
+ if (re.test(stem))
+ w = stem + step2list[suffix];
+ }
+
+ // Step 3
+ re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ suffix = fp[2];
+ re = new RegExp(mgr0);
+ if (re.test(stem))
+ w = stem + step3list[suffix];
+ }
+
+ // Step 4
+ re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
+ re2 = /^(.+?)(s|t)(ion)$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(mgr1);
+ if (re.test(stem))
+ w = stem;
+ }
+ else if (re2.test(w)) {
+ var fp = re2.exec(w);
+ stem = fp[1] + fp[2];
+ re2 = new RegExp(mgr1);
+ if (re2.test(stem))
+ w = stem;
+ }
+
+ // Step 5
+ re = /^(.+?)e$/;
+ if (re.test(w)) {
+ var fp = re.exec(w);
+ stem = fp[1];
+ re = new RegExp(mgr1);
+ re2 = new RegExp(meq1);
+ re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
+ if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
+ w = stem;
+ }
+ re = /ll$/;
+ re2 = new RegExp(mgr1);
+ if (re.test(w) && re2.test(w)) {
+ re = /.$/;
+ w = w.replace(re,"");
+ }
+
+ // and turn initial Y back to y
+ if (firstch == "y")
+ w = firstch.toLowerCase() + w.substr(1);
+ return w;
+ }
+}
+
+
+
+/**
+ * Simple result scoring code.
+ */
+var Scorer = {
+ // Implement the following function to further tweak the score for each result
+ // The function takes a result array [filename, title, anchor, descr, score]
+ // and returns the new score.
+ /*
+ score: function(result) {
+ return result[4];
+ },
+ */
+
+ // query matches the full name of an object
+ objNameMatch: 11,
+ // or matches in the last dotted part of the object name
+ objPartialMatch: 6,
+ // Additive scores depending on the priority of the object
+ objPrio: {0: 15, // used to be importantResults
+ 1: 5, // used to be objectResults
+ 2: -5}, // used to be unimportantResults
+ // Used when the priority is not in the mapping.
+ objPrioDefault: 0,
+
+ // query found in title
+ title: 15,
+ // query found in terms
+ term: 5
+};
+
+
+
+
+
+var splitChars = (function() {
+ var result = {};
+ var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
+ 1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
+ 2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
+ 2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
+ 3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
+ 3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
+ 4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
+ 8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
+ 11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
+ 43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
+ var i, j, start, end;
+ for (i = 0; i < singles.length; i++) {
+ result[singles[i]] = true;
+ }
+ var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
+ [722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
+ [1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
+ [1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
+ [1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
+ [2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
+ [2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
+ [2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
+ [2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
+ [2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
+ [2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
+ [2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
+ [3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
+ [3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
+ [3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
+ [3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
+ [3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
+ [3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
+ [4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
+ [4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
+ [4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
+ [4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
+ [5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
+ [6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
+ [6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
+ [6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
+ [6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
+ [7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
+ [7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
+ [8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
+ [8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
+ [8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
+ [10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
+ [11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
+ [12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
+ [12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
+ [12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
+ [19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
+ [42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
+ [42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
+ [43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
+ [43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
+ [43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
+ [43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
+ [44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
+ [57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
+ [64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
+ [65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
+ [65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
+ for (i = 0; i < ranges.length; i++) {
+ start = ranges[i][0];
+ end = ranges[i][1];
+ for (j = start; j <= end; j++) {
+ result[j] = true;
+ }
+ }
+ return result;
+})();
+
+function splitQuery(query) {
+ var result = [];
+ var start = -1;
+ for (var i = 0; i < query.length; i++) {
+ if (splitChars[query.charCodeAt(i)]) {
+ if (start !== -1) {
+ result.push(query.slice(start, i));
+ start = -1;
+ }
+ } else if (start === -1) {
+ start = i;
+ }
+ }
+ if (start !== -1) {
+ result.push(query.slice(start));
+ }
+ return result;
+}
+
+
+
+
+/**
+ * Search Module
+ */
+var Search = {
+
+ _index : null,
+ _queued_query : null,
+ _pulse_status : -1,
+
+ init : function() {
+ var params = $.getQueryParameters();
+ if (params.q) {
+ var query = params.q[0];
+ $('input[name="q"]')[0].value = query;
+ this.performSearch(query);
+ }
+ },
+
+ loadIndex : function(url) {
+ $.ajax({type: "GET", url: url, data: null,
+ dataType: "script", cache: true,
+ complete: function(jqxhr, textstatus) {
+ if (textstatus != "success") {
+ document.getElementById("searchindexloader").src = url;
+ }
+ }});
+ },
+
+ setIndex : function(index) {
+ var q;
+ this._index = index;
+ if ((q = this._queued_query) !== null) {
+ this._queued_query = null;
+ Search.query(q);
+ }
+ },
+
+ hasIndex : function() {
+ return this._index !== null;
+ },
+
+ deferQuery : function(query) {
+ this._queued_query = query;
+ },
+
+ stopPulse : function() {
+ this._pulse_status = 0;
+ },
+
+ startPulse : function() {
+ if (this._pulse_status >= 0)
+ return;
+ function pulse() {
+ var i;
+ Search._pulse_status = (Search._pulse_status + 1) % 4;
+ var dotString = '';
+ for (i = 0; i < Search._pulse_status; i++)
+ dotString += '.';
+ Search.dots.text(dotString);
+ if (Search._pulse_status > -1)
+ window.setTimeout(pulse, 500);
+ }
+ pulse();
+ },
+
+ /**
+ * perform a search for something (or wait until index is loaded)
+ */
+ performSearch : function(query) {
+ // create the required interface elements
+ this.out = $('#search-results');
+ this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
+ this.dots = $('<span></span>').appendTo(this.title);
+ this.status = $('<p style="display: none"></p>').appendTo(this.out);
+ this.output = $('<ul class="search"/>').appendTo(this.out);
+
+ $('#search-progress').text(_('Preparing search...'));
+ this.startPulse();
+
+ // index already loaded, the browser was quick!
+ if (this.hasIndex())
+ this.query(query);
+ else
+ this.deferQuery(query);
+ },
+
+ /**
+ * execute search (requires search index to be loaded)
+ */
+ query : function(query) {
+ var i;
+ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
+
+ // stem the searchterms and add them to the correct list
+ var stemmer = new Stemmer();
+ var searchterms = [];
+ var excluded = [];
+ var hlterms = [];
+ var tmp = splitQuery(query);
+ var objectterms = [];
+ for (i = 0; i < tmp.length; i++) {
+ if (tmp[i] !== "") {
+ objectterms.push(tmp[i].toLowerCase());
+ }
+
+ if ($u.indexOf(stopwords, tmp[i].toLowerCase()) != -1 || tmp[i].match(/^\d+$/) ||
+ tmp[i] === "") {
+ // skip this "word"
+ continue;
+ }
+ // stem the word
+ var word = stemmer.stemWord(tmp[i].toLowerCase());
+ // prevent stemmer from cutting word smaller than two chars
+ if(word.length < 3 && tmp[i].length >= 3) {
+ word = tmp[i];
+ }
+ var toAppend;
+ // select the correct list
+ if (word[0] == '-') {
+ toAppend = excluded;
+ word = word.substr(1);
+ }
+ else {
+ toAppend = searchterms;
+ hlterms.push(tmp[i].toLowerCase());
+ }
+ // only add if not already in the list
+ if (!$u.contains(toAppend, word))
+ toAppend.push(word);
+ }
+ var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
+
+ // console.debug('SEARCH: searching for:');
+ // console.info('required: ', searchterms);
+ // console.info('excluded: ', excluded);
+
+ // prepare search
+ var terms = this._index.terms;
+ var titleterms = this._index.titleterms;
+
+ // array of [filename, title, anchor, descr, score]
+ var results = [];
+ $('#search-progress').empty();
+
+ // lookup as object
+ for (i = 0; i < objectterms.length; i++) {
+ var others = [].concat(objectterms.slice(0, i),
+ objectterms.slice(i+1, objectterms.length));
+ results = results.concat(this.performObjectSearch(objectterms[i], others));
+ }
+
+ // lookup as search terms in fulltext
+ results = results.concat(this.performTermsSearch(searchterms, excluded, terms, titleterms));
+
+ // let the scorer override scores with a custom scoring function
+ if (Scorer.score) {
+ for (i = 0; i < results.length; i++)
+ results[i][4] = Scorer.score(results[i]);
+ }
+
+ // now sort the results by score (in opposite order of appearance, since the
+ // display function below uses pop() to retrieve items) and then
+ // alphabetically
+ results.sort(function(a, b) {
+ var left = a[4];
+ var right = b[4];
+ if (left > right) {
+ return 1;
+ } else if (left < right) {
+ return -1;
+ } else {
+ // same score: sort alphabetically
+ left = a[1].toLowerCase();
+ right = b[1].toLowerCase();
+ return (left > right) ? -1 : ((left < right) ? 1 : 0);
+ }
+ });
+
+ // for debugging
+ //Search.lastresults = results.slice(); // a copy
+ //console.info('search results:', Search.lastresults);
+
+ // print the results
+ var resultCount = results.length;
+ function displayNextItem() {
+ // results left, load the summary and display it
+ if (results.length) {
+ var item = results.pop();
+ var listItem = $('<li style="display:none"></li>');
+ if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') {
+ // dirhtml builder
+ var dirname = item[0] + '/';
+ if (dirname.match(/\/index\/$/)) {
+ dirname = dirname.substring(0, dirname.length-6);
+ } else if (dirname == 'index/') {
+ dirname = '';
+ }
+ listItem.append($('<a/>').attr('href',
+ DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
+ highlightstring + item[2]).html(item[1]));
+ } else {
+ // normal html builders
+ listItem.append($('<a/>').attr('href',
+ item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
+ highlightstring + item[2]).html(item[1]));
+ }
+ if (item[3]) {
+ listItem.append($('<span> (' + item[3] + ')</span>'));
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
+ var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
+ if (suffix === undefined) {
+ suffix = '.txt';
+ }
+ $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
+ dataType: "text",
+ complete: function(jqxhr, textstatus) {
+ var data = jqxhr.responseText;
+ if (data !== '' && data !== undefined) {
+ listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
+ }
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ }});
+ } else {
+ // no source available, just display title
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ }
+ }
+ // search finished, update title and status message
+ else {
+ Search.stopPulse();
+ Search.title.text(_('Search Results'));
+ if (!resultCount)
+ Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
+ else
+ Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
+ Search.status.fadeIn(500);
+ }
+ }
+ displayNextItem();
+ },
+
+ /**
+ * search for object names
+ */
+ performObjectSearch : function(object, otherterms) {
+ var filenames = this._index.filenames;
+ var docnames = this._index.docnames;
+ var objects = this._index.objects;
+ var objnames = this._index.objnames;
+ var titles = this._index.titles;
+
+ var i;
+ var results = [];
+
+ for (var prefix in objects) {
+ for (var name in objects[prefix]) {
+ var fullname = (prefix ? prefix + '.' : '') + name;
+ if (fullname.toLowerCase().indexOf(object) > -1) {
+ var score = 0;
+ var parts = fullname.split('.');
+ // check for different match types: exact matches of full name or
+ // "last name" (i.e. last dotted part)
+ if (fullname == object || parts[parts.length - 1] == object) {
+ score += Scorer.objNameMatch;
+ // matches in last name
+ } else if (parts[parts.length - 1].indexOf(object) > -1) {
+ score += Scorer.objPartialMatch;
+ }
+ var match = objects[prefix][name];
+ var objname = objnames[match[1]][2];
+ var title = titles[match[0]];
+ // If more than one term searched for, we require other words to be
+ // found in the name/title/description
+ if (otherterms.length > 0) {
+ var haystack = (prefix + ' ' + name + ' ' +
+ objname + ' ' + title).toLowerCase();
+ var allfound = true;
+ for (i = 0; i < otherterms.length; i++) {
+ if (haystack.indexOf(otherterms[i]) == -1) {
+ allfound = false;
+ break;
+ }
+ }
+ if (!allfound) {
+ continue;
+ }
+ }
+ var descr = objname + _(', in ') + title;
+
+ var anchor = match[3];
+ if (anchor === '')
+ anchor = fullname;
+ else if (anchor == '-')
+ anchor = objnames[match[1]][1] + '-' + fullname;
+ // add custom score for some objects according to scorer
+ if (Scorer.objPrio.hasOwnProperty(match[2])) {
+ score += Scorer.objPrio[match[2]];
+ } else {
+ score += Scorer.objPrioDefault;
+ }
+ results.push([docnames[match[0]], fullname, '#'+anchor, descr, score, filenames[match[0]]]);
+ }
+ }
+ }
+
+ return results;
+ },
+
+ /**
+ * search for full-text terms in the index
+ */
+ performTermsSearch : function(searchterms, excluded, terms, titleterms) {
+ var docnames = this._index.docnames;
+ var filenames = this._index.filenames;
+ var titles = this._index.titles;
+
+ var i, j, file;
+ var fileMap = {};
+ var scoreMap = {};
+ var results = [];
+
+ // perform the search on the required terms
+ for (i = 0; i < searchterms.length; i++) {
+ var word = searchterms[i];
+ var files = [];
+ var _o = [
+ {files: terms[word], score: Scorer.term},
+ {files: titleterms[word], score: Scorer.title}
+ ];
+
+ // no match but word was a required one
+ if ($u.every(_o, function(o){return o.files === undefined;})) {
+ break;
+ }
+ // found search word in contents
+ $u.each(_o, function(o) {
+ var _files = o.files;
+ if (_files === undefined)
+ return
+
+ if (_files.length === undefined)
+ _files = [_files];
+ files = files.concat(_files);
+
+ // set score for the word in each file to Scorer.term
+ for (j = 0; j < _files.length; j++) {
+ file = _files[j];
+ if (!(file in scoreMap))
+ scoreMap[file] = {}
+ scoreMap[file][word] = o.score;
+ }
+ });
+
+ // create the mapping
+ for (j = 0; j < files.length; j++) {
+ file = files[j];
+ if (file in fileMap)
+ fileMap[file].push(word);
+ else
+ fileMap[file] = [word];
+ }
+ }
+
+ // now check if the files don't contain excluded terms
+ for (file in fileMap) {
+ var valid = true;
+
+ // check if all requirements are matched
+ if (fileMap[file].length != searchterms.length)
+ continue;
+
+ // ensure that none of the excluded terms is in the search result
+ for (i = 0; i < excluded.length; i++) {
+ if (terms[excluded[i]] == file ||
+ titleterms[excluded[i]] == file ||
+ $u.contains(terms[excluded[i]] || [], file) ||
+ $u.contains(titleterms[excluded[i]] || [], file)) {
+ valid = false;
+ break;
+ }
+ }
+
+ // if we have still a valid result we can add it to the result list
+ if (valid) {
+ // select one (max) score for the file.
+ // for better ranking, we should calculate ranking by using words statistics like basic tf-idf...
+ var score = $u.max($u.map(fileMap[file], function(w){return scoreMap[file][w]}));
+ results.push([docnames[file], titles[file], '', null, score, filenames[file]]);
+ }
+ }
+ return results;
+ },
+
+ /**
+ * helper function to return a node containing the
+ * search summary for a given text. keywords is a list
+ * of stemmed words, hlwords is the list of normal, unstemmed
+ * words. the first one is used to find the occurrence, the
+ * latter for highlighting it.
+ */
+ makeSearchSummary : function(text, keywords, hlwords) {
+ var textLower = text.toLowerCase();
+ var start = 0;
+ $.each(keywords, function() {
+ var i = textLower.indexOf(this.toLowerCase());
+ if (i > -1)
+ start = i;
+ });
+ start = Math.max(start - 120, 0);
+ var excerpt = ((start > 0) ? '...' : '') +
+ $.trim(text.substr(start, 240)) +
+ ((start + 240 - text.length) ? '...' : '');
+ var rv = $('<div class="context"></div>').text(excerpt);
+ $.each(hlwords, function() {
+ rv = rv.highlightText(this, 'highlighted');
+ });
+ return rv;
+ }
+};
+
+$(document).ready(function() {
+ Search.init();
+});
\ No newline at end of file
--- /dev/null
+body {
+ background-color: white;
+ font-family: sans-serif;
+ margin: 0;
+ font-size: 16px;
+}
+
+div.document {
+ margin: 0 0 0 360px;
+ padding: 1em;
+ text-align: justify;
+ color: darkslategray;
+}
+div.document a { color: steelblue; }
+div.document h1,
+div.document h2,
+div.document h3,
+div.document h4,
+div.document h5,
+div.document h6 {
+ font-weight: normal;
+ padding: 1em 0 0 0;
+}
+div.document h1 { text-align: center; }
+div.document h2 { border-bottom: 1px solid; }
+div.document h3 { border-bottom: 1px solid lightgray; }
+div.document table, tr, td, th {
+ border: none;
+ padding: 0em 0.2em 0em 0.2em;
+}
+div.document img {
+ display: block;
+ /* border: 1px dotted; */
+ margin: auto;
+}
+div.document img.feed {
+ display: inline;
+ border: none;
+ width: 2em;
+ vertical-align: middle;
+}
+div.document img.math {
+ display: inline;
+ border: none;
+ vertical-align: middle;
+}
+div.document div.math img {
+ display: block;
+ border: none;
+ margin: auto;
+}
+div.document code {
+ font-size: 85%;
+ padding: 1px;
+ border: 1px solid darkgray;
+ background-color: aliceblue;
+}
+/* :download: role; should look like a normal link rather than inline code block */
+div.document a code.download {
+ font-family: sans;
+ font-size: 100%;
+ padding: none;
+ border: none;
+ background-color: transparent;
+}
+
+div.footer {
+ margin: 0 0 0 360px;
+ padding: 1em;
+ float: right;
+ font-style: italic;
+ color: gainsboro;
+}
+
+div.sphinxsidebar {
+ border-right: 1px solid darkgray;
+ min-width: 360px;
+ text-align: left;
+ position: fixed;
+ background-color: gainsboro;
+ overflow: auto;
+ height: 100%;
+ color: midnightblue;
+}
+div.sphinxsidebar a { color: midnightblue; }
+div.sphinxsidebarwrapper {
+ padding: 1em;
+}
+div.sphinxsidebarwrapper ul {
+ list-style-type: disc;
+ padding: 0 0 0 1em;
+ font-size: 90%;
+ color: darkgray;
+}
+div.sphinxsidebarwrapper h1,
+div.sphinxsidebarwrapper h2,
+div.sphinxsidebarwrapper h3,
+div.sphinxsidebarwrapper h4,
+div.sphinxsidebarwrapper h5,
+div.sphinxsidebarwrapper h6 {
+ padding: 0 0 0.1em 0;
+ border-bottom: 1px solid;
+}
+div.sphinxsidebarwrapper div.re2c-logo {
+ background-color: silver;
+ font-family: Courier, monospace;
+ font-size: 150%;
+ text-align: center;
+ border: 1px solid darkgray;
+ overflow: hidden;
+}
+div.re2c-toc-global {
+ font-size: 115%;
+}
+div.re2c-toc-local {
+ padding: 0.5em;
+ background-color: linen;
+ border: 1px solid darkgray;
+ overflow: auto;
+ font-size: 115%;
+}
+
+/* searchbox */
+input[type="text"] {
+ font-size: 100%;
+ padding: 0px 5px 0px 5px;
+ margin: 0px;
+ height: 2em;
+ width: 80%;
+ border: 1px solid darkgray;
+ border-radius: 7px;
+ background-color: white;
+}
+input[type="submit"] {
+ font-size: 100%;
+ padding: 0px 5px 0px 5px;
+ margin: 0px;
+ height: 2em;
+ width: auto;
+ border: 1px solid darkgray;
+ border-radius: 7px;
+ font-weight: bold;
+ color: steelblue;
+ background-color: whitesmoke;
+}
+
+.headerlink { display: none; }
+
+a:focus { outline: none; }
+
+/* move sidebar on mobile phones */
+@media (max-width: 1000px) {
+ div.sphinxsidebar {
+ position: static;
+ width: auto;
+ height: auto;
+ border-right: none;
+ border-bottom: 1px solid darkgray;
+ text-align: left;
+ }
+ div.document {
+ margin: 0;
+ }
+ body {
+ font-size: 150%;
+ }
+}
+
+::selection {
+ background: lightsteelblue;
+}
--- /dev/null
+// Underscore.js 1.3.1
+// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
+// Underscore is freely distributable under the MIT license.
+// Portions of Underscore are inspired or borrowed from Prototype,
+// Oliver Steele's Functional, and John Resig's Micro-Templating.
+// For all details and documentation:
+// http://documentcloud.github.com/underscore
+
+(function() {
+
+ // Baseline setup
+ // --------------
+
+ // Establish the root object, `window` in the browser, or `global` on the server.
+ var root = this;
+
+ // Save the previous value of the `_` variable.
+ var previousUnderscore = root._;
+
+ // Establish the object that gets returned to break out of a loop iteration.
+ var breaker = {};
+
+ // Save bytes in the minified (but not gzipped) version:
+ var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
+
+ // Create quick reference variables for speed access to core prototypes.
+ var slice = ArrayProto.slice,
+ unshift = ArrayProto.unshift,
+ toString = ObjProto.toString,
+ hasOwnProperty = ObjProto.hasOwnProperty;
+
+ // All **ECMAScript 5** native function implementations that we hope to use
+ // are declared here.
+ var
+ nativeForEach = ArrayProto.forEach,
+ nativeMap = ArrayProto.map,
+ nativeReduce = ArrayProto.reduce,
+ nativeReduceRight = ArrayProto.reduceRight,
+ nativeFilter = ArrayProto.filter,
+ nativeEvery = ArrayProto.every,
+ nativeSome = ArrayProto.some,
+ nativeIndexOf = ArrayProto.indexOf,
+ nativeLastIndexOf = ArrayProto.lastIndexOf,
+ nativeIsArray = Array.isArray,
+ nativeKeys = Object.keys,
+ nativeBind = FuncProto.bind;
+
+ // Create a safe reference to the Underscore object for use below.
+ var _ = function(obj) { return new wrapper(obj); };
+
+ // Export the Underscore object for **Node.js**, with
+ // backwards-compatibility for the old `require()` API. If we're in
+ // the browser, add `_` as a global object via a string identifier,
+ // for Closure Compiler "advanced" mode.
+ if (typeof exports !== 'undefined') {
+ if (typeof module !== 'undefined' && module.exports) {
+ exports = module.exports = _;
+ }
+ exports._ = _;
+ } else {
+ root['_'] = _;
+ }
+
+ // Current version.
+ _.VERSION = '1.3.1';
+
+ // Collection Functions
+ // --------------------
+
+ // The cornerstone, an `each` implementation, aka `forEach`.
+ // Handles objects with the built-in `forEach`, arrays, and raw objects.
+ // Delegates to **ECMAScript 5**'s native `forEach` if available.
+ var each = _.each = _.forEach = function(obj, iterator, context) {
+ if (obj == null) return;
+ if (nativeForEach && obj.forEach === nativeForEach) {
+ obj.forEach(iterator, context);
+ } else if (obj.length === +obj.length) {
+ for (var i = 0, l = obj.length; i < l; i++) {
+ if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
+ }
+ } else {
+ for (var key in obj) {
+ if (_.has(obj, key)) {
+ if (iterator.call(context, obj[key], key, obj) === breaker) return;
+ }
+ }
+ }
+ };
+
+ // Return the results of applying the iterator to each element.
+ // Delegates to **ECMAScript 5**'s native `map` if available.
+ _.map = _.collect = function(obj, iterator, context) {
+ var results = [];
+ if (obj == null) return results;
+ if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
+ each(obj, function(value, index, list) {
+ results[results.length] = iterator.call(context, value, index, list);
+ });
+ if (obj.length === +obj.length) results.length = obj.length;
+ return results;
+ };
+
+ // **Reduce** builds up a single result from a list of values, aka `inject`,
+ // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
+ _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
+ var initial = arguments.length > 2;
+ if (obj == null) obj = [];
+ if (nativeReduce && obj.reduce === nativeReduce) {
+ if (context) iterator = _.bind(iterator, context);
+ return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
+ }
+ each(obj, function(value, index, list) {
+ if (!initial) {
+ memo = value;
+ initial = true;
+ } else {
+ memo = iterator.call(context, memo, value, index, list);
+ }
+ });
+ if (!initial) throw new TypeError('Reduce of empty array with no initial value');
+ return memo;
+ };
+
+ // The right-associative version of reduce, also known as `foldr`.
+ // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
+ _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
+ var initial = arguments.length > 2;
+ if (obj == null) obj = [];
+ if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
+ if (context) iterator = _.bind(iterator, context);
+ return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
+ }
+ var reversed = _.toArray(obj).reverse();
+ if (context && !initial) iterator = _.bind(iterator, context);
+ return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
+ };
+
+ // Return the first value which passes a truth test. Aliased as `detect`.
+ _.find = _.detect = function(obj, iterator, context) {
+ var result;
+ any(obj, function(value, index, list) {
+ if (iterator.call(context, value, index, list)) {
+ result = value;
+ return true;
+ }
+ });
+ return result;
+ };
+
+ // Return all the elements that pass a truth test.
+ // Delegates to **ECMAScript 5**'s native `filter` if available.
+ // Aliased as `select`.
+ _.filter = _.select = function(obj, iterator, context) {
+ var results = [];
+ if (obj == null) return results;
+ if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
+ each(obj, function(value, index, list) {
+ if (iterator.call(context, value, index, list)) results[results.length] = value;
+ });
+ return results;
+ };
+
+ // Return all the elements for which a truth test fails.
+ _.reject = function(obj, iterator, context) {
+ var results = [];
+ if (obj == null) return results;
+ each(obj, function(value, index, list) {
+ if (!iterator.call(context, value, index, list)) results[results.length] = value;
+ });
+ return results;
+ };
+
+ // Determine whether all of the elements match a truth test.
+ // Delegates to **ECMAScript 5**'s native `every` if available.
+ // Aliased as `all`.
+ _.every = _.all = function(obj, iterator, context) {
+ var result = true;
+ if (obj == null) return result;
+ if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
+ each(obj, function(value, index, list) {
+ if (!(result = result && iterator.call(context, value, index, list))) return breaker;
+ });
+ return result;
+ };
+
+ // Determine if at least one element in the object matches a truth test.
+ // Delegates to **ECMAScript 5**'s native `some` if available.
+ // Aliased as `any`.
+ var any = _.some = _.any = function(obj, iterator, context) {
+ iterator || (iterator = _.identity);
+ var result = false;
+ if (obj == null) return result;
+ if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
+ each(obj, function(value, index, list) {
+ if (result || (result = iterator.call(context, value, index, list))) return breaker;
+ });
+ return !!result;
+ };
+
+ // Determine if a given value is included in the array or object using `===`.
+ // Aliased as `contains`.
+ _.include = _.contains = function(obj, target) {
+ var found = false;
+ if (obj == null) return found;
+ if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
+ found = any(obj, function(value) {
+ return value === target;
+ });
+ return found;
+ };
+
+ // Invoke a method (with arguments) on every item in a collection.
+ _.invoke = function(obj, method) {
+ var args = slice.call(arguments, 2);
+ return _.map(obj, function(value) {
+ return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
+ });
+ };
+
+ // Convenience version of a common use case of `map`: fetching a property.
+ _.pluck = function(obj, key) {
+ return _.map(obj, function(value){ return value[key]; });
+ };
+
+ // Return the maximum element or (element-based computation).
+ _.max = function(obj, iterator, context) {
+ if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
+ if (!iterator && _.isEmpty(obj)) return -Infinity;
+ var result = {computed : -Infinity};
+ each(obj, function(value, index, list) {
+ var computed = iterator ? iterator.call(context, value, index, list) : value;
+ computed >= result.computed && (result = {value : value, computed : computed});
+ });
+ return result.value;
+ };
+
+ // Return the minimum element (or element-based computation).
+ _.min = function(obj, iterator, context) {
+ if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
+ if (!iterator && _.isEmpty(obj)) return Infinity;
+ var result = {computed : Infinity};
+ each(obj, function(value, index, list) {
+ var computed = iterator ? iterator.call(context, value, index, list) : value;
+ computed < result.computed && (result = {value : value, computed : computed});
+ });
+ return result.value;
+ };
+
+ // Shuffle an array.
+ _.shuffle = function(obj) {
+ var shuffled = [], rand;
+ each(obj, function(value, index, list) {
+ if (index == 0) {
+ shuffled[0] = value;
+ } else {
+ rand = Math.floor(Math.random() * (index + 1));
+ shuffled[index] = shuffled[rand];
+ shuffled[rand] = value;
+ }
+ });
+ return shuffled;
+ };
+
+ // Sort the object's values by a criterion produced by an iterator.
+ _.sortBy = function(obj, iterator, context) {
+ return _.pluck(_.map(obj, function(value, index, list) {
+ return {
+ value : value,
+ criteria : iterator.call(context, value, index, list)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }), 'value');
+ };
+
+ // Groups the object's values by a criterion. Pass either a string attribute
+ // to group by, or a function that returns the criterion.
+ _.groupBy = function(obj, val) {
+ var result = {};
+ var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
+ each(obj, function(value, index) {
+ var key = iterator(value, index);
+ (result[key] || (result[key] = [])).push(value);
+ });
+ return result;
+ };
+
+ // Use a comparator function to figure out at what index an object should
+ // be inserted so as to maintain order. Uses binary search.
+ _.sortedIndex = function(array, obj, iterator) {
+ iterator || (iterator = _.identity);
+ var low = 0, high = array.length;
+ while (low < high) {
+ var mid = (low + high) >> 1;
+ iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
+ }
+ return low;
+ };
+
+ // Safely convert anything iterable into a real, live array.
+ _.toArray = function(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) return iterable.toArray();
+ if (_.isArray(iterable)) return slice.call(iterable);
+ if (_.isArguments(iterable)) return slice.call(iterable);
+ return _.values(iterable);
+ };
+
+ // Return the number of elements in an object.
+ _.size = function(obj) {
+ return _.toArray(obj).length;
+ };
+
+ // Array Functions
+ // ---------------
+
+ // Get the first element of an array. Passing **n** will return the first N
+ // values in the array. Aliased as `head`. The **guard** check allows it to work
+ // with `_.map`.
+ _.first = _.head = function(array, n, guard) {
+ return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
+ };
+
+ // Returns everything but the last entry of the array. Especcialy useful on
+ // the arguments object. Passing **n** will return all the values in
+ // the array, excluding the last N. The **guard** check allows it to work with
+ // `_.map`.
+ _.initial = function(array, n, guard) {
+ return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
+ };
+
+ // Get the last element of an array. Passing **n** will return the last N
+ // values in the array. The **guard** check allows it to work with `_.map`.
+ _.last = function(array, n, guard) {
+ if ((n != null) && !guard) {
+ return slice.call(array, Math.max(array.length - n, 0));
+ } else {
+ return array[array.length - 1];
+ }
+ };
+
+ // Returns everything but the first entry of the array. Aliased as `tail`.
+ // Especially useful on the arguments object. Passing an **index** will return
+ // the rest of the values in the array from that index onward. The **guard**
+ // check allows it to work with `_.map`.
+ _.rest = _.tail = function(array, index, guard) {
+ return slice.call(array, (index == null) || guard ? 1 : index);
+ };
+
+ // Trim out all falsy values from an array.
+ _.compact = function(array) {
+ return _.filter(array, function(value){ return !!value; });
+ };
+
+ // Return a completely flattened version of an array.
+ _.flatten = function(array, shallow) {
+ return _.reduce(array, function(memo, value) {
+ if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
+ memo[memo.length] = value;
+ return memo;
+ }, []);
+ };
+
+ // Return a version of the array that does not contain the specified value(s).
+ _.without = function(array) {
+ return _.difference(array, slice.call(arguments, 1));
+ };
+
+ // Produce a duplicate-free version of the array. If the array has already
+ // been sorted, you have the option of using a faster algorithm.
+ // Aliased as `unique`.
+ _.uniq = _.unique = function(array, isSorted, iterator) {
+ var initial = iterator ? _.map(array, iterator) : array;
+ var result = [];
+ _.reduce(initial, function(memo, el, i) {
+ if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {
+ memo[memo.length] = el;
+ result[result.length] = array[i];
+ }
+ return memo;
+ }, []);
+ return result;
+ };
+
+ // Produce an array that contains the union: each distinct element from all of
+ // the passed-in arrays.
+ _.union = function() {
+ return _.uniq(_.flatten(arguments, true));
+ };
+
+ // Produce an array that contains every item shared between all the
+ // passed-in arrays. (Aliased as "intersect" for back-compat.)
+ _.intersection = _.intersect = function(array) {
+ var rest = slice.call(arguments, 1);
+ return _.filter(_.uniq(array), function(item) {
+ return _.every(rest, function(other) {
+ return _.indexOf(other, item) >= 0;
+ });
+ });
+ };
+
+ // Take the difference between one array and a number of other arrays.
+ // Only the elements present in just the first array will remain.
+ _.difference = function(array) {
+ var rest = _.flatten(slice.call(arguments, 1));
+ return _.filter(array, function(value){ return !_.include(rest, value); });
+ };
+
+ // Zip together multiple lists into a single array -- elements that share
+ // an index go together.
+ _.zip = function() {
+ var args = slice.call(arguments);
+ var length = _.max(_.pluck(args, 'length'));
+ var results = new Array(length);
+ for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
+ return results;
+ };
+
+ // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
+ // we need this function. Return the position of the first occurrence of an
+ // item in an array, or -1 if the item is not included in the array.
+ // Delegates to **ECMAScript 5**'s native `indexOf` if available.
+ // If the array is large and already in sort order, pass `true`
+ // for **isSorted** to use binary search.
+ _.indexOf = function(array, item, isSorted) {
+ if (array == null) return -1;
+ var i, l;
+ if (isSorted) {
+ i = _.sortedIndex(array, item);
+ return array[i] === item ? i : -1;
+ }
+ if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
+ for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
+ return -1;
+ };
+
+ // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
+ _.lastIndexOf = function(array, item) {
+ if (array == null) return -1;
+ if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
+ var i = array.length;
+ while (i--) if (i in array && array[i] === item) return i;
+ return -1;
+ };
+
+ // Generate an integer Array containing an arithmetic progression. A port of
+ // the native Python `range()` function. See
+ // [the Python documentation](http://docs.python.org/library/functions.html#range).
+ _.range = function(start, stop, step) {
+ if (arguments.length <= 1) {
+ stop = start || 0;
+ start = 0;
+ }
+ step = arguments[2] || 1;
+
+ var len = Math.max(Math.ceil((stop - start) / step), 0);
+ var idx = 0;
+ var range = new Array(len);
+
+ while(idx < len) {
+ range[idx++] = start;
+ start += step;
+ }
+
+ return range;
+ };
+
+ // Function (ahem) Functions
+ // ------------------
+
+ // Reusable constructor function for prototype setting.
+ var ctor = function(){};
+
+ // Create a function bound to a given object (assigning `this`, and arguments,
+ // optionally). Binding with arguments is also known as `curry`.
+ // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
+ // We check for `func.bind` first, to fail fast when `func` is undefined.
+ _.bind = function bind(func, context) {
+ var bound, args;
+ if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
+ if (!_.isFunction(func)) throw new TypeError;
+ args = slice.call(arguments, 2);
+ return bound = function() {
+ if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
+ ctor.prototype = func.prototype;
+ var self = new ctor;
+ var result = func.apply(self, args.concat(slice.call(arguments)));
+ if (Object(result) === result) return result;
+ return self;
+ };
+ };
+
+ // Bind all of an object's methods to that object. Useful for ensuring that
+ // all callbacks defined on an object belong to it.
+ _.bindAll = function(obj) {
+ var funcs = slice.call(arguments, 1);
+ if (funcs.length == 0) funcs = _.functions(obj);
+ each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
+ return obj;
+ };
+
+ // Memoize an expensive function by storing its results.
+ _.memoize = function(func, hasher) {
+ var memo = {};
+ hasher || (hasher = _.identity);
+ return function() {
+ var key = hasher.apply(this, arguments);
+ return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
+ };
+ };
+
+ // Delays a function for the given number of milliseconds, and then calls
+ // it with the arguments supplied.
+ _.delay = function(func, wait) {
+ var args = slice.call(arguments, 2);
+ return setTimeout(function(){ return func.apply(func, args); }, wait);
+ };
+
+ // Defers a function, scheduling it to run after the current call stack has
+ // cleared.
+ _.defer = function(func) {
+ return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
+ };
+
+ // Returns a function, that, when invoked, will only be triggered at most once
+ // during a given window of time.
+ _.throttle = function(func, wait) {
+ var context, args, timeout, throttling, more;
+ var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
+ return function() {
+ context = this; args = arguments;
+ var later = function() {
+ timeout = null;
+ if (more) func.apply(context, args);
+ whenDone();
+ };
+ if (!timeout) timeout = setTimeout(later, wait);
+ if (throttling) {
+ more = true;
+ } else {
+ func.apply(context, args);
+ }
+ whenDone();
+ throttling = true;
+ };
+ };
+
+ // Returns a function, that, as long as it continues to be invoked, will not
+ // be triggered. The function will be called after it stops being called for
+ // N milliseconds.
+ _.debounce = function(func, wait) {
+ var timeout;
+ return function() {
+ var context = this, args = arguments;
+ var later = function() {
+ timeout = null;
+ func.apply(context, args);
+ };
+ clearTimeout(timeout);
+ timeout = setTimeout(later, wait);
+ };
+ };
+
+ // Returns a function that will be executed at most one time, no matter how
+ // often you call it. Useful for lazy initialization.
+ _.once = function(func) {
+ var ran = false, memo;
+ return function() {
+ if (ran) return memo;
+ ran = true;
+ return memo = func.apply(this, arguments);
+ };
+ };
+
+ // Returns the first function passed as an argument to the second,
+ // allowing you to adjust arguments, run code before and after, and
+ // conditionally execute the original function.
+ _.wrap = function(func, wrapper) {
+ return function() {
+ var args = [func].concat(slice.call(arguments, 0));
+ return wrapper.apply(this, args);
+ };
+ };
+
+ // Returns a function that is the composition of a list of functions, each
+ // consuming the return value of the function that follows.
+ _.compose = function() {
+ var funcs = arguments;
+ return function() {
+ var args = arguments;
+ for (var i = funcs.length - 1; i >= 0; i--) {
+ args = [funcs[i].apply(this, args)];
+ }
+ return args[0];
+ };
+ };
+
+ // Returns a function that will only be executed after being called N times.
+ _.after = function(times, func) {
+ if (times <= 0) return func();
+ return function() {
+ if (--times < 1) { return func.apply(this, arguments); }
+ };
+ };
+
+ // Object Functions
+ // ----------------
+
+ // Retrieve the names of an object's properties.
+ // Delegates to **ECMAScript 5**'s native `Object.keys`
+ _.keys = nativeKeys || function(obj) {
+ if (obj !== Object(obj)) throw new TypeError('Invalid object');
+ var keys = [];
+ for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
+ return keys;
+ };
+
+ // Retrieve the values of an object's properties.
+ _.values = function(obj) {
+ return _.map(obj, _.identity);
+ };
+
+ // Return a sorted list of the function names available on the object.
+ // Aliased as `methods`
+ _.functions = _.methods = function(obj) {
+ var names = [];
+ for (var key in obj) {
+ if (_.isFunction(obj[key])) names.push(key);
+ }
+ return names.sort();
+ };
+
+ // Extend a given object with all the properties in passed-in object(s).
+ _.extend = function(obj) {
+ each(slice.call(arguments, 1), function(source) {
+ for (var prop in source) {
+ obj[prop] = source[prop];
+ }
+ });
+ return obj;
+ };
+
+ // Fill in a given object with default properties.
+ _.defaults = function(obj) {
+ each(slice.call(arguments, 1), function(source) {
+ for (var prop in source) {
+ if (obj[prop] == null) obj[prop] = source[prop];
+ }
+ });
+ return obj;
+ };
+
+ // Create a (shallow-cloned) duplicate of an object.
+ _.clone = function(obj) {
+ if (!_.isObject(obj)) return obj;
+ return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
+ };
+
+ // Invokes interceptor with the obj, and then returns obj.
+ // The primary purpose of this method is to "tap into" a method chain, in
+ // order to perform operations on intermediate results within the chain.
+ _.tap = function(obj, interceptor) {
+ interceptor(obj);
+ return obj;
+ };
+
+ // Internal recursive comparison function.
+ function eq(a, b, stack) {
+ // Identical objects are equal. `0 === -0`, but they aren't identical.
+ // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
+ if (a === b) return a !== 0 || 1 / a == 1 / b;
+ // A strict comparison is necessary because `null == undefined`.
+ if (a == null || b == null) return a === b;
+ // Unwrap any wrapped objects.
+ if (a._chain) a = a._wrapped;
+ if (b._chain) b = b._wrapped;
+ // Invoke a custom `isEqual` method if one is provided.
+ if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
+ if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
+ // Compare `[[Class]]` names.
+ var className = toString.call(a);
+ if (className != toString.call(b)) return false;
+ switch (className) {
+ // Strings, numbers, dates, and booleans are compared by value.
+ case '[object String]':
+ // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
+ // equivalent to `new String("5")`.
+ return a == String(b);
+ case '[object Number]':
+ // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
+ // other numeric values.
+ return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
+ case '[object Date]':
+ case '[object Boolean]':
+ // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+ // millisecond representations. Note that invalid dates with millisecond representations
+ // of `NaN` are not equivalent.
+ return +a == +b;
+ // RegExps are compared by their source patterns and flags.
+ case '[object RegExp]':
+ return a.source == b.source &&
+ a.global == b.global &&
+ a.multiline == b.multiline &&
+ a.ignoreCase == b.ignoreCase;
+ }
+ if (typeof a != 'object' || typeof b != 'object') return false;
+ // Assume equality for cyclic structures. The algorithm for detecting cyclic
+ // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
+ var length = stack.length;
+ while (length--) {
+ // Linear search. Performance is inversely proportional to the number of
+ // unique nested structures.
+ if (stack[length] == a) return true;
+ }
+ // Add the first object to the stack of traversed objects.
+ stack.push(a);
+ var size = 0, result = true;
+ // Recursively compare objects and arrays.
+ if (className == '[object Array]') {
+ // Compare array lengths to determine if a deep comparison is necessary.
+ size = a.length;
+ result = size == b.length;
+ if (result) {
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (size--) {
+ // Ensure commutative equality for sparse arrays.
+ if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
+ }
+ }
+ } else {
+ // Objects with different constructors are not equivalent.
+ if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
+ // Deep compare objects.
+ for (var key in a) {
+ if (_.has(a, key)) {
+ // Count the expected number of properties.
+ size++;
+ // Deep compare each member.
+ if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
+ }
+ }
+ // Ensure that both objects contain the same number of properties.
+ if (result) {
+ for (key in b) {
+ if (_.has(b, key) && !(size--)) break;
+ }
+ result = !size;
+ }
+ }
+ // Remove the first object from the stack of traversed objects.
+ stack.pop();
+ return result;
+ }
+
+ // Perform a deep comparison to check if two objects are equal.
+ _.isEqual = function(a, b) {
+ return eq(a, b, []);
+ };
+
+ // Is a given array, string, or object empty?
+ // An "empty" object has no enumerable own-properties.
+ _.isEmpty = function(obj) {
+ if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
+ for (var key in obj) if (_.has(obj, key)) return false;
+ return true;
+ };
+
+ // Is a given value a DOM element?
+ _.isElement = function(obj) {
+ return !!(obj && obj.nodeType == 1);
+ };
+
+ // Is a given value an array?
+ // Delegates to ECMA5's native Array.isArray
+ _.isArray = nativeIsArray || function(obj) {
+ return toString.call(obj) == '[object Array]';
+ };
+
+ // Is a given variable an object?
+ _.isObject = function(obj) {
+ return obj === Object(obj);
+ };
+
+ // Is a given variable an arguments object?
+ _.isArguments = function(obj) {
+ return toString.call(obj) == '[object Arguments]';
+ };
+ if (!_.isArguments(arguments)) {
+ _.isArguments = function(obj) {
+ return !!(obj && _.has(obj, 'callee'));
+ };
+ }
+
+ // Is a given value a function?
+ _.isFunction = function(obj) {
+ return toString.call(obj) == '[object Function]';
+ };
+
+ // Is a given value a string?
+ _.isString = function(obj) {
+ return toString.call(obj) == '[object String]';
+ };
+
+ // Is a given value a number?
+ _.isNumber = function(obj) {
+ return toString.call(obj) == '[object Number]';
+ };
+
+ // Is the given value `NaN`?
+ _.isNaN = function(obj) {
+ // `NaN` is the only value for which `===` is not reflexive.
+ return obj !== obj;
+ };
+
+ // Is a given value a boolean?
+ _.isBoolean = function(obj) {
+ return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
+ };
+
+ // Is a given value a date?
+ _.isDate = function(obj) {
+ return toString.call(obj) == '[object Date]';
+ };
+
+ // Is the given value a regular expression?
+ _.isRegExp = function(obj) {
+ return toString.call(obj) == '[object RegExp]';
+ };
+
+ // Is a given value equal to null?
+ _.isNull = function(obj) {
+ return obj === null;
+ };
+
+ // Is a given variable undefined?
+ _.isUndefined = function(obj) {
+ return obj === void 0;
+ };
+
+ // Has own property?
+ _.has = function(obj, key) {
+ return hasOwnProperty.call(obj, key);
+ };
+
+ // Utility Functions
+ // -----------------
+
+ // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
+ // previous owner. Returns a reference to the Underscore object.
+ _.noConflict = function() {
+ root._ = previousUnderscore;
+ return this;
+ };
+
+ // Keep the identity function around for default iterators.
+ _.identity = function(value) {
+ return value;
+ };
+
+ // Run a function **n** times.
+ _.times = function (n, iterator, context) {
+ for (var i = 0; i < n; i++) iterator.call(context, i);
+ };
+
+ // Escape a string for HTML interpolation.
+ _.escape = function(string) {
+ return (''+string).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/');
+ };
+
+ // Add your own custom functions to the Underscore object, ensuring that
+ // they're correctly added to the OOP wrapper as well.
+ _.mixin = function(obj) {
+ each(_.functions(obj), function(name){
+ addToWrapper(name, _[name] = obj[name]);
+ });
+ };
+
+ // Generate a unique integer id (unique within the entire client session).
+ // Useful for temporary DOM ids.
+ var idCounter = 0;
+ _.uniqueId = function(prefix) {
+ var id = idCounter++;
+ return prefix ? prefix + id : id;
+ };
+
+ // By default, Underscore uses ERB-style template delimiters, change the
+ // following template settings to use alternative delimiters.
+ _.templateSettings = {
+ evaluate : /<%([\s\S]+?)%>/g,
+ interpolate : /<%=([\s\S]+?)%>/g,
+ escape : /<%-([\s\S]+?)%>/g
+ };
+
+ // When customizing `templateSettings`, if you don't want to define an
+ // interpolation, evaluation or escaping regex, we need one that is
+ // guaranteed not to match.
+ var noMatch = /.^/;
+
+ // Within an interpolation, evaluation, or escaping, remove HTML escaping
+ // that had been previously added.
+ var unescape = function(code) {
+ return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'");
+ };
+
+ // JavaScript micro-templating, similar to John Resig's implementation.
+ // Underscore templating handles arbitrary delimiters, preserves whitespace,
+ // and correctly escapes quotes within interpolated code.
+ _.template = function(str, data) {
+ var c = _.templateSettings;
+ var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
+ 'with(obj||{}){__p.push(\'' +
+ str.replace(/\\/g, '\\\\')
+ .replace(/'/g, "\\'")
+ .replace(c.escape || noMatch, function(match, code) {
+ return "',_.escape(" + unescape(code) + "),'";
+ })
+ .replace(c.interpolate || noMatch, function(match, code) {
+ return "'," + unescape(code) + ",'";
+ })
+ .replace(c.evaluate || noMatch, function(match, code) {
+ return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('";
+ })
+ .replace(/\r/g, '\\r')
+ .replace(/\n/g, '\\n')
+ .replace(/\t/g, '\\t')
+ + "');}return __p.join('');";
+ var func = new Function('obj', '_', tmpl);
+ if (data) return func(data, _);
+ return function(data) {
+ return func.call(this, data, _);
+ };
+ };
+
+ // Add a "chain" function, which will delegate to the wrapper.
+ _.chain = function(obj) {
+ return _(obj).chain();
+ };
+
+ // The OOP Wrapper
+ // ---------------
+
+ // If Underscore is called as a function, it returns a wrapped object that
+ // can be used OO-style. This wrapper holds altered versions of all the
+ // underscore functions. Wrapped objects may be chained.
+ var wrapper = function(obj) { this._wrapped = obj; };
+
+ // Expose `wrapper.prototype` as `_.prototype`
+ _.prototype = wrapper.prototype;
+
+ // Helper function to continue chaining intermediate results.
+ var result = function(obj, chain) {
+ return chain ? _(obj).chain() : obj;
+ };
+
+ // A method to easily add functions to the OOP wrapper.
+ var addToWrapper = function(name, func) {
+ wrapper.prototype[name] = function() {
+ var args = slice.call(arguments);
+ unshift.call(args, this._wrapped);
+ return result(func.apply(_, args), this._chain);
+ };
+ };
+
+ // Add all of the Underscore functions to the wrapper object.
+ _.mixin(_);
+
+ // Add all mutator Array functions to the wrapper.
+ each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+ var method = ArrayProto[name];
+ wrapper.prototype[name] = function() {
+ var wrapped = this._wrapped;
+ method.apply(wrapped, arguments);
+ var length = wrapped.length;
+ if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
+ return result(wrapped, this._chain);
+ };
+ });
+
+ // Add all accessor Array functions to the wrapper.
+ each(['concat', 'join', 'slice'], function(name) {
+ var method = ArrayProto[name];
+ wrapper.prototype[name] = function() {
+ return result(method.apply(this._wrapped, arguments), this._chain);
+ };
+ });
+
+ // Start chaining a wrapped Underscore object.
+ wrapper.prototype.chain = function() {
+ this._chain = true;
+ return this;
+ };
+
+ // Extracts the result from a wrapped and chained object.
+ wrapper.prototype.value = function() {
+ return this._wrapped;
+ };
+
+}).call(this);
--- /dev/null
+// Underscore.js 1.3.1
+// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
+// Underscore is freely distributable under the MIT license.
+// Portions of Underscore are inspired or borrowed from Prototype,
+// Oliver Steele's Functional, and John Resig's Micro-Templating.
+// For all details and documentation:
+// http://documentcloud.github.com/underscore
+(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source==
+c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,
+h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each=
+b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a==
+null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=
+function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e=
+e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=
+function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})});
+return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,
+c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest=
+b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]);
+return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c,
+d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g};
+var F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a,
+c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true:
+a.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}};
+b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments,
+1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};
+b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};
+b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a),
+function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+
+u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]=
+function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=
+true;return this};m.prototype.value=function(){return this._wrapped}}).call(this);
--- /dev/null
+/*
+ * websupport.js
+ * ~~~~~~~~~~~~~
+ *
+ * sphinx.websupport utilities for all documentation.
+ *
+ * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
+ * :license: BSD, see LICENSE for details.
+ *
+ */
+
+(function($) {
+ $.fn.autogrow = function() {
+ return this.each(function() {
+ var textarea = this;
+
+ $.fn.autogrow.resize(textarea);
+
+ $(textarea)
+ .focus(function() {
+ textarea.interval = setInterval(function() {
+ $.fn.autogrow.resize(textarea);
+ }, 500);
+ })
+ .blur(function() {
+ clearInterval(textarea.interval);
+ });
+ });
+ };
+
+ $.fn.autogrow.resize = function(textarea) {
+ var lineHeight = parseInt($(textarea).css('line-height'), 10);
+ var lines = textarea.value.split('\n');
+ var columns = textarea.cols;
+ var lineCount = 0;
+ $.each(lines, function() {
+ lineCount += Math.ceil(this.length / columns) || 1;
+ });
+ var height = lineHeight * (lineCount + 1);
+ $(textarea).css('height', height);
+ };
+})(jQuery);
+
+(function($) {
+ var comp, by;
+
+ function init() {
+ initEvents();
+ initComparator();
+ }
+
+ function initEvents() {
+ $(document).on("click", 'a.comment-close', function(event) {
+ event.preventDefault();
+ hide($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.vote', function(event) {
+ event.preventDefault();
+ handleVote($(this));
+ });
+ $(document).on("click", 'a.reply', function(event) {
+ event.preventDefault();
+ openReply($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.close-reply', function(event) {
+ event.preventDefault();
+ closeReply($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.sort-option', function(event) {
+ event.preventDefault();
+ handleReSort($(this));
+ });
+ $(document).on("click", 'a.show-proposal', function(event) {
+ event.preventDefault();
+ showProposal($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.hide-proposal', function(event) {
+ event.preventDefault();
+ hideProposal($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.show-propose-change', function(event) {
+ event.preventDefault();
+ showProposeChange($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.hide-propose-change', function(event) {
+ event.preventDefault();
+ hideProposeChange($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.accept-comment', function(event) {
+ event.preventDefault();
+ acceptComment($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.delete-comment', function(event) {
+ event.preventDefault();
+ deleteComment($(this).attr('id').substring(2));
+ });
+ $(document).on("click", 'a.comment-markup', function(event) {
+ event.preventDefault();
+ toggleCommentMarkupBox($(this).attr('id').substring(2));
+ });
+ }
+
+ /**
+ * Set comp, which is a comparator function used for sorting and
+ * inserting comments into the list.
+ */
+ function setComparator() {
+ // If the first three letters are "asc", sort in ascending order
+ // and remove the prefix.
+ if (by.substring(0,3) == 'asc') {
+ var i = by.substring(3);
+ comp = function(a, b) { return a[i] - b[i]; };
+ } else {
+ // Otherwise sort in descending order.
+ comp = function(a, b) { return b[by] - a[by]; };
+ }
+
+ // Reset link styles and format the selected sort option.
+ $('a.sel').attr('href', '#').removeClass('sel');
+ $('a.by' + by).removeAttr('href').addClass('sel');
+ }
+
+ /**
+ * Create a comp function. If the user has preferences stored in
+ * the sortBy cookie, use those, otherwise use the default.
+ */
+ function initComparator() {
+ by = 'rating'; // Default to sort by rating.
+ // If the sortBy cookie is set, use that instead.
+ if (document.cookie.length > 0) {
+ var start = document.cookie.indexOf('sortBy=');
+ if (start != -1) {
+ start = start + 7;
+ var end = document.cookie.indexOf(";", start);
+ if (end == -1) {
+ end = document.cookie.length;
+ by = unescape(document.cookie.substring(start, end));
+ }
+ }
+ }
+ setComparator();
+ }
+
+ /**
+ * Show a comment div.
+ */
+ function show(id) {
+ $('#ao' + id).hide();
+ $('#ah' + id).show();
+ var context = $.extend({id: id}, opts);
+ var popup = $(renderTemplate(popupTemplate, context)).hide();
+ popup.find('textarea[name="proposal"]').hide();
+ popup.find('a.by' + by).addClass('sel');
+ var form = popup.find('#cf' + id);
+ form.submit(function(event) {
+ event.preventDefault();
+ addComment(form);
+ });
+ $('#s' + id).after(popup);
+ popup.slideDown('fast', function() {
+ getComments(id);
+ });
+ }
+
+ /**
+ * Hide a comment div.
+ */
+ function hide(id) {
+ $('#ah' + id).hide();
+ $('#ao' + id).show();
+ var div = $('#sc' + id);
+ div.slideUp('fast', function() {
+ div.remove();
+ });
+ }
+
+ /**
+ * Perform an ajax request to get comments for a node
+ * and insert the comments into the comments tree.
+ */
+ function getComments(id) {
+ $.ajax({
+ type: 'GET',
+ url: opts.getCommentsURL,
+ data: {node: id},
+ success: function(data, textStatus, request) {
+ var ul = $('#cl' + id);
+ var speed = 100;
+ $('#cf' + id)
+ .find('textarea[name="proposal"]')
+ .data('source', data.source);
+
+ if (data.comments.length === 0) {
+ ul.html('<li>No comments yet.</li>');
+ ul.data('empty', true);
+ } else {
+ // If there are comments, sort them and put them in the list.
+ var comments = sortComments(data.comments);
+ speed = data.comments.length * 100;
+ appendComments(comments, ul);
+ ul.data('empty', false);
+ }
+ $('#cn' + id).slideUp(speed + 200);
+ ul.slideDown(speed);
+ },
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem retrieving the comments.');
+ },
+ dataType: 'json'
+ });
+ }
+
+ /**
+ * Add a comment via ajax and insert the comment into the comment tree.
+ */
+ function addComment(form) {
+ var node_id = form.find('input[name="node"]').val();
+ var parent_id = form.find('input[name="parent"]').val();
+ var text = form.find('textarea[name="comment"]').val();
+ var proposal = form.find('textarea[name="proposal"]').val();
+
+ if (text == '') {
+ showError('Please enter a comment.');
+ return;
+ }
+
+ // Disable the form that is being submitted.
+ form.find('textarea,input').attr('disabled', 'disabled');
+
+ // Send the comment to the server.
+ $.ajax({
+ type: "POST",
+ url: opts.addCommentURL,
+ dataType: 'json',
+ data: {
+ node: node_id,
+ parent: parent_id,
+ text: text,
+ proposal: proposal
+ },
+ success: function(data, textStatus, error) {
+ // Reset the form.
+ if (node_id) {
+ hideProposeChange(node_id);
+ }
+ form.find('textarea')
+ .val('')
+ .add(form.find('input'))
+ .removeAttr('disabled');
+ var ul = $('#cl' + (node_id || parent_id));
+ if (ul.data('empty')) {
+ $(ul).empty();
+ ul.data('empty', false);
+ }
+ insertComment(data.comment);
+ var ao = $('#ao' + node_id);
+ ao.find('img').attr({'src': opts.commentBrightImage});
+ if (node_id) {
+ // if this was a "root" comment, remove the commenting box
+ // (the user can get it back by reopening the comment popup)
+ $('#ca' + node_id).slideUp();
+ }
+ },
+ error: function(request, textStatus, error) {
+ form.find('textarea,input').removeAttr('disabled');
+ showError('Oops, there was a problem adding the comment.');
+ }
+ });
+ }
+
+ /**
+ * Recursively append comments to the main comment list and children
+ * lists, creating the comment tree.
+ */
+ function appendComments(comments, ul) {
+ $.each(comments, function() {
+ var div = createCommentDiv(this);
+ ul.append($(document.createElement('li')).html(div));
+ appendComments(this.children, div.find('ul.comment-children'));
+ // To avoid stagnating data, don't store the comments children in data.
+ this.children = null;
+ div.data('comment', this);
+ });
+ }
+
+ /**
+ * After adding a new comment, it must be inserted in the correct
+ * location in the comment tree.
+ */
+ function insertComment(comment) {
+ var div = createCommentDiv(comment);
+
+ // To avoid stagnating data, don't store the comments children in data.
+ comment.children = null;
+ div.data('comment', comment);
+
+ var ul = $('#cl' + (comment.node || comment.parent));
+ var siblings = getChildren(ul);
+
+ var li = $(document.createElement('li'));
+ li.hide();
+
+ // Determine where in the parents children list to insert this comment.
+ for(var i=0; i < siblings.length; i++) {
+ if (comp(comment, siblings[i]) <= 0) {
+ $('#cd' + siblings[i].id)
+ .parent()
+ .before(li.html(div));
+ li.slideDown('fast');
+ return;
+ }
+ }
+
+ // If we get here, this comment rates lower than all the others,
+ // or it is the only comment in the list.
+ ul.append(li.html(div));
+ li.slideDown('fast');
+ }
+
+ function acceptComment(id) {
+ $.ajax({
+ type: 'POST',
+ url: opts.acceptCommentURL,
+ data: {id: id},
+ success: function(data, textStatus, request) {
+ $('#cm' + id).fadeOut('fast');
+ $('#cd' + id).removeClass('moderate');
+ },
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem accepting the comment.');
+ }
+ });
+ }
+
+ function deleteComment(id) {
+ $.ajax({
+ type: 'POST',
+ url: opts.deleteCommentURL,
+ data: {id: id},
+ success: function(data, textStatus, request) {
+ var div = $('#cd' + id);
+ if (data == 'delete') {
+ // Moderator mode: remove the comment and all children immediately
+ div.slideUp('fast', function() {
+ div.remove();
+ });
+ return;
+ }
+ // User mode: only mark the comment as deleted
+ div
+ .find('span.user-id:first')
+ .text('[deleted]').end()
+ .find('div.comment-text:first')
+ .text('[deleted]').end()
+ .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id +
+ ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id)
+ .remove();
+ var comment = div.data('comment');
+ comment.username = '[deleted]';
+ comment.text = '[deleted]';
+ div.data('comment', comment);
+ },
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem deleting the comment.');
+ }
+ });
+ }
+
+ function showProposal(id) {
+ $('#sp' + id).hide();
+ $('#hp' + id).show();
+ $('#pr' + id).slideDown('fast');
+ }
+
+ function hideProposal(id) {
+ $('#hp' + id).hide();
+ $('#sp' + id).show();
+ $('#pr' + id).slideUp('fast');
+ }
+
+ function showProposeChange(id) {
+ $('#pc' + id).hide();
+ $('#hc' + id).show();
+ var textarea = $('#pt' + id);
+ textarea.val(textarea.data('source'));
+ $.fn.autogrow.resize(textarea[0]);
+ textarea.slideDown('fast');
+ }
+
+ function hideProposeChange(id) {
+ $('#hc' + id).hide();
+ $('#pc' + id).show();
+ var textarea = $('#pt' + id);
+ textarea.val('').removeAttr('disabled');
+ textarea.slideUp('fast');
+ }
+
+ function toggleCommentMarkupBox(id) {
+ $('#mb' + id).toggle();
+ }
+
+ /** Handle when the user clicks on a sort by link. */
+ function handleReSort(link) {
+ var classes = link.attr('class').split(/\s+/);
+ for (var i=0; i<classes.length; i++) {
+ if (classes[i] != 'sort-option') {
+ by = classes[i].substring(2);
+ }
+ }
+ setComparator();
+ // Save/update the sortBy cookie.
+ var expiration = new Date();
+ expiration.setDate(expiration.getDate() + 365);
+ document.cookie= 'sortBy=' + escape(by) +
+ ';expires=' + expiration.toUTCString();
+ $('ul.comment-ul').each(function(index, ul) {
+ var comments = getChildren($(ul), true);
+ comments = sortComments(comments);
+ appendComments(comments, $(ul).empty());
+ });
+ }
+
+ /**
+ * Function to process a vote when a user clicks an arrow.
+ */
+ function handleVote(link) {
+ if (!opts.voting) {
+ showError("You'll need to login to vote.");
+ return;
+ }
+
+ var id = link.attr('id');
+ if (!id) {
+ // Didn't click on one of the voting arrows.
+ return;
+ }
+ // If it is an unvote, the new vote value is 0,
+ // Otherwise it's 1 for an upvote, or -1 for a downvote.
+ var value = 0;
+ if (id.charAt(1) != 'u') {
+ value = id.charAt(0) == 'u' ? 1 : -1;
+ }
+ // The data to be sent to the server.
+ var d = {
+ comment_id: id.substring(2),
+ value: value
+ };
+
+ // Swap the vote and unvote links.
+ link.hide();
+ $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
+ .show();
+
+ // The div the comment is displayed in.
+ var div = $('div#cd' + d.comment_id);
+ var data = div.data('comment');
+
+ // If this is not an unvote, and the other vote arrow has
+ // already been pressed, unpress it.
+ if ((d.value !== 0) && (data.vote === d.value * -1)) {
+ $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
+ $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
+ }
+
+ // Update the comments rating in the local data.
+ data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
+ data.vote = d.value;
+ div.data('comment', data);
+
+ // Change the rating text.
+ div.find('.rating:first')
+ .text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));
+
+ // Send the vote information to the server.
+ $.ajax({
+ type: "POST",
+ url: opts.processVoteURL,
+ data: d,
+ error: function(request, textStatus, error) {
+ showError('Oops, there was a problem casting that vote.');
+ }
+ });
+ }
+
+ /**
+ * Open a reply form used to reply to an existing comment.
+ */
+ function openReply(id) {
+ // Swap out the reply link for the hide link
+ $('#rl' + id).hide();
+ $('#cr' + id).show();
+
+ // Add the reply li to the children ul.
+ var div = $(renderTemplate(replyTemplate, {id: id})).hide();
+ $('#cl' + id)
+ .prepend(div)
+ // Setup the submit handler for the reply form.
+ .find('#rf' + id)
+ .submit(function(event) {
+ event.preventDefault();
+ addComment($('#rf' + id));
+ closeReply(id);
+ })
+ .find('input[type=button]')
+ .click(function() {
+ closeReply(id);
+ });
+ div.slideDown('fast', function() {
+ $('#rf' + id).find('textarea').focus();
+ });
+ }
+
+ /**
+ * Close the reply form opened with openReply.
+ */
+ function closeReply(id) {
+ // Remove the reply div from the DOM.
+ $('#rd' + id).slideUp('fast', function() {
+ $(this).remove();
+ });
+
+ // Swap out the hide link for the reply link
+ $('#cr' + id).hide();
+ $('#rl' + id).show();
+ }
+
+ /**
+ * Recursively sort a tree of comments using the comp comparator.
+ */
+ function sortComments(comments) {
+ comments.sort(comp);
+ $.each(comments, function() {
+ this.children = sortComments(this.children);
+ });
+ return comments;
+ }
+
+ /**
+ * Get the children comments from a ul. If recursive is true,
+ * recursively include childrens' children.
+ */
+ function getChildren(ul, recursive) {
+ var children = [];
+ ul.children().children("[id^='cd']")
+ .each(function() {
+ var comment = $(this).data('comment');
+ if (recursive)
+ comment.children = getChildren($(this).find('#cl' + comment.id), true);
+ children.push(comment);
+ });
+ return children;
+ }
+
+ /** Create a div to display a comment in. */
+ function createCommentDiv(comment) {
+ if (!comment.displayed && !opts.moderator) {
+ return $('<div class="moderate">Thank you! Your comment will show up '
+ + 'once it is has been approved by a moderator.</div>');
+ }
+ // Prettify the comment rating.
+ comment.pretty_rating = comment.rating + ' point' +
+ (comment.rating == 1 ? '' : 's');
+ // Make a class (for displaying not yet moderated comments differently)
+ comment.css_class = comment.displayed ? '' : ' moderate';
+ // Create a div for this comment.
+ var context = $.extend({}, opts, comment);
+ var div = $(renderTemplate(commentTemplate, context));
+
+ // If the user has voted on this comment, highlight the correct arrow.
+ if (comment.vote) {
+ var direction = (comment.vote == 1) ? 'u' : 'd';
+ div.find('#' + direction + 'v' + comment.id).hide();
+ div.find('#' + direction + 'u' + comment.id).show();
+ }
+
+ if (opts.moderator || comment.text != '[deleted]') {
+ div.find('a.reply').show();
+ if (comment.proposal_diff)
+ div.find('#sp' + comment.id).show();
+ if (opts.moderator && !comment.displayed)
+ div.find('#cm' + comment.id).show();
+ if (opts.moderator || (opts.username == comment.username))
+ div.find('#dc' + comment.id).show();
+ }
+ return div;
+ }
+
+ /**
+ * A simple template renderer. Placeholders such as <%id%> are replaced
+ * by context['id'] with items being escaped. Placeholders such as <#id#>
+ * are not escaped.
+ */
+ function renderTemplate(template, context) {
+ var esc = $(document.createElement('div'));
+
+ function handle(ph, escape) {
+ var cur = context;
+ $.each(ph.split('.'), function() {
+ cur = cur[this];
+ });
+ return escape ? esc.text(cur || "").html() : cur;
+ }
+
+ return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
+ return handle(arguments[2], arguments[1] == '%' ? true : false);
+ });
+ }
+
+ /** Flash an error message briefly. */
+ function showError(message) {
+ $(document.createElement('div')).attr({'class': 'popup-error'})
+ .append($(document.createElement('div'))
+ .attr({'class': 'error-message'}).text(message))
+ .appendTo('body')
+ .fadeIn("slow")
+ .delay(2000)
+ .fadeOut("slow");
+ }
+
+ /** Add a link the user uses to open the comments popup. */
+ $.fn.comment = function() {
+ return this.each(function() {
+ var id = $(this).attr('id').substring(1);
+ var count = COMMENT_METADATA[id];
+ var title = count + ' comment' + (count == 1 ? '' : 's');
+ var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
+ var addcls = count == 0 ? ' nocomment' : '';
+ $(this)
+ .append(
+ $(document.createElement('a')).attr({
+ href: '#',
+ 'class': 'sphinx-comment-open' + addcls,
+ id: 'ao' + id
+ })
+ .append($(document.createElement('img')).attr({
+ src: image,
+ alt: 'comment',
+ title: title
+ }))
+ .click(function(event) {
+ event.preventDefault();
+ show($(this).attr('id').substring(2));
+ })
+ )
+ .append(
+ $(document.createElement('a')).attr({
+ href: '#',
+ 'class': 'sphinx-comment-close hidden',
+ id: 'ah' + id
+ })
+ .append($(document.createElement('img')).attr({
+ src: opts.closeCommentImage,
+ alt: 'close',
+ title: 'close'
+ }))
+ .click(function(event) {
+ event.preventDefault();
+ hide($(this).attr('id').substring(2));
+ })
+ );
+ });
+ };
+
+ var opts = {
+ processVoteURL: '/_process_vote',
+ addCommentURL: '/_add_comment',
+ getCommentsURL: '/_get_comments',
+ acceptCommentURL: '/_accept_comment',
+ deleteCommentURL: '/_delete_comment',
+ commentImage: '/static/_static/comment.png',
+ closeCommentImage: '/static/_static/comment-close.png',
+ loadingImage: '/static/_static/ajax-loader.gif',
+ commentBrightImage: '/static/_static/comment-bright.png',
+ upArrow: '/static/_static/up.png',
+ downArrow: '/static/_static/down.png',
+ upArrowPressed: '/static/_static/up-pressed.png',
+ downArrowPressed: '/static/_static/down-pressed.png',
+ voting: false,
+ moderator: false
+ };
+
+ if (typeof COMMENT_OPTIONS != "undefined") {
+ opts = jQuery.extend(opts, COMMENT_OPTIONS);
+ }
+
+ var popupTemplate = '\
+ <div class="sphinx-comments" id="sc<%id%>">\
+ <p class="sort-options">\
+ Sort by:\
+ <a href="#" class="sort-option byrating">best rated</a>\
+ <a href="#" class="sort-option byascage">newest</a>\
+ <a href="#" class="sort-option byage">oldest</a>\
+ </p>\
+ <div class="comment-header">Comments</div>\
+ <div class="comment-loading" id="cn<%id%>">\
+ loading comments... <img src="<%loadingImage%>" alt="" /></div>\
+ <ul id="cl<%id%>" class="comment-ul"></ul>\
+ <div id="ca<%id%>">\
+ <p class="add-a-comment">Add a comment\
+ (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
+ <div class="comment-markup-box" id="mb<%id%>">\
+ reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
+ <code>``code``</code>, \
+ code blocks: <code>::</code> and an indented block after blank line</div>\
+ <form method="post" id="cf<%id%>" class="comment-form" action="">\
+ <textarea name="comment" cols="80"></textarea>\
+ <p class="propose-button">\
+ <a href="#" id="pc<%id%>" class="show-propose-change">\
+ Propose a change ▹\
+ </a>\
+ <a href="#" id="hc<%id%>" class="hide-propose-change">\
+ Propose a change ▿\
+ </a>\
+ </p>\
+ <textarea name="proposal" id="pt<%id%>" cols="80"\
+ spellcheck="false"></textarea>\
+ <input type="submit" value="Add comment" />\
+ <input type="hidden" name="node" value="<%id%>" />\
+ <input type="hidden" name="parent" value="" />\
+ </form>\
+ </div>\
+ </div>';
+
+ var commentTemplate = '\
+ <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\
+ <div class="vote">\
+ <div class="arrow">\
+ <a href="#" id="uv<%id%>" class="vote" title="vote up">\
+ <img src="<%upArrow%>" />\
+ </a>\
+ <a href="#" id="uu<%id%>" class="un vote" title="vote up">\
+ <img src="<%upArrowPressed%>" />\
+ </a>\
+ </div>\
+ <div class="arrow">\
+ <a href="#" id="dv<%id%>" class="vote" title="vote down">\
+ <img src="<%downArrow%>" id="da<%id%>" />\
+ </a>\
+ <a href="#" id="du<%id%>" class="un vote" title="vote down">\
+ <img src="<%downArrowPressed%>" />\
+ </a>\
+ </div>\
+ </div>\
+ <div class="comment-content">\
+ <p class="tagline comment">\
+ <span class="user-id"><%username%></span>\
+ <span class="rating"><%pretty_rating%></span>\
+ <span class="delta"><%time.delta%></span>\
+ </p>\
+ <div class="comment-text comment"><#text#></div>\
+ <p class="comment-opts comment">\
+ <a href="#" class="reply hidden" id="rl<%id%>">reply ▹</a>\
+ <a href="#" class="close-reply" id="cr<%id%>">reply ▿</a>\
+ <a href="#" id="sp<%id%>" class="show-proposal">proposal ▹</a>\
+ <a href="#" id="hp<%id%>" class="hide-proposal">proposal ▿</a>\
+ <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\
+ <span id="cm<%id%>" class="moderation hidden">\
+ <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\
+ </span>\
+ </p>\
+ <pre class="proposal" id="pr<%id%>">\
+<#proposal_diff#>\
+ </pre>\
+ <ul class="comment-children" id="cl<%id%>"></ul>\
+ </div>\
+ <div class="clearleft"></div>\
+ </div>\
+ </div>';
+
+ var replyTemplate = '\
+ <li>\
+ <div class="reply-div" id="rd<%id%>">\
+ <form id="rf<%id%>">\
+ <textarea name="comment" cols="80"></textarea>\
+ <input type="submit" value="Add reply" />\
+ <input type="button" value="Cancel" />\
+ <input type="hidden" name="parent" value="<%id%>" />\
+ <input type="hidden" name="node" value="" />\
+ </form>\
+ </div>\
+ </li>';
+
+ $(document).ready(function() {
+ init();
+ });
+})(jQuery);
+
+$(document).ready(function() {
+ // add comment anchors for all paragraphs that are commentable
+ $('.sphinx-has-comment').comment();
+
+ // highlight search words in search results
+ $("div.context").each(function() {
+ var params = $.getQueryParameters();
+ var terms = (params.q) ? params.q[0].split(/\s+/) : [];
+ var result = $(this);
+ $.each(terms, function() {
+ result.highlightText(this.toLowerCase(), 'highlighted');
+ });
+ });
+
+ // directly open comment window if requested
+ var anchor = document.location.hash;
+ if (anchor.substring(0, 9) == '#comment-') {
+ $('#ao' + anchor.substring(9)).click();
+ document.location.hash = '#s' + anchor.substring(9);
+ }
+});
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Multiple blocks — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="multiple-blocks">
+<h1>Multiple blocks<a class="headerlink" href="#multiple-blocks" title="Permalink to this headline">¶</a></h1>
+<p>This example demonstrates the use of multiple interrelated <code class="docutils literal notranslate"><span class="pre">/*!re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code> blocks.
+We pick a deliberately simple task (parsing integers),
+so that all complexity is associated with relations between blocks and not with the lexical grammar.</p>
+<p><a class="reference download internal" href="../_downloads/04_parsing_integers_blocks.i.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[multiple_blocks.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><limits.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="k">template</span><span class="o"><</span><span class="kt">int</span> <span class="n">base</span><span class="o">></span>
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">adddgt</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">d</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">u</span> <span class="o">></span> <span class="p">(</span><span class="n">ULONG_MAX</span> <span class="o">-</span> <span class="n">d</span><span class="p">)</span> <span class="o">/</span> <span class="n">base</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="n">u</span> <span class="o">=</span> <span class="n">u</span> <span class="o">*</span> <span class="n">base</span> <span class="o">+</span> <span class="n">d</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCTXMARKER</span><span class="p">;</span>
+ <span class="n">u</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYCURSOR = s;</span>
+
+<span class="cm"> end = "\x00";</span>
+<span class="cm"> */</span>
+
+ <span class="cm">/*!re2c</span>
+<span class="cm"> * { return false; }</span>
+<span class="cm"> '0b' / [01] { goto bin; }</span>
+<span class="cm"> "0" { goto oct; }</span>
+<span class="cm"> "" / [1-9] { goto dec; }</span>
+<span class="cm"> '0x' / [0-9a-fA-F] { goto hex; }</span>
+<span class="cm"> */</span>
+
+<span class="nl">bin</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> * { return false; }</span>
+<span class="cm"> end { return true; }</span>
+<span class="cm"> [01] { if (!adddgt<2>(u, s[-1] - '0')) return false; goto bin; }</span>
+<span class="cm"> */</span>
+
+<span class="nl">oct</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> * { return false; }</span>
+<span class="cm"> end { return true; }</span>
+<span class="cm"> [0-7] { if (!adddgt<8>(u, s[-1] - '0')) return false; goto oct; }</span>
+<span class="cm"> */</span>
+
+<span class="nl">dec</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> * { return false; }</span>
+<span class="cm"> end { return true; }</span>
+<span class="cm"> [0-9] { if (!adddgt<10>(u, s[-1] - '0')) return false; goto dec; }</span>
+<span class="cm"> */</span>
+
+<span class="nl">hex</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> * { return false; }</span>
+<span class="cm"> end { return true; }</span>
+<span class="cm"> [0-9] { if (!adddgt<16>(u, s[-1] - '0')) return false; goto hex; }</span>
+<span class="cm"> [a-f] { if (!adddgt<16>(u, s[-1] - 'a' + 10)) return false; goto hex; }</span>
+<span class="cm"> [A-F] { if (!adddgt<16>(u, s[-1] - 'A' + 10)) return false; goto hex; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="n">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">argc</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">u</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">u</span><span class="p">))</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"%lu</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">u</span><span class="p">);</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Notes:</p>
+<ul class="simple">
+<li>Configurations and definitions (lines 20 - 26) are not scoped to a single re2c block — they are global.
+Each block may override configurations, but this affects the global scope.</li>
+<li>Blocks don’t have to be in the same function: they can be in separate functions or elsewhere
+as long as the exposed interface fits into the lexical scope.</li>
+</ul>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c -o multiple_blocks.cc multiple_blocks.re
+$ g++ -o multiple_blocks multiple_blocks.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./multiple_blocks <span class="m">0</span> <span class="m">12345678901234567890</span> 0xFFFFffffFFFFffff 0x1FFFFffffFFFFffff 0xAbcDEf 0x00 <span class="m">007</span> 0B0 0b110101010 <span class="s2">""</span>
+<span class="m">0</span>
+<span class="m">12345678901234567890</span>
+<span class="m">18446744073709551615</span>
+error
+<span class="m">11259375</span>
+<span class="m">0</span>
+<span class="m">7</span>
+<span class="m">0</span>
+<span class="m">426</span>
+error
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Conditions — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="conditions">
+<h1>Conditions<a class="headerlink" href="#conditions" title="Permalink to this headline">¶</a></h1>
+<p>This example demonstrates the use of conditions.
+It is similar in functionality to the <a class="reference external" href="example_04.html">Multiple blocks</a> example,
+except that individual sub-lexers are connected usding conditions rather than multiple blocks.
+Conditions allow to encode multiple interconnected lexers within a single re2c block.</p>
+<p><a class="reference download internal" href="../_downloads/05_parsing_integers_conditions.ci.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[conditions.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><limits.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="k">template</span><span class="o"><</span><span class="kt">int</span> <span class="n">base</span><span class="o">></span>
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">adddgt</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">int</span> <span class="n">d</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">u</span> <span class="o">></span> <span class="p">(</span><span class="n">ULONG_MAX</span> <span class="o">-</span> <span class="n">d</span><span class="p">)</span> <span class="o">/</span> <span class="n">base</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="n">u</span> <span class="o">=</span> <span class="n">u</span> <span class="o">*</span> <span class="n">base</span> <span class="o">+</span> <span class="n">d</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="cm">/*!types:re2c*/</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCTXMARKER</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">c</span> <span class="o">=</span> <span class="n">yycinit</span><span class="p">;</span>
+ <span class="n">u</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYCURSOR = s;</span>
+<span class="cm"> re2c:define:YYGETCONDITION = "c";</span>
+<span class="cm"> re2c:define:YYGETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:define:YYSETCONDITION = "c = @@;";</span>
+<span class="cm"> re2c:define:YYSETCONDITION:naked = 1;</span>
+
+<span class="cm"> <*> * { return false; }</span>
+
+<span class="cm"> <init> '0b' / [01] :=> bin</span>
+<span class="cm"> <init> "0" :=> oct</span>
+<span class="cm"> <init> "" / [1-9] :=> dec</span>
+<span class="cm"> <init> '0x' / [0-9a-fA-F] :=> hex</span>
+
+<span class="cm"> <bin, oct, dec, hex> "\x00" { return true; }</span>
+<span class="cm"> <bin> [01] { if (!adddgt<2>(u, s[-1] - '0')) return false; goto yyc_bin; }</span>
+<span class="cm"> <oct> [0-7] { if (!adddgt<8>(u, s[-1] - '0')) return false; goto yyc_oct; }</span>
+<span class="cm"> <dec> [0-9] { if (!adddgt<10>(u, s[-1] - '0')) return false; goto yyc_dec; }</span>
+<span class="cm"> <hex> [0-9] { if (!adddgt<16>(u, s[-1] - '0')) return false; goto yyc_hex; }</span>
+<span class="cm"> <hex> [a-f] { if (!adddgt<16>(u, s[-1] - 'a' + 10)) return false; goto yyc_hex; }</span>
+<span class="cm"> <hex> [A-F] { if (!adddgt<16>(u, s[-1] - 'A' + 10)) return false; goto yyc_hex; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="n">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">argc</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+ <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">u</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">u</span><span class="p">))</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"%lu</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">u</span><span class="p">);</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Notes:</p>
+<ul class="simple">
+<li>Conditions are enabled with the <code class="docutils literal notranslate"><span class="pre">-c</span></code> option.</li>
+<li>Conditions are only syntactic sugar; they can be translated into multiple blocks.</li>
+<li>Each condition is a standalone lexer (DFA).</li>
+<li>Each condition has a unique identifier: <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> tells re2c to generate
+an enumeration of all the identifiers (the names are prefixed with <code class="docutils literal notranslate"><span class="pre">yyc</span></code> by default).
+The lexer uses <code class="docutils literal notranslate"><span class="pre">YYGETCONDITION</span></code> to get the identifier of the current condition
+and <code class="docutils literal notranslate"><span class="pre">YYSETCONDITION</span></code> to set it.</li>
+<li>Each condition has a unique label (prefixed with <code class="docutils literal notranslate"><span class="pre">yyc_</span></code> by default).</li>
+<li>Conditions are connected: transitions are allowed between the final states of one condition
+and the start state of another condition (but not between inner states of different conditions).
+The generated code starts with dispatch.
+Actions can either jump to the initial dispatch or jump directly to a condition.</li>
+<li>The <code class="docutils literal notranslate"><span class="pre"><*></span></code> rule is merged to all conditions (low priority).</li>
+<li>Rules with multiple conditions are merged to each listed condition (normal priority).</li>
+<li><code class="docutils literal notranslate"><span class="pre">:=></span></code> jumps directly to the next condition (bypassing the initial dispatch).</li>
+</ul>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c -c -o conditions.cc conditions.re
+$ g++ -o conditions conditions.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./conditions <span class="m">0</span> <span class="m">12345678901234567890</span> 0xFFFFffffFFFFffff 0x1FFFFffffFFFFffff 0xAbcDEf 0x00 <span class="m">007</span> 0B0 0b110101010 <span class="s2">""</span>
+<span class="m">0</span>
+<span class="m">12345678901234567890</span>
+<span class="m">18446744073709551615</span>
+error
+<span class="m">11259375</span>
+<span class="m">0</span>
+<span class="m">7</span>
+<span class="m">0</span>
+<span class="m">426</span>
+error
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Braille patterns — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="braille-patterns">
+<h1>Braille patterns<a class="headerlink" href="#braille-patterns" title="Permalink to this headline">¶</a></h1>
+<p>This example is about encoding support in re2c.
+It’s a partial decoder from Grade-1 (uncontracted) Unicode English Braille to plain English.
+The input may be encoded in UTF-8, UTF-16, UTF-32, or UCS-2:
+all of these encodings are capable of representing Braille patterns (code points <code class="docutils literal notranslate"><span class="pre">[0x2800</span> <span class="pre">-</span> <span class="pre">0x28ff]</span></code>).
+We use the <code class="docutils literal notranslate"><span class="pre">-r</span></code> option to reuse the same block of re2c rules with different encodings.</p>
+<p>So. The hardest part is to get some input.
+Here is a message out of the void:</p>
+<p>⠠⠁⠇⠇⠀⠓⠥⠍⠁⠝⠀⠃⠑⠊⠝⠛⠎⠀⠁⠗⠑⠀⠃⠕⠗⠝⠀⠋⠗⠑⠑⠀⠁⠝⠙⠀⠑⠟⠥⠁⠇⠀⠊⠝⠀⠙⠊⠛⠝⠊⠞⠽⠀⠁⠝⠙⠀⠗⠊⠛⠓⠞⠎⠲⠀
+⠠⠞⠓⠑⠽⠀⠁⠗⠑⠀⠑⠝⠙⠕⠺⠑⠙⠀⠺⠊⠞⠓⠀⠗⠑⠁⠎⠕⠝⠀⠁⠝⠙⠀⠉⠕⠝⠎⠉⠊⠑⠝⠉⠑⠀⠁⠝⠙⠀⠎⠓⠕⠥⠇⠙⠀⠁⠉⠞⠀⠞⠕⠺⠁⠗⠙⠎⠀
+⠕⠝⠑⠀⠁⠝⠕⠞⠓⠑⠗⠀⠊⠝⠀⠁⠀⠎⠏⠊⠗⠊⠞⠀⠕⠋⠀⠃⠗⠕⠞⠓⠑⠗⠓⠕⠕⠙⠲</p>
+<p>It appears to be UTF-8 encoded <a class="reference download internal" href="../_downloads/06_braille.utf8.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[braille.utf8.txt]</span></code></a>.
+Let’s convert it into UTF-16, UTF-32, and UCS-2:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ iconv -f utf8 -t utf16le 06_braille.utf8.txt > 06_braille.utf16.txt
+$ iconv -f utf8 -t utf32le 06_braille.utf8.txt > 06_braille.utf32.txt
+$ iconv -f utf8 -t ucs2 06_braille.utf8.txt > 06_braille.ucs2.txt
+</pre></div>
+</div>
+<p>And the input is ready.</p>
+<p>Grade-1 Braille is quite simple (compared to Grade-2 Braille).
+Patterns map directly to symbols (letters, digits, and punctuators) except for a couple of special patterns:
+the numeric mode indicator (⠼), the letter mode indicator (⠰), the capital letter indicator (⠠)
+and some others, which we omit here for the sake of simplicity (as well as a few ambiguous punctuation patterns).
+Grade-2 Braille allows contractions; those obey some rather complex rules (like those of a natural language)
+and are much harder to implement.</p>
+<p><a class="reference download internal" href="../_downloads/06_braille.cr8i.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[braille.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><ctype.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="k">template</span><span class="o"><</span><span class="k">typename</span> <span class="n">char_t</span><span class="o">></span>
+<span class="k">struct</span> <span class="n">input_t</span> <span class="p">{</span>
+ <span class="kt">size_t</span> <span class="n">len</span><span class="p">;</span>
+ <span class="n">char_t</span> <span class="o">*</span><span class="n">str</span><span class="p">;</span>
+
+ <span class="n">input_t</span><span class="p">(</span><span class="kt">FILE</span> <span class="o">*</span><span class="n">f</span><span class="p">)</span> <span class="o">:</span> <span class="n">len</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span> <span class="n">str</span><span class="p">(</span><span class="nb">NULL</span><span class="p">)</span>
+ <span class="p">{</span>
+ <span class="n">fseek</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_END</span><span class="p">);</span>
+ <span class="n">len</span> <span class="o">=</span> <span class="n">ftell</span><span class="p">(</span><span class="n">f</span><span class="p">)</span> <span class="o">/</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">char_t</span><span class="p">);</span>
+ <span class="n">fseek</span><span class="p">(</span><span class="n">f</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_SET</span><span class="p">);</span>
+ <span class="n">str</span> <span class="o">=</span> <span class="k">new</span> <span class="n">char_t</span><span class="p">[</span><span class="n">len</span> <span class="o">+</span> <span class="mi">1</span><span class="p">];</span>
+ <span class="n">fread</span><span class="p">(</span><span class="n">str</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">char_t</span><span class="p">),</span> <span class="n">len</span><span class="p">,</span> <span class="n">f</span><span class="p">);</span>
+ <span class="n">str</span><span class="p">[</span><span class="n">len</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="o">~</span><span class="n">input_t</span><span class="p">()</span>
+ <span class="p">{</span>
+ <span class="k">delete</span><span class="p">[]</span><span class="n">str</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="p">};</span>
+
+<span class="k">typedef</span> <span class="n">input_t</span><span class="o"><</span><span class="kt">unsigned</span> <span class="kt">char</span><span class="o">></span> <span class="n">iutf8_t</span><span class="p">;</span>
+<span class="k">typedef</span> <span class="n">input_t</span><span class="o"><</span><span class="kt">unsigned</span> <span class="kt">short</span><span class="o">></span> <span class="n">iutf16_t</span><span class="p">;</span>
+<span class="k">typedef</span> <span class="n">input_t</span><span class="o"><</span><span class="kt">unsigned</span> <span class="kt">int</span><span class="o">></span> <span class="n">iutf32_t</span><span class="p">;</span>
+<span class="k">typedef</span> <span class="n">input_t</span><span class="o"><</span><span class="kt">unsigned</span> <span class="kt">short</span><span class="o">></span> <span class="n">iucs2_t</span><span class="p">;</span>
+
+<span class="k">struct</span> <span class="n">out_t</span> <span class="p">{</span>
+ <span class="kt">bool</span> <span class="n">caps</span><span class="p">;</span>
+
+ <span class="n">out_t</span><span class="p">()</span> <span class="o">:</span> <span class="n">caps</span><span class="p">(</span><span class="nb">false</span><span class="p">)</span> <span class="p">{}</span>
+ <span class="kt">void</span> <span class="n">prt</span><span class="p">(</span><span class="kt">char</span> <span class="n">c</span><span class="p">)</span>
+ <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"%c"</span><span class="p">,</span> <span class="n">caps</span> <span class="o">?</span> <span class="n">toupper</span><span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="o">:</span> <span class="n">c</span><span class="p">);</span>
+ <span class="n">caps</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="kt">void</span> <span class="n">err</span><span class="p">()</span>
+ <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" ... error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="p">}</span>
+<span class="p">};</span>
+
+<span class="cm">/*!rules:re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> // letters</span>
+<span class="cm"> l = "\u2830";</span>
+<span class="cm"> la = "\u2801"; lb = "\u2803"; lc = "\u2809"; ld = "\u2819"; le = "\u2811";</span>
+<span class="cm"> lf = "\u280b"; lg = "\u281b"; lh = "\u2813"; li = "\u280a"; lj = "\u281a";</span>
+<span class="cm"> lk = "\u2805"; ll = "\u2807"; lm = "\u280d"; ln = "\u281d"; lo = "\u2815";</span>
+<span class="cm"> lp = "\u280f"; lq = "\u281f"; lr = "\u2817"; ls = "\u280e"; lt = "\u281e";</span>
+<span class="cm"> lu = "\u2825"; lv = "\u2827"; lw = "\u283a"; lx = "\u282d"; ly = "\u283d";</span>
+<span class="cm"> lz = "\u2835";</span>
+
+<span class="cm"> // numbers</span>
+<span class="cm"> n = "\u283c";</span>
+<span class="cm"> n1 = "\u2801"; n2 = "\u2803"; n3 = "\u2809"; n4 = "\u2819"; n5 = "\u2811";</span>
+<span class="cm"> n6 = "\u280b"; n7 = "\u281b"; n8 = "\u2813"; n9 = "\u280a"; n0 = "\u281a";</span>
+
+<span class="cm"> // punctuation</span>
+<span class="cm"> pcom = "\u2802"; psem = "\u2806"; pcln = "\u2812";</span>
+<span class="cm"> pdot = "\u2832"; pxcl = "\u2816"; pqst = "\u2826";</span>
+<span class="cm"> past = "\u2814"; pdsh = "\u2804"; phyp = "\u2824";</span>
+
+<span class="cm"> // formatting</span>
+<span class="cm"> fcp = "\u2820"; fsp = "\u2800" | "\x20"; fnl = "\n" | "\n\r";</span>
+
+<span class="cm"> <*> * { out.err(); return; }</span>
+<span class="cm"> <*> "\x00" { if (YYCURSOR != in.str + in.len + 1) out.err(); return; }</span>
+
+<span class="cm"> <*> l :=> l</span>
+<span class="cm"> <l> la { out.prt('a'); goto yyc_l; }</span>
+<span class="cm"> <l> lb { out.prt('b'); goto yyc_l; }</span>
+<span class="cm"> <l> lc { out.prt('c'); goto yyc_l; }</span>
+<span class="cm"> <l> ld { out.prt('d'); goto yyc_l; }</span>
+<span class="cm"> <l> le { out.prt('e'); goto yyc_l; }</span>
+<span class="cm"> <l> lf { out.prt('f'); goto yyc_l; }</span>
+<span class="cm"> <l> lg { out.prt('g'); goto yyc_l; }</span>
+<span class="cm"> <l> lh { out.prt('h'); goto yyc_l; }</span>
+<span class="cm"> <l> li { out.prt('i'); goto yyc_l; }</span>
+<span class="cm"> <l> lj { out.prt('j'); goto yyc_l; }</span>
+<span class="cm"> <l> lk { out.prt('k'); goto yyc_l; }</span>
+<span class="cm"> <l> ll { out.prt('l'); goto yyc_l; }</span>
+<span class="cm"> <l> lm { out.prt('m'); goto yyc_l; }</span>
+<span class="cm"> <l> ln { out.prt('n'); goto yyc_l; }</span>
+<span class="cm"> <l> lo { out.prt('o'); goto yyc_l; }</span>
+<span class="cm"> <l> lp { out.prt('p'); goto yyc_l; }</span>
+<span class="cm"> <l> lq { out.prt('q'); goto yyc_l; }</span>
+<span class="cm"> <l> lr { out.prt('r'); goto yyc_l; }</span>
+<span class="cm"> <l> ls { out.prt('s'); goto yyc_l; }</span>
+<span class="cm"> <l> lt { out.prt('t'); goto yyc_l; }</span>
+<span class="cm"> <l> lu { out.prt('u'); goto yyc_l; }</span>
+<span class="cm"> <l> lv { out.prt('v'); goto yyc_l; }</span>
+<span class="cm"> <l> lw { out.prt('w'); goto yyc_l; }</span>
+<span class="cm"> <l> lx { out.prt('x'); goto yyc_l; }</span>
+<span class="cm"> <l> ly { out.prt('y'); goto yyc_l; }</span>
+<span class="cm"> <l> lz { out.prt('z'); goto yyc_l; }</span>
+
+<span class="cm"> <*> n :=> n</span>
+<span class="cm"> <n> n1 { out.prt('1'); goto yyc_n; }</span>
+<span class="cm"> <n> n2 { out.prt('2'); goto yyc_n; }</span>
+<span class="cm"> <n> n3 { out.prt('3'); goto yyc_n; }</span>
+<span class="cm"> <n> n4 { out.prt('4'); goto yyc_n; }</span>
+<span class="cm"> <n> n5 { out.prt('5'); goto yyc_n; }</span>
+<span class="cm"> <n> n6 { out.prt('6'); goto yyc_n; }</span>
+<span class="cm"> <n> n7 { out.prt('7'); goto yyc_n; }</span>
+<span class="cm"> <n> n8 { out.prt('8'); goto yyc_n; }</span>
+<span class="cm"> <n> n9 { out.prt('9'); goto yyc_n; }</span>
+<span class="cm"> <n> n0 { out.prt('0'); goto yyc_n; }</span>
+
+<span class="cm"> <*> pcom { out.prt(','); goto yyc_l; }</span>
+<span class="cm"> <*> psem { out.prt(';'); goto yyc_l; }</span>
+<span class="cm"> <*> pcln { out.prt(':'); goto yyc_l; }</span>
+<span class="cm"> <*> pdot { out.prt('.'); goto yyc_l; }</span>
+<span class="cm"> <*> pxcl { out.prt('!'); goto yyc_l; }</span>
+<span class="cm"> <*> pqst { out.prt('?'); goto yyc_l; }</span>
+<span class="cm"> <*> past { out.prt('*'); goto yyc_l; }</span>
+<span class="cm"> <*> pdsh { out.prt('\''); goto yyc_l; }</span>
+<span class="cm"> <*> phyp { out.prt('-'); goto yyc_l; }</span>
+
+<span class="cm"> <*> fcp { out.caps = true; goto yyc_l; }</span>
+<span class="cm"> <*> fsp { out.prt(' '); goto yyc_l; }</span>
+<span class="cm"> <*> fnl { out.prt('\n'); goto yyc_l; }</span>
+<span class="cm">*/</span>
+
+<span class="cm">/*!types:re2c*/</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">lex_utf8</span><span class="p">(</span><span class="k">const</span> <span class="n">iutf8_t</span> <span class="o">&</span> <span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">in</span><span class="p">.</span><span class="n">str</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">c</span> <span class="o">=</span> <span class="n">yycl</span><span class="p">;</span>
+ <span class="n">out_t</span> <span class="n">out</span><span class="p">;</span>
+ <span class="cm">/*!use:re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = "unsigned char";</span>
+<span class="cm"> re2c:define:YYGETCONDITION = "c";</span>
+<span class="cm"> re2c:define:YYGETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:define:YYSETCONDITION = "c = @@;";</span>
+<span class="cm"> re2c:define:YYSETCONDITION:naked = 1;</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">lex_utf16</span><span class="p">(</span><span class="k">const</span> <span class="n">iutf16_t</span> <span class="o">&</span> <span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">in</span><span class="p">.</span><span class="n">str</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">c</span> <span class="o">=</span> <span class="n">yycl</span><span class="p">;</span>
+ <span class="n">out_t</span> <span class="n">out</span><span class="p">;</span>
+ <span class="cm">/*!use:re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = "unsigned int";</span>
+<span class="cm"> re2c:define:YYGETCONDITION = "c";</span>
+<span class="cm"> re2c:define:YYGETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:define:YYSETCONDITION = "c = @@;";</span>
+<span class="cm"> re2c:define:YYSETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:flags:8 = 0;</span>
+<span class="cm"> re2c:flags:x = 1;</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">lex_utf32</span><span class="p">(</span><span class="k">const</span> <span class="n">iutf32_t</span> <span class="o">&</span> <span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">int</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">in</span><span class="p">.</span><span class="n">str</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">c</span> <span class="o">=</span> <span class="n">yycl</span><span class="p">;</span>
+ <span class="n">out_t</span> <span class="n">out</span><span class="p">;</span>
+ <span class="cm">/*!use:re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = "unsigned int";</span>
+<span class="cm"> re2c:define:YYGETCONDITION = "c";</span>
+<span class="cm"> re2c:define:YYGETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:define:YYSETCONDITION = "c = @@;";</span>
+<span class="cm"> re2c:define:YYSETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:flags:x = 0;</span>
+<span class="cm"> re2c:flags:u = 1;</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">lex_ucs2</span><span class="p">(</span><span class="k">const</span> <span class="n">iucs2_t</span> <span class="o">&</span> <span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">short</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">in</span><span class="p">.</span><span class="n">str</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">c</span> <span class="o">=</span> <span class="n">yycl</span><span class="p">;</span>
+ <span class="n">out_t</span> <span class="n">out</span><span class="p">;</span>
+ <span class="cm">/*!use:re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = "unsigned int";</span>
+<span class="cm"> re2c:define:YYGETCONDITION = "c";</span>
+<span class="cm"> re2c:define:YYGETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:define:YYSETCONDITION = "c = @@;";</span>
+<span class="cm"> re2c:define:YYSETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:flags:u = 0;</span>
+<span class="cm"> re2c:flags:w = 1;</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">f</span><span class="p">;</span>
+
+ <span class="n">f</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="s">"06_braille.utf8.txt"</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">f</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"utf8:</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="n">iutf8_t</span> <span class="n">in</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="n">lex_utf8</span><span class="p">(</span><span class="n">in</span><span class="p">);</span>
+ <span class="n">fclose</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="n">f</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="s">"06_braille.utf16.txt"</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">f</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"utf16:</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="n">iutf16_t</span> <span class="n">in</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="n">lex_utf16</span><span class="p">(</span><span class="n">in</span><span class="p">);</span>
+ <span class="n">fclose</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="n">f</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="s">"06_braille.utf32.txt"</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">f</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"utf32:</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="n">iutf32_t</span> <span class="n">in</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="n">lex_utf32</span><span class="p">(</span><span class="n">in</span><span class="p">);</span>
+ <span class="n">fclose</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="n">f</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="s">"06_braille.ucs2.txt"</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">f</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"ucs2:</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="n">iucs2_t</span> <span class="n">in</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="n">lex_ucs2</span><span class="p">(</span><span class="n">in</span><span class="p">);</span>
+ <span class="n">fclose</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Notes:</p>
+<ul class="simple">
+<li>The reuse mode is enabled with the <code class="docutils literal notranslate"><span class="pre">-r</span></code> option.</li>
+<li>In the reuse mode, re2c expects a single <code class="docutils literal notranslate"><span class="pre">/*!rules:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code> block
+followed by multiple <code class="docutils literal notranslate"><span class="pre">/*!use:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code> blocks.
+All blocks can have their own configurations, definitions, and rules.</li>
+<li>Encoding can be enabled either with a command-line option or a configuration.</li>
+<li>Each encoding needs the appropriate code unit type (<code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code>).</li>
+<li>We use conditions to switch between numeric and normal modes.</li>
+</ul>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c -cr8 -o braille.cc braille.re
+$ g++ -o braille braille.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./braille
+utf8:
+All human beings are born free and equal in dignity and rights.
+They are endowed with reason and conscience and should act towards
+one another in a spirit of brotherhood.
+
+utf16:
+All human beings are born free and equal in dignity and rights.
+They are endowed with reason and conscience and should act towards
+one another in a spirit of brotherhood.
+
+utf32:
+All human beings are born free and equal in dignity and rights.
+They are endowed with reason and conscience and should act towards
+one another in a spirit of brotherhood.
+
+ucs2:
+All human beings are born free and equal in dignity and rights.
+They are endowed with reason and conscience and should act towards
+one another in a spirit of brotherhood.
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>C++98 lexer — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="c-98-lexer">
+<h1>C++98 lexer<a class="headerlink" href="#c-98-lexer" title="Permalink to this headline">¶</a></h1>
+<p>This is an example of a big, real-world re2c program: a C++98 lexer.
+It conforms to the C++98 standard (except for a couple of hacks that simulate the preprocessor).
+All nontrivial lexemes (integers, floating-point constants, strings, and character literals)
+are parsed (not only recognized): numeric literals are converted to numbers, and strings are unescaped.
+Some additional checks described in the standard (e.g., overflows in integer literals) are also done.
+In fact, C++ is an easy language to lex: unlike in many other languages, the C++98 lexer can proceed without feedback from the parser.</p>
+<p><a class="reference download internal" href="../_downloads/07_cxx98.i.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[cxx98.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><float.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><limits.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="cm">/*!max:re2c*/</span>
+<span class="k">static</span> <span class="k">const</span> <span class="kt">size_t</span> <span class="n">SIZE</span> <span class="o">=</span> <span class="mi">64</span> <span class="o">*</span> <span class="mi">1024</span><span class="p">;</span>
+
+<span class="k">struct</span> <span class="n">input_t</span> <span class="p">{</span>
+ <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">buf</span><span class="p">[</span><span class="n">SIZE</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">];</span>
+ <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">lim</span><span class="p">;</span>
+ <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">cur</span><span class="p">;</span>
+ <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">mar</span><span class="p">;</span>
+ <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">tok</span><span class="p">;</span>
+ <span class="kt">bool</span> <span class="n">eof</span><span class="p">;</span>
+
+ <span class="kt">FILE</span> <span class="o">*</span><span class="k">const</span> <span class="n">file</span><span class="p">;</span>
+
+ <span class="n">input_t</span><span class="p">(</span><span class="kt">FILE</span> <span class="o">*</span><span class="n">f</span><span class="p">)</span>
+ <span class="o">:</span> <span class="n">buf</span><span class="p">()</span>
+ <span class="p">,</span> <span class="n">lim</span><span class="p">(</span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">)</span>
+ <span class="p">,</span> <span class="n">cur</span><span class="p">(</span><span class="n">lim</span><span class="p">)</span>
+ <span class="p">,</span> <span class="n">mar</span><span class="p">(</span><span class="n">lim</span><span class="p">)</span>
+ <span class="p">,</span> <span class="n">tok</span><span class="p">(</span><span class="n">lim</span><span class="p">)</span>
+ <span class="p">,</span> <span class="n">eof</span><span class="p">(</span><span class="nb">false</span><span class="p">)</span>
+ <span class="p">,</span> <span class="n">file</span><span class="p">(</span><span class="n">f</span><span class="p">)</span>
+ <span class="p">{}</span>
+ <span class="kt">bool</span> <span class="n">fill</span><span class="p">(</span><span class="kt">size_t</span> <span class="n">need</span><span class="p">)</span>
+ <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">eof</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">free</span> <span class="o">=</span> <span class="n">tok</span> <span class="o">-</span> <span class="n">buf</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">free</span> <span class="o"><</span> <span class="n">need</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="n">memmove</span><span class="p">(</span><span class="n">buf</span><span class="p">,</span> <span class="n">tok</span><span class="p">,</span> <span class="n">lim</span> <span class="o">-</span> <span class="n">tok</span><span class="p">);</span>
+ <span class="n">lim</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">cur</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">mar</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">tok</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">lim</span> <span class="o">+=</span> <span class="n">fread</span><span class="p">(</span><span class="n">lim</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">free</span><span class="p">,</span> <span class="n">file</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">lim</span> <span class="o"><</span> <span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">eof</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
+ <span class="n">memset</span><span class="p">(</span><span class="n">lim</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+ <span class="n">lim</span> <span class="o">+=</span> <span class="n">YYMAXFILL</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="p">};</span>
+
+<span class="cm">/*!re2c re2c:define:YYCTYPE = "unsigned char"; */</span>
+
+<span class="k">template</span><span class="o"><</span><span class="kt">int</span> <span class="n">base</span><span class="o">></span>
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">adddgt</span><span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">d</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">u</span> <span class="o">></span> <span class="p">(</span><span class="n">ULONG_MAX</span> <span class="o">-</span> <span class="n">d</span><span class="p">)</span> <span class="o">/</span> <span class="n">base</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="n">u</span> <span class="o">=</span> <span class="n">u</span> <span class="o">*</span> <span class="n">base</span> <span class="o">+</span> <span class="n">d</span><span class="p">;</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex_oct</span><span class="p">(</span><span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">e</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="n">u</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="o">++</span><span class="n">s</span><span class="p">;</span> <span class="n">s</span> <span class="o"><</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">s</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">adddgt</span><span class="o"><</span><span class="mi">8</span><span class="o">></span><span class="p">(</span><span class="n">u</span><span class="p">,</span> <span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mh">0x30u</span><span class="p">))</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex_dec</span><span class="p">(</span><span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">e</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="n">u</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">s</span> <span class="o"><</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">s</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">adddgt</span><span class="o"><</span><span class="mi">10</span><span class="o">></span><span class="p">(</span><span class="n">u</span><span class="p">,</span> <span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="mh">0x30u</span><span class="p">))</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="nb">false</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex_hex</span><span class="p">(</span><span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">e</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">long</span> <span class="o">&</span><span class="n">u</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="n">u</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">s</span> <span class="o">+=</span> <span class="mi">2</span><span class="p">;</span> <span class="n">s</span> <span class="o"><</span> <span class="n">e</span><span class="p">;)</span> <span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:define:YYCURSOR = s;</span>
+<span class="cm"> * { if (!adddgt<16>(u, s[-1] - 0x30u)) return false; continue; }</span>
+<span class="cm"> [a-f] { if (!adddgt<16>(u, s[-1] - 0x61u + 10)) return false; continue; }</span>
+<span class="cm"> [A-F] { if (!adddgt<16>(u, s[-1] - 0x41u + 10)) return false; continue; }</span>
+<span class="cm"> */</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex_str</span><span class="p">(</span><span class="n">input_t</span> <span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">q</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"%c"</span><span class="p">,</span> <span class="n">q</span><span class="p">);</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">u</span> <span class="o">=</span> <span class="n">q</span><span class="p">;;</span> <span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\\</span><span class="s">x%lx"</span><span class="p">,</span> <span class="n">u</span><span class="p">))</span> <span class="p">{</span>
+ <span class="n">in</span><span class="p">.</span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="p">.</span><span class="n">cur</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCURSOR = in.cur;</span>
+<span class="cm"> re2c:define:YYMARKER = in.mar;</span>
+<span class="cm"> re2c:define:YYLIMIT = in.lim;</span>
+<span class="cm"> re2c:yyfill:enable = 1;</span>
+<span class="cm"> re2c:define:YYFILL = "if (!in.fill(@@)) return false;";</span>
+<span class="cm"> re2c:define:YYFILL:naked = 1;</span>
+<span class="cm"> * { return false; }</span>
+<span class="cm"> [^\n\\] { u = in.tok[0]; if (u == q) break; continue; }</span>
+<span class="cm"> "\\a" { u = '\a'; continue; }</span>
+<span class="cm"> "\\b" { u = '\b'; continue; }</span>
+<span class="cm"> "\\f" { u = '\f'; continue; }</span>
+<span class="cm"> "\\n" { u = '\n'; continue; }</span>
+<span class="cm"> "\\r" { u = '\r'; continue; }</span>
+<span class="cm"> "\\t" { u = '\t'; continue; }</span>
+<span class="cm"> "\\v" { u = '\v'; continue; }</span>
+<span class="cm"> "\\\\" { u = '\\'; continue; }</span>
+<span class="cm"> "\\'" { u = '\''; continue; }</span>
+<span class="cm"> "\\\"" { u = '"'; continue; }</span>
+<span class="cm"> "\\?" { u = '?'; continue; }</span>
+<span class="cm"> "\\" [0-7]{1,3} { lex_oct(in.tok, in.cur, u); continue; }</span>
+<span class="cm"> "\\u" [0-9a-fA-F]{4} { lex_hex(in.tok, in.cur, u); continue; }</span>
+<span class="cm"> "\\U" [0-9a-fA-F]{8} { lex_hex(in.tok, in.cur, u); continue; }</span>
+<span class="cm"> "\\x" [0-9a-fA-F]+ { if (!lex_hex(in.tok, in.cur, u)) return false; continue; }</span>
+<span class="cm"> */</span>
+ <span class="p">}</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"%c"</span><span class="p">,</span> <span class="n">q</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex_flt</span><span class="p">(</span><span class="k">const</span> <span class="kt">unsigned</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">double</span> <span class="n">d</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="kt">double</span> <span class="n">x</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">e</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:define:YYCURSOR = s;</span>
+<span class="cm"> */</span>
+<span class="nl">mant_int</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> "." { goto mant_frac; }</span>
+<span class="cm"> [eE] { goto exp_sign; }</span>
+<span class="cm"> * { d = (d * 10) + (s[-1] - '0'); goto mant_int; }</span>
+<span class="cm"> */</span>
+<span class="nl">mant_frac</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> "" { goto sfx; }</span>
+<span class="cm"> [eE] { goto exp_sign; }</span>
+<span class="cm"> [0-9] { d += (x /= 10) * (s[-1] - '0'); goto mant_frac; }</span>
+<span class="cm"> */</span>
+<span class="nl">exp_sign</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> "+"? { x = 1e+1; goto exp; }</span>
+<span class="cm"> "-" { x = 1e-1; goto exp; }</span>
+<span class="cm"> */</span>
+<span class="nl">exp</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> "" { for (; e > 0; --e) d *= x; goto sfx; }</span>
+<span class="cm"> [0-9] { e = (e * 10) + (s[-1] - '0'); goto exp; }</span>
+<span class="cm"> */</span>
+<span class="nl">sfx</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> * { goto end; }</span>
+<span class="cm"> [fF] { if (d > FLT_MAX) return false; goto end; }</span>
+<span class="cm"> */</span>
+<span class="nl">end</span><span class="p">:</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"%g"</span><span class="p">,</span> <span class="n">d</span><span class="p">);</span>
+ <span class="k">return</span> <span class="nb">true</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">bool</span> <span class="n">lex</span><span class="p">(</span><span class="n">input_t</span> <span class="o">&</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">unsigned</span> <span class="kt">long</span> <span class="n">u</span><span class="p">;</span>
+ <span class="k">for</span> <span class="p">(;;)</span> <span class="p">{</span>
+ <span class="n">in</span><span class="p">.</span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="p">.</span><span class="n">cur</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCURSOR = in.cur;</span>
+<span class="cm"> re2c:define:YYMARKER = in.mar;</span>
+<span class="cm"> re2c:define:YYLIMIT = in.lim;</span>
+<span class="cm"> re2c:yyfill:enable = 1;</span>
+<span class="cm"> re2c:define:YYFILL = "if (!in.fill(@@)) return false;";</span>
+<span class="cm"> re2c:define:YYFILL:naked = 1;</span>
+
+<span class="cm"> end = "\x00";</span>
+
+<span class="cm"> * { return false; }</span>
+<span class="cm"> end { return in.lim - in.tok == YYMAXFILL; }</span>
+
+<span class="cm"> // macros</span>
+<span class="cm"> macro = ("#" | "%:") ([^\n] | "\\\n")* "\n";</span>
+<span class="cm"> macro { continue; }</span>
+
+<span class="cm"> // whitespaces</span>
+<span class="cm"> mcm = "/*" ([^*] | ("*" [^/]))* "*""/";</span>
+<span class="cm"> scm = "//" [^\n]* "\n";</span>
+<span class="cm"> wsp = ([ \t\v\n\r] | scm | mcm)+;</span>
+<span class="cm"> wsp { printf(" "); continue; }</span>
+
+<span class="cm"> // character and string literals</span>
+<span class="cm"> "L"? ['"] { if (!lex_str(in, in.cur[-1])) return false; continue; }</span>
+<span class="cm"> "L"? "''" { return false; }</span>
+
+<span class="cm"> // integer literals</span>
+<span class="cm"> oct = "0" [0-7]*;</span>
+<span class="cm"> dec = [1-9][0-9]*;</span>
+<span class="cm"> hex = '0x' [0-9a-fA-F]+;</span>
+<span class="cm"> oct { if (!lex_oct(in.tok, in.cur, u)) return false; goto sfx; }</span>
+<span class="cm"> dec { if (!lex_dec(in.tok, in.cur, u)) return false; goto sfx; }</span>
+<span class="cm"> hex { if (!lex_hex(in.tok, in.cur, u)) return false; goto sfx; }</span>
+
+<span class="cm"> // floating literals</span>
+<span class="cm"> frc = [0-9]* "." [0-9]+ | [0-9]+ ".";</span>
+<span class="cm"> exp = 'e' [+-]? [0-9]+;</span>
+<span class="cm"> flt = (frc exp? | [0-9]+ exp) [fFlL]?;</span>
+<span class="cm"> flt { if (lex_flt(in.tok)) continue; return false; }</span>
+
+<span class="cm"> // boolean literals</span>
+<span class="cm"> "false" { printf("false"); continue; }</span>
+<span class="cm"> "true" { printf("true"); continue; }</span>
+
+<span class="cm"> // keywords</span>
+<span class="cm"> "asm" { printf("ASM"); continue; }</span>
+<span class="cm"> "auto" { printf("AUTO"); continue; }</span>
+<span class="cm"> "bool" { printf("BOOL"); continue; }</span>
+<span class="cm"> "break" { printf("BREAK"); continue; }</span>
+<span class="cm"> "case" { printf("CASE"); continue; }</span>
+<span class="cm"> "catch" { printf("CATCH"); continue; }</span>
+<span class="cm"> "char" { printf("CHAR"); continue; }</span>
+<span class="cm"> "class" { printf("CLASS"); continue; }</span>
+<span class="cm"> "const" { printf("CONST"); continue; }</span>
+<span class="cm"> "const_cast" { printf("CONST_CAST"); continue; }</span>
+<span class="cm"> "continue" { printf("CONTINUE"); continue; }</span>
+<span class="cm"> "default" { printf("DEFAULT"); continue; }</span>
+<span class="cm"> "do" { printf("DO"); continue; }</span>
+<span class="cm"> "double" { printf("DOUBLE"); continue; }</span>
+<span class="cm"> "dynamic_cast" { printf("DYNAMIC_CAST"); continue; }</span>
+<span class="cm"> "else" { printf("ELSE"); continue; }</span>
+<span class="cm"> "enum" { printf("ENUM"); continue; }</span>
+<span class="cm"> "explicit" { printf("EXPLICIT"); continue; }</span>
+<span class="cm"> "export" { printf("EXPORT"); continue; }</span>
+<span class="cm"> "extern" { printf("EXTERN"); continue; }</span>
+<span class="cm"> "float" { printf("FLOAT"); continue; }</span>
+<span class="cm"> "for" { printf("FOR"); continue; }</span>
+<span class="cm"> "friend" { printf("FRIEND"); continue; }</span>
+<span class="cm"> "goto" { printf("GOTO"); continue; }</span>
+<span class="cm"> "if" { printf("IF"); continue; }</span>
+<span class="cm"> "inline" { printf("INLINE"); continue; }</span>
+<span class="cm"> "int" { printf("INT"); continue; }</span>
+<span class="cm"> "long" { printf("LONG"); continue; }</span>
+<span class="cm"> "mutable" { printf("MUTABLE"); continue; }</span>
+<span class="cm"> "namespace" { printf("NAMESPACE"); continue; }</span>
+<span class="cm"> "operator" { printf("OPERATOR"); continue; }</span>
+<span class="cm"> "private" { printf("PRIVATE"); continue; }</span>
+<span class="cm"> "protected" { printf("PROTECTED"); continue; }</span>
+<span class="cm"> "public" { printf("PUBLIC"); continue; }</span>
+<span class="cm"> "register" { printf("REGISTER"); continue; }</span>
+<span class="cm"> "reinterpret_cast" { printf("REINTERPRET_CAST"); continue; }</span>
+<span class="cm"> "return" { printf("RETURN"); continue; }</span>
+<span class="cm"> "short" { printf("SHORT"); continue; }</span>
+<span class="cm"> "signed" { printf("SIGNED"); continue; }</span>
+<span class="cm"> "sizeof" { printf("SIZEOF"); continue; }</span>
+<span class="cm"> "static" { printf("STATIC"); continue; }</span>
+<span class="cm"> "static_cast" { printf("STATIC_CAST"); continue; }</span>
+<span class="cm"> "struct" { printf("STRUCT"); continue; }</span>
+<span class="cm"> "switch" { printf("SWITCH"); continue; }</span>
+<span class="cm"> "template" { printf("TEMPLATE"); continue; }</span>
+<span class="cm"> "this" { printf("THIS"); continue; }</span>
+<span class="cm"> "throw" { printf("THROW"); continue; }</span>
+<span class="cm"> "try" { printf("TRY"); continue; }</span>
+<span class="cm"> "typedef" { printf("TYPEDEF"); continue; }</span>
+<span class="cm"> "typeid" { printf("TYPEID"); continue; }</span>
+<span class="cm"> "typename" { printf("TYPENAME"); continue; }</span>
+<span class="cm"> "union" { printf("UNION"); continue; }</span>
+<span class="cm"> "unsigned" { printf("UNSIGNED"); continue; }</span>
+<span class="cm"> "using" { printf("USING"); continue; }</span>
+<span class="cm"> "virtual" { printf("VIRTUAL"); continue; }</span>
+<span class="cm"> "void" { printf("VOID"); continue; }</span>
+<span class="cm"> "volatile" { printf("VOLATILE"); continue; }</span>
+<span class="cm"> "wchar_t" { printf("WCHAR_T"); continue; }</span>
+<span class="cm"> "while" { printf("WHILE"); continue; }</span>
+
+<span class="cm"> // operators and punctuation (including preprocessor)</span>
+<span class="cm"> ("{" | "<%") { printf("{"); continue; }</span>
+<span class="cm"> ("}" | "%>") { printf("}"); continue; }</span>
+<span class="cm"> ("[" | "<:") { printf("["); continue; }</span>
+<span class="cm"> ("]" | ":>") { printf("]"); continue; }</span>
+<span class="cm"> "(" { printf("("); continue; }</span>
+<span class="cm"> ")" { printf(")"); continue; }</span>
+<span class="cm"> ";" { printf(";"); continue; }</span>
+<span class="cm"> ":" { printf(":"); continue; }</span>
+<span class="cm"> "..." { printf("..."); continue; }</span>
+<span class="cm"> "new" { printf("new"); continue; }</span>
+<span class="cm"> "delete" { printf("delete"); continue; }</span>
+<span class="cm"> "?" { printf("?"); continue; }</span>
+<span class="cm"> "::" { printf("::"); continue; }</span>
+<span class="cm"> "." { printf("."); continue; }</span>
+<span class="cm"> ".*" { printf("."); continue; }</span>
+<span class="cm"> "+" { printf("+"); continue; }</span>
+<span class="cm"> "-" { printf("-"); continue; }</span>
+<span class="cm"> "*" { printf("*"); continue; }</span>
+<span class="cm"> "/" { printf("/"); continue; }</span>
+<span class="cm"> "%" { printf("%%"); continue; }</span>
+<span class="cm"> ("^" | "xor") { printf("^"); continue; }</span>
+<span class="cm"> ("&" | "bitand") { printf("&"); continue; }</span>
+<span class="cm"> ("|" | "bitor") { printf("|"); continue; }</span>
+<span class="cm"> ("~" | "compl") { printf("~"); continue; }</span>
+<span class="cm"> ("!" | "not") { printf("!"); continue; }</span>
+<span class="cm"> "=" { printf("="); continue; }</span>
+<span class="cm"> "<" { printf("<"); continue; }</span>
+<span class="cm"> ">" { printf(">"); continue; }</span>
+<span class="cm"> "+=" { printf("+="); continue; }</span>
+<span class="cm"> "-=" { printf("-="); continue; }</span>
+<span class="cm"> "*=" { printf("*="); continue; }</span>
+<span class="cm"> "/=" { printf("/="); continue; }</span>
+<span class="cm"> "%=" { printf("%%="); continue; }</span>
+<span class="cm"> ("^=" | "xor_eq") { printf("^="); continue; }</span>
+<span class="cm"> ("&=" | "and_eq") { printf("&="); continue; }</span>
+<span class="cm"> ("|=" | "or_eq") { printf("|="); continue; }</span>
+<span class="cm"> "<<" { printf("<<"); continue; }</span>
+<span class="cm"> ">>" { printf(">>"); continue; }</span>
+<span class="cm"> ">>=" { printf(">>="); continue; }</span>
+<span class="cm"> "<<=" { printf("<<="); continue; }</span>
+<span class="cm"> "==" { printf("=="); continue; }</span>
+<span class="cm"> ("!=" | "not_eq") { printf("!="); continue; }</span>
+<span class="cm"> "<=" { printf("<="); continue; }</span>
+<span class="cm"> ">=" { printf(">="); continue; }</span>
+<span class="cm"> ("&&" | "and") { printf("&&"); continue; }</span>
+<span class="cm"> ("||" | "or") { printf("||"); continue; }</span>
+<span class="cm"> "++" { printf("++"); continue; }</span>
+<span class="cm"> "--" { printf("--"); continue; }</span>
+<span class="cm"> "," { printf(","); continue; }</span>
+<span class="cm"> "->*" { printf("->*"); continue; }</span>
+<span class="cm"> "->" { printf("->"); continue; }</span>
+
+<span class="cm"> // identifiers</span>
+<span class="cm"> id = [a-zA-Z_][a-zA-Z_0-9]*;</span>
+<span class="cm"> id { printf("%.*s", in.cur - in.tok, in.tok); continue; }</span>
+<span class="cm"> */</span>
+<span class="nl">sfx</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> "" { if (u > INT_MAX) return false; printf("%d", static_cast<int>(u)); continue; }</span>
+<span class="cm"> 'u' { if (u > UINT_MAX) return false; printf("%u", static_cast<unsigned>(u)); continue; }</span>
+<span class="cm"> 'l' { if (u > LONG_MAX) return false; printf("%ld", static_cast<long>(u)); continue; }</span>
+<span class="cm"> 'ul' | 'lu' { printf("%lu", u); continue; }</span>
+<span class="cm"> */</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="n">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o">!=</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span> <span class="p">(</span><span class="s">"usage: ./example <filename></span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">file</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"error: cannot open file: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="n">input_t</span> <span class="n">in</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">lex</span><span class="p">(</span><span class="n">in</span><span class="p">))</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"... error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="p">}</span>
+
+ <span class="n">fclose</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Notes:</p>
+<ul class="simple">
+<li>The main lexer is used to lex all trivial lexemes (macros, whitespace, boolean literals, keywords, operators, punctuators, and identifiers),
+recognize numeric literals (which are further parsed by a bunch of auxiliary lexers),
+and recognize the start of a string and character literals (which are further recognized and parsed by an auxiliary lexer).
+Numeric literals are thus lexed twice: this approach may be deemed inefficient,
+but it takes much more effort to validate and parse them in one go.
+Besides, a real-world lexer would rather recognize ill-formed lexemes (e.g., overflown integer literals),
+report them, and resume lexing.</li>
+<li>We don’t use re2c in cases where a hand-written parser looks simpler: when parsing octal and decimal literals
+(though a re2c-based parser would do exactly the same, without the slightest overhead).
+However, hexadecimal literals still require some lexing, which looks better with re2c.
+Again, it’s only a matter of taste: a re2c-based implementation adds no overhead.
+Look at the generated code to make sure.</li>
+<li>The main lexer and string lexer both use <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">1;</span></code>, other lexers use <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code>.
+This is very important: both the main lexer and string lexer advance input position to new (yet unseen) input characters,
+so they must check for the end of input and call <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>. In contrast, other lexers only parse lexemes that
+have already been recognized by the main lexer: these lexemes are guaranteed to be within buffer bounds
+(they are guarded by <code class="docutils literal notranslate"><span class="pre">in.tok</span></code> on the left and <code class="docutils literal notranslate"><span class="pre">in.lim</span></code> on the right).</li>
+<li>The hardest part is (unsurprisingly) floating-point literals.
+They are just as hard to lex as they are to use. <code class="docutils literal notranslate"><span class="pre">:)</span></code></li>
+</ul>
+<p>Generate, compile, and run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c -o cxx98.cc cxx98.re
+$ g++ -o cxx98 cxx98.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./cxx98 07_cxx98.re <span class="p">|</span> fold
+ STATIC CONST size_t <span class="nv">SIZE</span> <span class="o">=</span> <span class="m">64</span> * <span class="m">1024</span><span class="p">;</span> STRUCT input_t <span class="o">{</span> UNSIGNED CHAR buf<span class="o">[</span>SIZE +
+ YYMAXFILL<span class="o">]</span><span class="p">;</span> UNSIGNED CHAR *lim<span class="p">;</span> UNSIGNED CHAR *cur<span class="p">;</span> UNSIGNED CHAR *mar<span class="p">;</span> UNSIGNE
+D CHAR *tok<span class="p">;</span> BOOL eof<span class="p">;</span> FILE *CONST file<span class="p">;</span> input_t<span class="o">(</span>FILE *f<span class="o">)</span> : buf<span class="o">()</span> , lim<span class="o">(</span>buf + SI
+ZE<span class="o">)</span> , cur<span class="o">(</span>lim<span class="o">)</span> , mar<span class="o">(</span>lim<span class="o">)</span> , tok<span class="o">(</span>lim<span class="o">)</span> , eof<span class="o">(</span><span class="nb">false</span><span class="o">)</span> , file<span class="o">(</span>f<span class="o">)</span> <span class="o">{}</span> BOOL fill<span class="o">(</span>size_t
+need<span class="o">)</span> <span class="o">{</span> IF <span class="o">(</span>eof<span class="o">)</span> <span class="o">{</span> RETURN false<span class="p">;</span> <span class="o">}</span> CONST size_t <span class="nv">free</span> <span class="o">=</span> tok - buf<span class="p">;</span> IF <span class="o">(</span>free < nee
+d<span class="o">)</span> <span class="o">{</span> RETURN false<span class="p">;</span> <span class="o">}</span> memmove<span class="o">(</span>buf, tok, lim - tok<span class="o">)</span><span class="p">;</span> lim -<span class="o">=</span> free<span class="p">;</span> cur -<span class="o">=</span> free<span class="p">;</span> mar
+ -<span class="o">=</span> free<span class="p">;</span> tok -<span class="o">=</span> free<span class="p">;</span> <span class="nv">lim</span> <span class="o">+=</span> fread<span class="o">(</span>lim, <span class="m">1</span>, free, file<span class="o">)</span><span class="p">;</span> IF <span class="o">(</span>lim < buf + SIZE<span class="o">)</span> <span class="o">{</span>
+ <span class="nv">eof</span> <span class="o">=</span> true<span class="p">;</span> memset<span class="o">(</span>lim, <span class="m">0</span>, YYMAXFILL<span class="o">)</span><span class="p">;</span> <span class="nv">lim</span> <span class="o">+=</span> YYMAXFILL<span class="p">;</span> <span class="o">}</span> RETURN true<span class="p">;</span> <span class="o">}</span> <span class="o">}</span><span class="p">;</span> TE
+MPLATE<INT base> STATIC BOOL adddgt<span class="o">(</span>UNSIGNED LONG <span class="p">&</span>u, UNSIGNED LONG d<span class="o">)</span> <span class="o">{</span> IF <span class="o">(</span>u >
+ <span class="o">(</span>ULONG_MAX - d<span class="o">)</span> / base<span class="o">)</span> <span class="o">{</span> RETURN false<span class="p">;</span> <span class="o">}</span> <span class="nv">u</span> <span class="o">=</span> u * base + d<span class="p">;</span> RETURN true<span class="p">;</span> <span class="o">}</span> STAT
+IC BOOL lex_oct<span class="o">(</span>CONST UNSIGNED CHAR *s, CONST UNSIGNED CHAR *e, UNSIGNED LONG <span class="p">&</span>u
+<span class="o">)</span> <span class="o">{</span> FOR <span class="o">(</span><span class="nv">u</span> <span class="o">=</span> <span class="m">0</span>, ++s<span class="p">;</span> s < e<span class="p">;</span> ++s<span class="o">)</span> <span class="o">{</span> IF <span class="o">(</span>!adddgt<<span class="m">8</span>><span class="o">(</span>u, *s - <span class="m">48</span><span class="o">))</span> <span class="o">{</span> RETURN false<span class="p">;</span> <span class="o">}</span>
+ <span class="o">}</span> RETURN true<span class="p">;</span> <span class="o">}</span> STATIC BOOL lex_dec<span class="o">(</span>CONST UNSIGNED CHAR *s, CONST UNSIGNED CHA
+R *e, UNSIGNED LONG <span class="p">&</span>u<span class="o">)</span> <span class="o">{</span> FOR <span class="o">(</span><span class="nv">u</span> <span class="o">=</span> <span class="m">0</span><span class="p">;</span> s < e<span class="p">;</span> ++s<span class="o">)</span> <span class="o">{</span> IF <span class="o">(</span>!adddgt<<span class="m">10</span>><span class="o">(</span>u, *s - <span class="m">48</span><span class="o">))</span>
+ <span class="o">{</span> RETURN false<span class="p">;</span> <span class="o">}</span> <span class="o">}</span> RETURN true<span class="p">;</span> <span class="o">}</span> STATIC BOOL lex_hex<span class="o">(</span>CONST UNSIGNED CHAR *s,
+CONST UNSIGNED CHAR *e, UNSIGNED LONG <span class="p">&</span>u<span class="o">)</span> <span class="o">{</span> FOR <span class="o">(</span><span class="nv">u</span> <span class="o">=</span> <span class="m">0</span>, <span class="nv">s</span> <span class="o">+=</span> <span class="m">2</span><span class="p">;</span> s < e<span class="p">;</span><span class="o">)</span> <span class="o">{</span> <span class="o">}</span> RETU
+RN true<span class="p">;</span> <span class="o">}</span> STATIC BOOL lex_str<span class="o">(</span>input_t <span class="p">&</span>in, UNSIGNED CHAR q<span class="o">)</span> <span class="o">{</span> printf<span class="o">(</span><span class="s2">"\x25\x63"</span>
+, q<span class="o">)</span><span class="p">;</span> FOR <span class="o">(</span>UNSIGNED LONG <span class="nv">u</span> <span class="o">=</span> q<span class="p">;;</span> printf<span class="o">(</span><span class="s2">"\x5c\x78\x25\x6c\x78"</span>, u<span class="o">))</span> <span class="o">{</span> in.tok <span class="o">=</span> i
+n.cur<span class="p">;</span> <span class="o">}</span> printf<span class="o">(</span><span class="s2">"\x25\x63"</span>, q<span class="o">)</span><span class="p">;</span> RETURN true<span class="p">;</span> <span class="o">}</span> STATIC BOOL lex_flt<span class="o">(</span>CONST UNSIGNE
+D CHAR *s<span class="o">)</span> <span class="o">{</span> DOUBLE <span class="nv">d</span> <span class="o">=</span> <span class="m">0</span><span class="p">;</span> DOUBLE <span class="nv">x</span> <span class="o">=</span> <span class="m">1</span><span class="p">;</span> INT <span class="nv">e</span> <span class="o">=</span> <span class="m">0</span><span class="p">;</span> mant_int: mant_frac: exp_sig
+n: exp: sfx: end: printf<span class="o">(</span><span class="s2">"\x25\x67"</span>, d<span class="o">)</span><span class="p">;</span> RETURN true<span class="p">;</span> <span class="o">}</span> STATIC BOOL lex<span class="o">(</span>input_t
+<span class="p">&</span>in<span class="o">)</span> <span class="o">{</span> UNSIGNED LONG u<span class="p">;</span> FOR <span class="o">(</span><span class="p">;;</span><span class="o">)</span> <span class="o">{</span> in.tok <span class="o">=</span> in.cur<span class="p">;</span> sfx: <span class="o">}</span> <span class="o">}</span> INT main<span class="o">(</span>INT argc,
+CHAR **argv<span class="o">)</span> <span class="o">{</span> IF <span class="o">(</span>argc !<span class="o">=</span> <span class="m">2</span><span class="o">)</span> <span class="o">{</span> <span class="nb">printf</span> <span class="o">(</span><span class="s2">"\x75\x73\x61\x67\x65\x3a\x20\x2e\x2f\x6</span>
+<span class="s2">5\x78\x61\x6d\x70\x6c\x65\x20\x3c\x66\x69\x6c\x65\x6e\x61\x6d\x65\x3e\xa"</span><span class="o">)</span><span class="p">;</span> RETU
+RN <span class="m">1</span><span class="p">;</span> <span class="o">}</span> FILE *file <span class="o">=</span> fopen<span class="o">(</span>argv<span class="o">[</span><span class="m">1</span><span class="o">]</span>, <span class="s2">"\x72\x62"</span><span class="o">)</span><span class="p">;</span> IF <span class="o">(</span>!file<span class="o">)</span> <span class="o">{</span> printf<span class="o">(</span><span class="s2">"\x65\x72\x</span>
+<span class="s2">72\x6f\x72\x3a\x20\x63\x61\x6e\x6e\x6f\x74\x20\x6f\x70\x65\x6e\x20\x66\x69\x6c\x</span>
+<span class="s2">65\x3a\x20\x25\x73\xa"</span>, argv<span class="o">[</span><span class="m">1</span><span class="o">])</span><span class="p">;</span> RETURN <span class="m">1</span><span class="p">;</span> <span class="o">}</span> input_t in<span class="o">(</span>file<span class="o">)</span><span class="p">;</span> IF <span class="o">(</span>!lex<span class="o">(</span>in<span class="o">))</span> <span class="o">{</span>
+printf<span class="o">(</span><span class="s2">"\x2e\x2e\x2e\x20\x65\x72\x72\x6f\x72\xa"</span><span class="o">)</span><span class="p">;</span> <span class="o">}</span> ELSE <span class="o">{</span> printf<span class="o">(</span><span class="s2">"\xa"</span><span class="o">)</span><span class="p">;</span> <span class="o">}</span> fcl
+ose<span class="o">(</span>file<span class="o">)</span><span class="p">;</span> RETURN <span class="m">0</span><span class="p">;</span> <span class="o">}</span>
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>/etc/passwd — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="etc-passwd">
+<h1>/etc/passwd<a class="headerlink" href="#etc-passwd" title="Permalink to this headline">¶</a></h1>
+<p>This example shows how to parse simple file formats such as the <code class="docutils literal notranslate"><span class="pre">/etc/passwd</span></code> file.
+This file consists of multiple lines of the form <code class="docutils literal notranslate"><span class="pre">user</span></code> <code class="docutils literal notranslate"><span class="pre">:</span></code> <code class="docutils literal notranslate"><span class="pre">password</span></code> <code class="docutils literal notranslate"><span class="pre">:</span></code> <code class="docutils literal notranslate"><span class="pre">UID</span></code> <code class="docutils literal notranslate"><span class="pre">:</span></code> <code class="docutils literal notranslate"><span class="pre">GID</span></code> <code class="docutils literal notranslate"><span class="pre">:</span></code> <code class="docutils literal notranslate"><span class="pre">info</span></code> <code class="docutils literal notranslate"><span class="pre">:</span></code> <code class="docutils literal notranslate"><span class="pre">home</span></code> <code class="docutils literal notranslate"><span class="pre">:</span></code> <code class="docutils literal notranslate"><span class="pre">command</span></code>.
+Our example file is the following <a class="reference download internal" href="../_downloads/09_etc_passwd.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[/etc/passwd]</span></code></a>:</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">root</span><span class="p">:</span><span class="n">x</span><span class="p">:</span><span class="mi">0</span><span class="p">:</span><span class="mi">0</span><span class="p">:</span><span class="n">root</span><span class="p">:</span><span class="o">/</span><span class="n">root</span><span class="p">:</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">bash</span>
+<span class="nb">bin</span><span class="p">:</span><span class="n">x</span><span class="p">:</span><span class="mi">1</span><span class="p">:</span><span class="mi">1</span><span class="p">:</span><span class="nb">bin</span><span class="p">:</span><span class="o">/</span><span class="nb">bin</span><span class="p">:</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">false</span>
+<span class="n">portage</span><span class="p">:</span><span class="n">x</span><span class="p">:</span><span class="mi">250</span><span class="p">:</span><span class="mi">250</span><span class="p">:</span><span class="n">portage</span><span class="p">:</span><span class="o">/</span><span class="n">var</span><span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">portage</span><span class="p">:</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">false</span>
+</pre></div>
+</div>
+<p><a class="reference download internal" href="../_downloads/09_etc_passwd.i--tags.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[etc_passwd.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdlib.h></span><span class="cp"></span>
+
+<span class="cm">/*!max:re2c*/</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">,</span> <span class="o">*</span><span class="n">n</span><span class="p">,</span> <span class="o">*</span><span class="n">p</span><span class="p">,</span> <span class="o">*</span><span class="n">u</span><span class="p">,</span> <span class="o">*</span><span class="n">g</span><span class="p">,</span> <span class="o">*</span><span class="n">f</span><span class="p">,</span> <span class="o">*</span><span class="n">h</span><span class="p">,</span> <span class="o">*</span><span class="n">c</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = 'const char *@@;'; */</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> end = "\x00";</span>
+<span class="cm"> eol = "\n";</span>
+<span class="cm"> sep = [:];</span>
+<span class="cm"> char = [^] \ (end | eol | sep);</span>
+<span class="cm"> user = char+;</span>
+<span class="cm"> pass = char*;</span>
+<span class="cm"> uid = [0-9]+;</span>
+<span class="cm"> gid = [0-9]+;</span>
+<span class="cm"> info = char*;</span>
+<span class="cm"> home = "/" char*;</span>
+<span class="cm"> cmd = "/" char*;</span>
+
+<span class="cm"> * { printf("error\n"); return 1; }</span>
+<span class="cm"> end { return 0; }</span>
+
+<span class="cm"> @n user sep</span>
+<span class="cm"> @p pass sep</span>
+<span class="cm"> @u uid sep</span>
+<span class="cm"> @g gid sep</span>
+<span class="cm"> @f info sep</span>
+<span class="cm"> @h home sep</span>
+<span class="cm"> @c cmd eol {</span>
+<span class="cm"> printf("user: %.*s\n", (int)(p - n) - 1, n);</span>
+<span class="cm"> printf("password: %.*s\n", (int)(u - p) - 1, p);</span>
+<span class="cm"> printf("UID: %.*s\n", (int)(g - u) - 1, u);</span>
+<span class="cm"> printf("GID: %.*s\n", (int)(f - g) - 1, g);</span>
+<span class="cm"> printf("info: %.*s\n", (int)(h - f) - 1, f);</span>
+<span class="cm"> printf("home: %.*s\n", (int)(c - h) - 1, h);</span>
+<span class="cm"> printf("command: %.*s\n", (int)(YYCURSOR - c - 1), c);</span>
+<span class="cm"> printf("\n");</span>
+<span class="cm"> goto loop;</span>
+<span class="cm"> }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o"><</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"no input files</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="s">"r"</span><span class="p">);</span>
+
+ <span class="n">fseek</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_END</span><span class="p">);</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">fsize</span> <span class="o">=</span> <span class="p">(</span><span class="kt">size_t</span><span class="p">)</span> <span class="n">ftell</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="n">fseek</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_SET</span><span class="p">);</span>
+
+ <span class="kt">char</span> <span class="o">*</span><span class="n">buffer</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="o">*</span><span class="p">)</span> <span class="n">malloc</span><span class="p">(</span><span class="n">fsize</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>
+
+ <span class="n">fread</span><span class="p">(</span><span class="n">buffer</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">fsize</span><span class="p">,</span> <span class="n">file</span><span class="p">);</span>
+ <span class="n">buffer</span><span class="p">[</span><span class="n">fsize</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+ <span class="k">const</span> <span class="kt">int</span> <span class="n">status</span> <span class="o">=</span> <span class="n">lex</span><span class="p">(</span><span class="n">buffer</span><span class="p">);</span>
+
+ <span class="n">fclose</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="n">free</span><span class="p">(</span><span class="n">buffer</span><span class="p">);</span>
+
+ <span class="k">return</span> <span class="n">status</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --tags -o etc_passwd.cc etc_passwd.re
+$ g++ -o etc_passwd etc_passwd.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./etc_passwd /etc/passwd
+user: root
+password: x
+UID: <span class="m">0</span>
+GID: <span class="m">0</span>
+info: root
+home: /root
+command: /bin/bash
+
+user: bin
+password: x
+UID: <span class="m">1</span>
+GID: <span class="m">1</span>
+info: bin
+home: /bin
+command: /bin/false
+
+user: portage
+password: x
+UID: <span class="m">250</span>
+GID: <span class="m">250</span>
+info: portage
+home: /var/tmp/portage
+command: /bin/false
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>URI (RFC-3986) — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="uri-rfc-3986">
+<h1>URI (RFC-3986)<a class="headerlink" href="#uri-rfc-3986" title="Permalink to this headline">¶</a></h1>
+<p>This example was used as a benchmark in
+<a class="reference external" href="../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">“Tagged Deterministic Finite Automata with Lookahead”</a> paper;
+it is an RFC-3986 compliant URI parser.
+It uses s-tags.</p>
+<p><a class="reference download internal" href="../_downloads/10_uri_rfc3986.i--tags.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[uri_rfc3986.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdlib.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="cm">/*!max:re2c*/</span>
+<span class="k">static</span> <span class="k">const</span> <span class="kt">size_t</span> <span class="n">SIZE</span> <span class="o">=</span> <span class="mi">4096</span><span class="p">;</span>
+
+<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">buf</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">lim</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">cur</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">mar</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">tok</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "char *@@;\n"; */</span>
+ <span class="kt">int</span> <span class="n">eof</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">input_t</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">init_input</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">fname</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">file</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="n">fname</span><span class="p">,</span> <span class="s">"r"</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="o">*</span><span class="p">)</span> <span class="n">malloc</span><span class="p">(</span><span class="n">SIZE</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">mar</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "in->@@ = 0;\n"; */</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">free_input</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">free</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">);</span>
+ <span class="n">fclose</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">file</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">fill</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">need</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">size_t</span> <span class="n">free</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">eof</span><span class="p">)</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+
+ <span class="n">free</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">free</span> <span class="o"><</span> <span class="n">need</span><span class="p">)</span> <span class="k">return</span> <span class="mi">2</span><span class="p">;</span>
+
+ <span class="n">memmove</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">mar</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "if (in->@@) in->@@ -= free;\n"; */</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">fread</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">free</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">file</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o"><</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="n">memset</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">YYMAXFILL</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">count</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span>
+ <span class="o">*</span><span class="n">s1</span><span class="p">,</span> <span class="o">*</span><span class="n">u1</span><span class="p">,</span> <span class="o">*</span><span class="n">h1</span><span class="p">,</span> <span class="o">*</span><span class="n">h3</span><span class="p">,</span> <span class="o">*</span><span class="n">h5</span><span class="p">,</span> <span class="o">*</span><span class="n">r1</span><span class="p">,</span> <span class="o">*</span><span class="n">p1</span><span class="p">,</span> <span class="o">*</span><span class="n">p3</span><span class="p">,</span> <span class="o">*</span><span class="n">q1</span><span class="p">,</span> <span class="o">*</span><span class="n">f1</span><span class="p">,</span>
+ <span class="o">*</span><span class="n">s2</span><span class="p">,</span> <span class="o">*</span><span class="n">u2</span><span class="p">,</span> <span class="o">*</span><span class="n">h2</span><span class="p">,</span> <span class="o">*</span><span class="n">h4</span><span class="p">,</span> <span class="o">*</span><span class="n">h6</span><span class="p">,</span> <span class="o">*</span><span class="n">r2</span><span class="p">,</span> <span class="o">*</span><span class="n">p2</span><span class="p">,</span> <span class="o">*</span><span class="n">p4</span><span class="p">,</span> <span class="o">*</span><span class="n">q2</span><span class="p">,</span> <span class="o">*</span><span class="n">f2</span><span class="p">;</span>
+ <span class="kt">long</span> <span class="n">c</span><span class="p">;</span>
+
+ <span class="n">c</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">cur</span><span class="p">;</span>
+<span class="cm">/*!re2c</span>
+
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYCURSOR = in->cur;</span>
+<span class="cm"> re2c:define:YYMARKER = in->mar;</span>
+<span class="cm"> re2c:define:YYLIMIT = in->lim;</span>
+<span class="cm"> re2c:define:YYFILL = "if (fill(in, @@) != 0) return 2;";</span>
+<span class="cm"> re2c:define:YYFILL:naked = 1;</span>
+<span class="cm"> re2c:tags:expression = "in->@@";</span>
+
+<span class="cm"> end = "\x00";</span>
+<span class="cm"> eol = "\n";</span>
+
+<span class="cm"> alpha = [a-zA-Z];</span>
+<span class="cm"> digit = [0-9];</span>
+<span class="cm"> hexdigit = [0-9a-fA-F];</span>
+<span class="cm"> unreserved = alpha | digit | [-._~];</span>
+<span class="cm"> pct_encoded = "%" hexdigit{2};</span>
+<span class="cm"> sub_delims = [!$&'()*+,;=];</span>
+<span class="cm"> pchar = unreserved | pct_encoded | sub_delims | [:@];</span>
+
+<span class="cm"> scheme = @s1 alpha (alpha | digit | [-+.])* @s2;</span>
+<span class="cm"> userinfo = @u1 (unreserved | pct_encoded | sub_delims | ":")* @u2;</span>
+<span class="cm"> dec_octet</span>
+<span class="cm"> = digit</span>
+<span class="cm"> | [\x31-\x39] digit</span>
+<span class="cm"> | "1" digit{2}</span>
+<span class="cm"> | "2" [\x30-\x34] digit</span>
+<span class="cm"> | "25" [\x30-\x35];</span>
+<span class="cm"> ipv4address = dec_octet "." dec_octet "." dec_octet "." dec_octet;</span>
+<span class="cm"> h16 = hexdigit{1,4};</span>
+<span class="cm"> ls32 = h16 ":" h16 | ipv4address;</span>
+<span class="cm"> ipv6address</span>
+<span class="cm"> = (h16 ":"){6} ls32</span>
+<span class="cm"> | "::" (h16 ":"){5} ls32</span>
+<span class="cm"> | ( h16)? "::" (h16 ":"){4} ls32</span>
+<span class="cm"> | ((h16 ":"){0,1} h16)? "::" (h16 ":"){3} ls32</span>
+<span class="cm"> | ((h16 ":"){0,2} h16)? "::" (h16 ":"){2} ls32</span>
+<span class="cm"> | ((h16 ":"){0,3} h16)? "::" h16 ":" ls32</span>
+<span class="cm"> | ((h16 ":"){0,4} h16)? "::" ls32</span>
+<span class="cm"> | ((h16 ":"){0,5} h16)? "::" h16</span>
+<span class="cm"> | ((h16 ":"){0,6} h16)? "::";</span>
+<span class="cm"> ipvfuture = "v" hexdigit+ "." (unreserved | sub_delims | ":" )+;</span>
+<span class="cm"> ip_literal = "[" ( ipv6address | ipvfuture ) "]";</span>
+<span class="cm"> reg_name = (unreserved | pct_encoded | sub_delims)*;</span>
+<span class="cm"> host</span>
+<span class="cm"> = @h1 ip_literal @h2</span>
+<span class="cm"> | @h3 ipv4address @h4</span>
+<span class="cm"> | @h5 reg_name @h6;</span>
+<span class="cm"> port = @r1 digit* @r2;</span>
+<span class="cm"> authority = (userinfo "@")? host (":" port)?;</span>
+<span class="cm"> path_abempty = ("/" pchar*)*;</span>
+<span class="cm"> path_absolute = "/" (pchar+ ("/" pchar*)*)?;</span>
+<span class="cm"> path_rootless = pchar+ ("/" pchar*)*;</span>
+<span class="cm"> path_empty = "";</span>
+<span class="cm"> hier_part</span>
+<span class="cm"> = "//" authority @p1 path_abempty @p2</span>
+<span class="cm"> | @p3 (path_absolute | path_rootless | path_empty) @p4;</span>
+<span class="cm"> query = @q1 (pchar | [/?])* @q2;</span>
+<span class="cm"> fragment = @f1 (pchar | [/?])* @f2;</span>
+<span class="cm"> uri = scheme ":" hier_part ("?" query)? ("#" fragment)?;</span>
+
+<span class="cm"> * { return 1; }</span>
+<span class="cm"> end { *count = c; return 0; }</span>
+<span class="cm"> eol { goto loop; }</span>
+<span class="cm"> uri {</span>
+<span class="cm"> ++c;</span>
+<span class="cm"> printf("URI %ld:\n", c);</span>
+<span class="cm"> printf(" scheme: %.*s\n", (int)(s2 - s1), s1);</span>
+<span class="cm"> if (u1) printf(" userinfo: %.*s\n", (int)(u2 - u1), u1);</span>
+<span class="cm"> if (h1) printf(" host: %.*s (IP literal)\n", (int)(h2 - h1), h1);</span>
+<span class="cm"> if (h3) printf(" host: %.*s (IPv4)\n", (int)(h4 - h3), h3);</span>
+<span class="cm"> if (h5) printf(" host: %.*s (name)\n", (int)(h6 - h5), h5);</span>
+<span class="cm"> if (r1) printf(" port: %.*s\n", (int)(r2 - r1), r1);</span>
+<span class="cm"> if (p1) printf(" path: %.*s\n", (int)(p2 - p1), p1);</span>
+<span class="cm"> if (p3) printf(" path: %.*s\n", (int)(p4 - p3), p3);</span>
+<span class="cm"> if (q1) printf(" query: %.*s\n", (int)(q2 - q1), q1);</span>
+<span class="cm"> if (f1) printf(" fragment: %.*s\n", (int)(f2 - f1), f1);</span>
+<span class="cm"> printf("\n");</span>
+<span class="cm"> goto loop;</span>
+<span class="cm"> }</span>
+<span class="cm">*/</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">long</span> <span class="n">count</span><span class="p">;</span>
+ <span class="n">input_t</span> <span class="n">in</span><span class="p">;</span>
+ <span class="n">init_input</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span>
+
+ <span class="k">switch</span> <span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="o">&</span><span class="n">count</span><span class="p">))</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="mi">0</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ok, parsed %ld URIs</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">count</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="k">case</span> <span class="mi">1</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"syntax error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="k">case</span> <span class="mi">2</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"yyfill error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"panic</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="n">free_input</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p><a class="reference download internal" href="../_downloads/10_uri.dat.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[uri.dat]</span></code></a></p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>http://user:pass@127.0.0.1:8000/path/data?key=val&key2=val2#frag1
+rsync://rsync.kernel.org/pub/
+http://re2c.org/manual/syntax/syntax.html#rules
+ssh://[2001:db8:85a3::8a2e:370:7334]/
+</pre></div>
+</div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --tags -o uri_rfc3986.cc uri_rfc3986.re
+$ g++ -o uri_rfc3986 uri_rfc3986.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./uri_rfc3986 uri.dat
+URI <span class="m">1</span>:
+ scheme: http
+ userinfo: user:pass
+ host: <span class="m">127</span>.0.0.1 <span class="o">(</span>IPv4<span class="o">)</span>
+ port: <span class="m">8000</span>
+ path: /path/data
+ query: <span class="nv">key</span><span class="o">=</span>val<span class="p">&</span><span class="nv">key2</span><span class="o">=</span>val2
+ fragment: frag1
+
+URI <span class="m">2</span>:
+ scheme: rsync
+ host: rsync.kernel.org <span class="o">(</span>name<span class="o">)</span>
+ path: /pub/
+
+URI <span class="m">3</span>:
+ scheme: http
+ host: re2c.org <span class="o">(</span>name<span class="o">)</span>
+ path: /manual/syntax/syntax.html
+ fragment: rules
+
+URI <span class="m">4</span>:
+ scheme: ssh
+ host: <span class="o">[</span><span class="m">2001</span>:db8:85a3::8a2e:370:7334<span class="o">]</span> <span class="o">(</span>IP literal<span class="o">)</span>
+ path: /
+
+ok, parsed <span class="m">4</span> URIs
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>HTTP (RFC-7230) — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="http-rfc-7230">
+<h1>HTTP (RFC-7230)<a class="headerlink" href="#http-rfc-7230" title="Permalink to this headline">¶</a></h1>
+<p>This example was used as a benchmark in
+<a class="reference external" href="../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">“Tagged Deterministic Finite Automata with Lookahead”</a> paper;
+it is an RFC-7230 compliant HTTP message parser.
+It uses both s-tags and m-tags.</p>
+<p><a class="reference download internal" href="../_downloads/11_http_rfc7230.i--tags.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[http_rfc7230.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 10
+ 11
+ 12
+ 13
+ 14
+ 15
+ 16
+ 17
+ 18
+ 19
+ 20
+ 21
+ 22
+ 23
+ 24
+ 25
+ 26
+ 27
+ 28
+ 29
+ 30
+ 31
+ 32
+ 33
+ 34
+ 35
+ 36
+ 37
+ 38
+ 39
+ 40
+ 41
+ 42
+ 43
+ 44
+ 45
+ 46
+ 47
+ 48
+ 49
+ 50
+ 51
+ 52
+ 53
+ 54
+ 55
+ 56
+ 57
+ 58
+ 59
+ 60
+ 61
+ 62
+ 63
+ 64
+ 65
+ 66
+ 67
+ 68
+ 69
+ 70
+ 71
+ 72
+ 73
+ 74
+ 75
+ 76
+ 77
+ 78
+ 79
+ 80
+ 81
+ 82
+ 83
+ 84
+ 85
+ 86
+ 87
+ 88
+ 89
+ 90
+ 91
+ 92
+ 93
+ 94
+ 95
+ 96
+ 97
+ 98
+ 99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdlib.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="k">typedef</span> <span class="k">struct</span> <span class="n">mtag_t</span> <span class="p">{</span>
+ <span class="k">struct</span> <span class="n">mtag_t</span> <span class="o">*</span><span class="n">pred</span><span class="p">;</span>
+ <span class="kt">long</span> <span class="n">dist</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">mtag_t</span><span class="p">;</span>
+
+<span class="k">typedef</span> <span class="k">struct</span> <span class="n">mtagpool_t</span> <span class="p">{</span>
+ <span class="n">mtag_t</span> <span class="o">*</span><span class="n">head</span><span class="p">;</span>
+ <span class="n">mtag_t</span> <span class="o">*</span><span class="n">next</span><span class="p">;</span>
+ <span class="n">mtag_t</span> <span class="o">*</span><span class="n">last</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">mtagpool_t</span><span class="p">;</span>
+
+<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">buf</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">lim</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">cur</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">mar</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">tok</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "char *@@;\n"; */</span>
+ <span class="cm">/*!mtags:re2c format = "mtag_t *@@;\n"; */</span>
+ <span class="n">mtagpool_t</span> <span class="n">mtp</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">eof</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">input_t</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">mtagpool_clear</span><span class="p">(</span><span class="n">mtagpool_t</span> <span class="o">*</span><span class="n">mtp</span><span class="p">,</span> <span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">next</span> <span class="o">=</span> <span class="n">mtp</span><span class="o">-></span><span class="n">head</span><span class="p">;</span>
+ <span class="cm">/*!mtags:re2c format = "in->@@ = 0;\n"; */</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">mtagpool_init</span><span class="p">(</span><span class="n">mtagpool_t</span> <span class="o">*</span><span class="n">mtp</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">static</span> <span class="k">const</span> <span class="kt">unsigned</span> <span class="n">size</span> <span class="o">=</span> <span class="mi">1024</span> <span class="o">*</span> <span class="mi">1024</span><span class="p">;</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">head</span> <span class="o">=</span> <span class="p">(</span><span class="n">mtag_t</span><span class="o">*</span><span class="p">)</span><span class="n">malloc</span><span class="p">(</span><span class="n">size</span> <span class="o">*</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">mtag_t</span><span class="p">));</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">next</span> <span class="o">=</span> <span class="n">mtp</span><span class="o">-></span><span class="n">head</span><span class="p">;</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">last</span> <span class="o">=</span> <span class="n">mtp</span><span class="o">-></span><span class="n">head</span> <span class="o">+</span> <span class="n">size</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">mtagpool_free</span><span class="p">(</span><span class="n">mtagpool_t</span> <span class="o">*</span><span class="n">mtp</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">free</span><span class="p">(</span><span class="n">mtp</span><span class="o">-></span><span class="n">head</span><span class="p">);</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">head</span> <span class="o">=</span> <span class="n">mtp</span><span class="o">-></span><span class="n">next</span> <span class="o">=</span> <span class="n">mtp</span><span class="o">-></span><span class="n">last</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="n">mtag_t</span> <span class="o">*</span><span class="nf">mtagpool_next</span><span class="p">(</span><span class="n">mtagpool_t</span> <span class="o">*</span><span class="n">mtp</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">unsigned</span> <span class="n">size</span><span class="p">;</span>
+ <span class="n">mtag_t</span> <span class="o">*</span><span class="n">head</span><span class="p">;</span>
+
+ <span class="k">if</span> <span class="p">(</span><span class="n">mtp</span><span class="o">-></span><span class="n">next</span> <span class="o"><</span> <span class="n">mtp</span><span class="o">-></span><span class="n">last</span><span class="p">)</span> <span class="k">return</span> <span class="n">mtp</span><span class="o">-></span><span class="n">next</span><span class="o">++</span><span class="p">;</span>
+
+ <span class="n">size</span> <span class="o">=</span> <span class="n">mtp</span><span class="o">-></span><span class="n">last</span> <span class="o">-</span> <span class="n">mtp</span><span class="o">-></span><span class="n">head</span><span class="p">;</span>
+ <span class="n">head</span> <span class="o">=</span> <span class="p">(</span><span class="n">mtag_t</span><span class="o">*</span><span class="p">)</span><span class="n">malloc</span><span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">size</span> <span class="o">*</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">mtag_t</span><span class="p">));</span>
+ <span class="n">memcpy</span><span class="p">(</span><span class="n">head</span><span class="p">,</span> <span class="n">mtp</span><span class="o">-></span><span class="n">head</span><span class="p">,</span> <span class="n">size</span> <span class="o">*</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">mtag_t</span><span class="p">));</span>
+ <span class="n">free</span><span class="p">(</span><span class="n">mtp</span><span class="o">-></span><span class="n">head</span><span class="p">);</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">head</span> <span class="o">=</span> <span class="n">head</span><span class="p">;</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">next</span> <span class="o">=</span> <span class="n">head</span> <span class="o">+</span> <span class="n">size</span><span class="p">;</span>
+ <span class="n">mtp</span><span class="o">-></span><span class="n">last</span> <span class="o">=</span> <span class="n">head</span> <span class="o">+</span> <span class="n">size</span> <span class="o">*</span> <span class="mi">2</span><span class="p">;</span>
+ <span class="k">return</span> <span class="n">mtp</span><span class="o">-></span><span class="n">next</span><span class="o">++</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">mtag</span><span class="p">(</span><span class="n">mtag_t</span> <span class="o">**</span><span class="n">pmt</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">b</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">t</span><span class="p">,</span> <span class="n">mtagpool_t</span> <span class="o">*</span><span class="n">mtp</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">mtag_t</span> <span class="o">*</span><span class="n">mt</span> <span class="o">=</span> <span class="n">mtagpool_next</span><span class="p">(</span><span class="n">mtp</span><span class="p">);</span>
+ <span class="n">mt</span><span class="o">-></span><span class="n">pred</span> <span class="o">=</span> <span class="o">*</span><span class="n">pmt</span><span class="p">;</span>
+ <span class="n">mt</span><span class="o">-></span><span class="n">dist</span> <span class="o">=</span> <span class="n">t</span> <span class="o">-</span> <span class="n">b</span><span class="p">;</span>
+ <span class="o">*</span><span class="n">pmt</span> <span class="o">=</span> <span class="n">mt</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="cm">/*!max:re2c*/</span>
+<span class="k">static</span> <span class="k">const</span> <span class="kt">size_t</span> <span class="n">SIZE</span> <span class="o">=</span> <span class="mi">4096</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">init_input</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">fname</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">file</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="n">fname</span><span class="p">,</span> <span class="s">"r"</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="o">*</span><span class="p">)</span> <span class="n">malloc</span><span class="p">(</span><span class="n">SIZE</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">mar</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "in->@@ = 0;\n"; */</span>
+ <span class="cm">/*!mtags:re2c format = "in->@@ = 0;\n"; */</span>
+ <span class="n">mtagpool_init</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="o">-></span><span class="n">mtp</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">free_input</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">fclose</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">file</span><span class="p">);</span>
+ <span class="n">free</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">);</span>
+ <span class="n">mtagpool_free</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="o">-></span><span class="n">mtp</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">fill</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">need</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">size_t</span> <span class="n">free</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">eof</span><span class="p">)</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+
+ <span class="n">free</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">free</span> <span class="o"><</span> <span class="n">need</span><span class="p">)</span> <span class="k">return</span> <span class="mi">2</span><span class="p">;</span>
+
+ <span class="n">memmove</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">mar</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "if (in->@@) in->@@ -= free;\n"; */</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">fread</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">free</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">file</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o"><</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="n">memset</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">YYMAXFILL</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">print_headers</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">tok</span><span class="p">,</span>
+ <span class="k">const</span> <span class="n">mtag_t</span> <span class="o">*</span><span class="n">h1</span><span class="p">,</span> <span class="k">const</span> <span class="n">mtag_t</span> <span class="o">*</span><span class="n">h2</span><span class="p">,</span>
+ <span class="k">const</span> <span class="n">mtag_t</span> <span class="o">*</span><span class="n">h3</span><span class="p">,</span> <span class="k">const</span> <span class="n">mtag_t</span> <span class="o">*</span><span class="n">h4</span><span class="p">,</span>
+ <span class="k">const</span> <span class="n">mtag_t</span> <span class="o">*</span><span class="n">h5</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">h1</span><span class="p">)</span> <span class="k">return</span><span class="p">;</span>
+ <span class="n">print_headers</span><span class="p">(</span><span class="n">tok</span><span class="p">,</span> <span class="n">h1</span><span class="o">-></span><span class="n">pred</span><span class="p">,</span> <span class="n">h2</span><span class="o">-></span><span class="n">pred</span><span class="p">,</span> <span class="n">h3</span><span class="o">-></span><span class="n">pred</span><span class="p">,</span> <span class="n">h4</span><span class="o">-></span><span class="n">pred</span><span class="p">,</span> <span class="n">h5</span><span class="o">-></span><span class="n">pred</span><span class="p">);</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"%.*s%.*s%.*s%.*s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span>
+ <span class="p">(</span><span class="kt">int</span><span class="p">)(</span><span class="n">h2</span><span class="o">-></span><span class="n">dist</span> <span class="o">-</span> <span class="n">h1</span><span class="o">-></span><span class="n">dist</span><span class="p">),</span> <span class="n">tok</span> <span class="o">+</span> <span class="n">h1</span><span class="o">-></span><span class="n">dist</span><span class="p">,</span>
+ <span class="p">(</span><span class="kt">int</span><span class="p">)(</span><span class="n">h3</span><span class="o">-></span><span class="n">dist</span> <span class="o">-</span> <span class="n">h2</span><span class="o">-></span><span class="n">dist</span><span class="p">),</span> <span class="n">tok</span> <span class="o">+</span> <span class="n">h2</span><span class="o">-></span><span class="n">dist</span><span class="p">,</span>
+ <span class="p">(</span><span class="kt">int</span><span class="p">)(</span><span class="n">h4</span><span class="o">-></span><span class="n">dist</span> <span class="o">-</span> <span class="n">h3</span><span class="o">-></span><span class="n">dist</span><span class="p">),</span> <span class="n">tok</span> <span class="o">+</span> <span class="n">h3</span><span class="o">-></span><span class="n">dist</span><span class="p">,</span>
+ <span class="p">(</span><span class="kt">int</span><span class="p">)(</span><span class="n">h5</span><span class="o">-></span><span class="n">dist</span> <span class="o">-</span> <span class="n">h4</span><span class="o">-></span><span class="n">dist</span><span class="p">),</span> <span class="n">tok</span> <span class="o">+</span> <span class="n">h4</span><span class="o">-></span><span class="n">dist</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="cp">#define YYCTYPE char</span>
+<span class="cp">#define YYCURSOR in->cur</span>
+<span class="cp">#define YYMARKER in->mar</span>
+<span class="cp">#define YYLIMIT in->lim</span>
+<span class="cp">#define YYMTAGP(mt) mtag(&mt, in->tok, in->cur, &in->mtp)</span>
+<span class="cp">#define YYMTAGN(mt) mtag(&mt, in->tok, NULL, &in->mtp)</span>
+<span class="cp">#define YYFILL(n) if (fill(in, n) != 0) return 2;</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="n">input_t</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">long</span> <span class="o">*</span><span class="n">count</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">of</span><span class="p">,</span> <span class="o">*</span><span class="n">au</span><span class="p">,</span> <span class="o">*</span><span class="n">at</span><span class="p">,</span>
+ <span class="o">*</span><span class="n">hs1</span><span class="p">,</span> <span class="o">*</span><span class="n">hs3</span><span class="p">,</span> <span class="o">*</span><span class="n">m1</span><span class="p">,</span> <span class="o">*</span><span class="n">p1</span><span class="p">,</span> <span class="o">*</span><span class="n">p3</span><span class="p">,</span> <span class="o">*</span><span class="n">p5</span><span class="p">,</span> <span class="o">*</span><span class="n">q1</span><span class="p">,</span> <span class="o">*</span><span class="n">q3</span><span class="p">,</span>
+ <span class="o">*</span><span class="n">hs2</span><span class="p">,</span> <span class="o">*</span><span class="n">hs4</span><span class="p">,</span> <span class="o">*</span><span class="n">m2</span><span class="p">,</span> <span class="o">*</span><span class="n">p2</span><span class="p">,</span> <span class="o">*</span><span class="n">p4</span><span class="p">,</span> <span class="o">*</span><span class="n">p6</span><span class="p">,</span> <span class="o">*</span><span class="n">q2</span><span class="p">,</span> <span class="o">*</span><span class="n">q4</span><span class="p">,</span>
+ <span class="o">*</span><span class="n">r1</span><span class="p">,</span> <span class="o">*</span><span class="n">r3</span><span class="p">,</span> <span class="o">*</span><span class="n">rp1</span><span class="p">,</span> <span class="o">*</span><span class="n">s1</span><span class="p">,</span> <span class="o">*</span><span class="n">st1</span><span class="p">,</span> <span class="o">*</span><span class="n">u1</span><span class="p">,</span> <span class="o">*</span><span class="n">u3</span><span class="p">,</span> <span class="o">*</span><span class="n">v1</span><span class="p">,</span> <span class="o">*</span><span class="n">v3</span><span class="p">,</span>
+ <span class="o">*</span><span class="n">r2</span><span class="p">,</span> <span class="o">*</span><span class="n">r4</span><span class="p">,</span> <span class="o">*</span><span class="n">rp2</span><span class="p">,</span> <span class="o">*</span><span class="n">s2</span><span class="p">,</span> <span class="o">*</span><span class="n">st2</span><span class="p">,</span> <span class="o">*</span><span class="n">u2</span><span class="p">,</span> <span class="o">*</span><span class="n">u4</span><span class="p">,</span> <span class="o">*</span><span class="n">v2</span><span class="p">,</span> <span class="o">*</span><span class="n">v4</span><span class="p">;</span>
+ <span class="n">mtag_t</span> <span class="o">*</span><span class="n">h1</span><span class="p">,</span> <span class="o">*</span><span class="n">h2</span><span class="p">,</span> <span class="o">*</span><span class="n">h3</span><span class="p">,</span> <span class="o">*</span><span class="n">h4</span><span class="p">,</span> <span class="o">*</span><span class="n">h5</span><span class="p">;</span>
+ <span class="kt">long</span> <span class="n">c</span><span class="p">;</span>
+
+ <span class="n">c</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;;</span>
+ <span class="n">of</span> <span class="o">=</span> <span class="n">au</span> <span class="o">=</span> <span class="n">at</span>
+ <span class="o">=</span> <span class="n">hs1</span> <span class="o">=</span> <span class="n">hs3</span> <span class="o">=</span> <span class="n">m1</span> <span class="o">=</span> <span class="n">p1</span> <span class="o">=</span> <span class="n">p3</span> <span class="o">=</span> <span class="n">p5</span> <span class="o">=</span> <span class="n">q1</span> <span class="o">=</span> <span class="n">q3</span>
+ <span class="o">=</span> <span class="n">hs2</span> <span class="o">=</span> <span class="n">hs4</span> <span class="o">=</span> <span class="n">m2</span> <span class="o">=</span> <span class="n">p2</span> <span class="o">=</span> <span class="n">p4</span> <span class="o">=</span> <span class="n">p6</span> <span class="o">=</span> <span class="n">q2</span> <span class="o">=</span> <span class="n">q4</span>
+ <span class="o">=</span> <span class="n">r1</span> <span class="o">=</span> <span class="n">r3</span> <span class="o">=</span> <span class="n">rp1</span> <span class="o">=</span> <span class="n">s1</span> <span class="o">=</span> <span class="n">st1</span> <span class="o">=</span> <span class="n">u1</span> <span class="o">=</span> <span class="n">u3</span> <span class="o">=</span> <span class="n">v1</span> <span class="o">=</span> <span class="n">v3</span>
+ <span class="o">=</span> <span class="n">r2</span> <span class="o">=</span> <span class="n">r4</span> <span class="o">=</span> <span class="n">rp2</span> <span class="o">=</span> <span class="n">s2</span> <span class="o">=</span> <span class="n">st2</span> <span class="o">=</span> <span class="n">u2</span> <span class="o">=</span> <span class="n">u4</span> <span class="o">=</span> <span class="n">v2</span> <span class="o">=</span> <span class="n">v4</span> <span class="o">=</span> <span class="nb">NULL</span><span class="p">;</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">cur</span><span class="p">;</span>
+<span class="cm">/*!re2c</span>
+<span class="cm"> re2c:tags:expression = "in->@@";</span>
+
+<span class="cm"> end = "\x00";</span>
+<span class="cm"> eol = "\n";</span>
+
+<span class="cm"> crlf = eol;</span>
+<span class="cm"> sp = " ";</span>
+<span class="cm"> htab = "\t";</span>
+<span class="cm"> ows = (sp | htab)*;</span>
+<span class="cm"> digit = [0-9];</span>
+<span class="cm"> alpha = [a-zA-Z];</span>
+<span class="cm"> hexdigit = [0-9a-fA-F];</span>
+<span class="cm"> unreserved = alpha | digit | [-._~];</span>
+<span class="cm"> pct_encoded = "%" hexdigit{2};</span>
+<span class="cm"> sub_delims = [!$&'()*+,;=];</span>
+<span class="cm"> pchar = unreserved | pct_encoded | sub_delims | [:@];</span>
+<span class="cm"> vchar = [\x1f-\x7e];</span>
+<span class="cm"> tchar = [-!#$%&'*+.^_`|~] | digit | alpha;</span>
+
+<span class="cm"> obs_fold = crlf (sp | htab)+;</span>
+<span class="cm"> obs_text = [\x80-\xff];</span>
+<span class="cm"> field_name = tchar+;</span>
+<span class="cm"> field_vchar = vchar | obs_text;</span>
+<span class="cm"> field_content = field_vchar ((sp | htab)+ field_vchar)?;</span>
+<span class="cm"> field_value = (field_content | obs_fold)*;</span>
+<span class="cm"> header_field = #h1 field_name #h2 ":" ows #h3 field_value #h4 ows #h5;</span>
+<span class="cm"> scheme = alpha (alpha | digit | [-+.])*;</span>
+<span class="cm"> userinfo = (unreserved | pct_encoded | sub_delims | ":")*;</span>
+<span class="cm"> dec_octet</span>
+<span class="cm"> = digit</span>
+<span class="cm"> | [\x31-\x39] digit</span>
+<span class="cm"> | "1" digit{2}</span>
+<span class="cm"> | "2" [\x30-\x34] digit</span>
+<span class="cm"> | "25" [\x30-\x35];</span>
+<span class="cm"> ipv4address = dec_octet "." dec_octet "." dec_octet "." dec_octet;</span>
+<span class="cm"> h16 = hexdigit{1,4};</span>
+<span class="cm"> ls32 = h16 ":" h16 | ipv4address;</span>
+<span class="cm"> ipv6address</span>
+<span class="cm"> = (h16 ":"){6} ls32</span>
+<span class="cm"> | "::" (h16 ":"){5} ls32</span>
+<span class="cm"> | ( h16)? "::" (h16 ":"){4} ls32</span>
+<span class="cm"> | ((h16 ":"){0,1} h16)? "::" (h16 ":"){3} ls32</span>
+<span class="cm"> | ((h16 ":"){0,2} h16)? "::" (h16 ":"){2} ls32</span>
+<span class="cm"> | ((h16 ":"){0,3} h16)? "::" h16 ":" ls32</span>
+<span class="cm"> | ((h16 ":"){0,4} h16)? "::" ls32</span>
+<span class="cm"> | ((h16 ":"){0,5} h16)? "::" h16</span>
+<span class="cm"> | ((h16 ":"){0,6} h16)? "::";</span>
+<span class="cm"> ipvfuture = "v" hexdigit+ "." (unreserved | sub_delims | ":" )+;</span>
+<span class="cm"> ip_literal = "[" ( ipv6address | ipvfuture ) "]";</span>
+<span class="cm"> reg_name = (unreserved | pct_encoded | sub_delims)*;</span>
+<span class="cm"> path_abempty = ("/" pchar*)*;</span>
+<span class="cm"> path_absolute = "/" (pchar+ ("/" pchar*)*)?;</span>
+<span class="cm"> path_rootless = pchar+ ("/" pchar*)*;</span>
+<span class="cm"> path_empty = "";</span>
+<span class="cm"> host = ip_literal | ipv4address | reg_name;</span>
+<span class="cm"> port = digit*;</span>
+<span class="cm"> query = (pchar | [/?])*;</span>
+<span class="cm"> absolute_uri = @s1 scheme @s2 ":"</span>
+<span class="cm"> ( "//" (@u1 userinfo @u2 "@")? @hs1 host @hs2 (":" @r1 port @r2)? @p1 path_abempty @p2</span>
+<span class="cm"> | @p3 (path_absolute | path_rootless | path_empty) @p4</span>
+<span class="cm"> ) ("?" @q1 query @q2)?;</span>
+<span class="cm"> authority = (@u3 userinfo @u4 "@")? @hs3 host @hs4 (":" @r3 port @r4)?;</span>
+<span class="cm"> origin_form = @p5 path_abempty @p6 ("?" @q3 query @q4)?;</span>
+<span class="cm"> http_name = "HTTP";</span>
+<span class="cm"> http_version = http_name "/" digit "." digit;</span>
+<span class="cm"> request_target</span>
+<span class="cm"> = @at authority</span>
+<span class="cm"> | @au absolute_uri</span>
+<span class="cm"> | @of origin_form</span>
+<span class="cm"> | "*";</span>
+<span class="cm"> method = tchar+;</span>
+<span class="cm"> request_line = @m1 method @m2 sp request_target sp @v3 http_version @v4 crlf;</span>
+<span class="cm"> status_code = digit{3};</span>
+<span class="cm"> reason_phrase = (htab | sp | vchar | obs_text)*;</span>
+<span class="cm"> status_line = @v1 http_version @v2 sp @st1 status_code @st2 sp @rp1 reason_phrase @rp2 crlf;</span>
+<span class="cm"> start_line = (request_line | status_line);</span>
+<span class="cm"> message_head = start_line (header_field crlf)* crlf;</span>
+
+<span class="cm"> * { return 1; }</span>
+<span class="cm"> end { *count = c; return 0; }</span>
+<span class="cm"> eol { goto loop; }</span>
+<span class="cm"> message_head {</span>
+<span class="cm"> ++c;</span>
+<span class="cm"> if (st1) {</span>
+<span class="cm"> printf("%.*s %.*s %.*s\n",</span>
+<span class="cm"> (int)(v2 - v1), v1,</span>
+<span class="cm"> (int)(st2 - st1), st1,</span>
+<span class="cm"> (int)(rp2 - rp1), rp1);</span>
+<span class="cm"> } else if (m1) {</span>
+<span class="cm"> printf("%.*s ", (int)(m2 - m1), m1);</span>
+<span class="cm"> if (of) {</span>
+<span class="cm"> printf("%.*s", (int)(p6 - p5), p5);</span>
+<span class="cm"> if (q3) printf("?%.*s", (int)(q4 - q3), q3);</span>
+<span class="cm"> } else if (au) {</span>
+<span class="cm"> printf("%.*s:", (int)(s2 - s1), s1);</span>
+<span class="cm"> if (p1) printf("//");</span>
+<span class="cm"> if (u1) printf("%.*s@", (int)(u2 - u1), u1);</span>
+<span class="cm"> printf("%.*s", (int)(hs2 - hs1), hs1);</span>
+<span class="cm"> if (r1) printf(":%.*s", (int)(r2 - r1), r1);</span>
+<span class="cm"> if (p1) printf("%.*s", (int)(p2 - p1), p1);</span>
+<span class="cm"> if (p3) printf("%.*s", (int)(p4 - p3), p3);</span>
+<span class="cm"> if (q1) printf("?%.*s", (int)(q2 - q1), q1);</span>
+<span class="cm"> } else if (at) {</span>
+<span class="cm"> if (u3) printf("%.*s@", (int)(u4 - u3), u3);</span>
+<span class="cm"> printf("%.*s", (int)(hs4 - hs3), hs3);</span>
+<span class="cm"> if (r3) printf(":%.*s", (int)(r4 - r3), r3);</span>
+<span class="cm"> } else {</span>
+<span class="cm"> printf("*");</span>
+<span class="cm"> }</span>
+<span class="cm"> printf(" %.*s\n", (int)(v4 - v3), v3);</span>
+<span class="cm"> }</span>
+<span class="cm"> print_headers(in->tok, h1, h2, h3, h4, h5);</span>
+<span class="cm"> printf("\n");</span>
+<span class="cm"> mtagpool_clear(&in->mtp, in);</span>
+<span class="cm"> goto loop;</span>
+<span class="cm"> }</span>
+<span class="cm">*/</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">long</span> <span class="n">count</span><span class="p">;</span>
+ <span class="n">input_t</span> <span class="n">in</span><span class="p">;</span>
+ <span class="n">init_input</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span>
+
+ <span class="k">switch</span> <span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="o">&</span><span class="n">count</span><span class="p">))</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="mi">0</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"ok, parsed %ld HTTPs</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">count</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="k">case</span> <span class="mi">1</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"syntax error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="k">case</span> <span class="mi">2</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"yyfill error</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"panic!</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="k">break</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="n">free_input</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p><a class="reference download internal" href="../_downloads/11_http.dat.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[http.dat]</span></code></a></p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">GET</span> <span class="o">/</span><span class="n">index</span><span class="o">.</span><span class="n">html</span> <span class="n">HTTP</span><span class="o">/</span><span class="mf">1.1</span>
+<span class="n">Host</span><span class="p">:</span> <span class="n">www</span><span class="o">.</span><span class="n">example</span><span class="o">.</span><span class="n">com</span>
+<span class="n">User</span><span class="o">-</span><span class="n">Agent</span><span class="p">:</span> <span class="n">Mozilla</span><span class="o">/</span><span class="mf">5.0</span>
+<span class="n">Accept</span><span class="p">:</span> <span class="n">text</span><span class="o">/</span><span class="n">xml</span><span class="p">,</span><span class="n">application</span><span class="o">/</span><span class="n">xml</span><span class="p">,</span><span class="n">application</span><span class="o">/</span><span class="n">xhtml</span><span class="o">+</span><span class="n">xml</span><span class="p">,</span><span class="n">text</span><span class="o">/</span><span class="n">html</span><span class="o">*/*</span>
+<span class="n">Accept</span><span class="o">-</span><span class="n">Language</span><span class="p">:</span> <span class="n">en</span><span class="o">-</span><span class="n">us</span>
+<span class="n">Accept</span><span class="o">-</span><span class="n">Charset</span><span class="p">:</span> <span class="n">ISO</span><span class="o">-</span><span class="mi">8859</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="n">utf</span><span class="o">-</span><span class="mi">8</span>
+<span class="n">Connection</span><span class="p">:</span> <span class="n">keep</span><span class="o">-</span><span class="n">alive</span>
+
+<span class="n">HTTP</span><span class="o">/</span><span class="mf">1.1</span> <span class="mi">200</span> <span class="n">OK</span>
+<span class="n">Date</span><span class="p">:</span> <span class="n">Thu</span><span class="p">,</span> <span class="mi">24</span> <span class="n">Jul</span> <span class="mi">2008</span> <span class="mi">17</span><span class="p">:</span><span class="mi">36</span><span class="p">:</span><span class="mi">27</span> <span class="n">GMT</span>
+<span class="n">Server</span><span class="p">:</span> <span class="n">Apache</span><span class="o">-</span><span class="n">Coyote</span><span class="o">/</span><span class="mf">1.1</span>
+<span class="n">Content</span><span class="o">-</span><span class="n">Type</span><span class="p">:</span> <span class="n">text</span><span class="o">/</span><span class="n">html</span><span class="p">;</span><span class="n">charset</span><span class="o">=</span><span class="n">UTF</span><span class="o">-</span><span class="mi">8</span>
+<span class="n">Content</span><span class="o">-</span><span class="n">Length</span><span class="p">:</span> <span class="mi">1846</span>
+
+</pre></div>
+</div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --tags -o http_rfc7230.cc http_rfc7230.re
+$ g++ -o http_rfc7230 http_rfc7230.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./http_rfc7230 http.dat
+GET /index.html HTTP/1.1
+Host: www.example.com
+User-Agent: Mozilla/5.0
+Accept: text/xml,application/xml,application/xhtml+xml,text/html*/*
+Accept-Language: en-us
+Accept-Charset: ISO-8859-1,utf-8
+Connection: keep-alive
+
+HTTP/1.1 <span class="m">200</span> OK
+Date: Thu, <span class="m">24</span> Jul <span class="m">2008</span> <span class="m">17</span>:36:27 GMT
+Server: Apache-Coyote/1.1
+Content-Type: text/html<span class="p">;</span><span class="nv">charset</span><span class="o">=</span>UTF-8
+Content-Length: <span class="m">1846</span>
+
+ok, parsed <span class="m">2</span> HTTPs
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Records & structs — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="records-structs">
+<h1>Records & structs<a class="headerlink" href="#records-structs" title="Permalink to this headline">¶</a></h1>
+<p>This example shows how to parse simple non-recursive structures and records.
+It uses both s-tags (for simple fields) and m-tags (for fields that contain multiple elements).
+Our imaginary records describe IRC users.
+Each record consists of a nickname followed by an opening curly brace, a list of attributes (one per line), and a closing curly brace.
+Attributes are name, country and a list of IRC channels.
+Below is an example:</p>
+<p><a class="reference download internal" href="../_downloads/13_records.dat.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[records.dat]</span></code></a></p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">h4cker1970</span> <span class="p">{</span>
+ <span class="n">name</span> <span class="o">=</span> <span class="n">Jon</span> <span class="n">Smith</span>
+ <span class="n">country</span> <span class="o">=</span> <span class="n">UK</span>
+ <span class="n">channels</span> <span class="o">=</span> <span class="n">freenode</span><span class="o">/</span><span class="c1">#gentoo-dev; freenode/#gentoo-arch; freenode/#alpha;</span>
+<span class="p">}</span>
+
+<span class="n">mitek</span> <span class="p">{</span>
+ <span class="n">name</span> <span class="o">=</span> <span class="n">Mitrofan</span> <span class="n">Rygoravich</span>
+ <span class="n">country</span> <span class="o">=</span> <span class="n">Belarus</span>
+ <span class="n">channels</span> <span class="o">=</span> <span class="n">bynets</span><span class="o">/</span><span class="c1">#haskell; freenode/#unix;</span>
+<span class="p">}</span>
+
+</pre></div>
+</div>
+<p><a class="reference download internal" href="../_downloads/13_records.i--tags.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[records.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdlib.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><vector></span><span class="cp"></span>
+
+<span class="k">struct</span> <span class="n">mtag_t</span>
+<span class="p">{</span>
+ <span class="kt">int</span> <span class="n">pred</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">tag</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">mtag_t</span><span class="o">></span> <span class="n">mtagpool_t</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">mtag</span><span class="p">(</span><span class="kt">int</span> <span class="o">*</span><span class="n">pt</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">t</span><span class="p">,</span> <span class="n">mtagpool_t</span> <span class="o">*</span><span class="n">tp</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">mtag_t</span> <span class="n">l</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">pt</span><span class="p">,</span> <span class="n">t</span><span class="p">};</span>
+ <span class="o">*</span><span class="n">pt</span> <span class="o">=</span> <span class="p">(</span><span class="kt">int</span><span class="p">)</span> <span class="n">tp</span><span class="o">-></span><span class="n">size</span><span class="p">();</span>
+ <span class="n">tp</span><span class="o">-></span><span class="n">push_back</span><span class="p">(</span><span class="n">l</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">print_channels</span><span class="p">(</span><span class="k">const</span> <span class="n">mtagpool_t</span> <span class="o">&</span><span class="n">tp</span><span class="p">,</span> <span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="k">return</span><span class="p">;</span>
+ <span class="n">print_channels</span><span class="p">(</span><span class="n">tp</span><span class="p">,</span> <span class="n">tp</span><span class="p">[</span><span class="n">x</span><span class="p">].</span><span class="n">pred</span><span class="p">,</span> <span class="n">tp</span><span class="p">[</span><span class="n">y</span><span class="p">].</span><span class="n">pred</span><span class="p">);</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">px</span> <span class="o">=</span> <span class="n">tp</span><span class="p">[</span><span class="n">x</span><span class="p">].</span><span class="n">tag</span><span class="p">,</span> <span class="o">*</span><span class="n">py</span> <span class="o">=</span> <span class="n">tp</span><span class="p">[</span><span class="n">y</span><span class="p">].</span><span class="n">tag</span><span class="p">;</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" %.*s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="p">(</span><span class="kt">int</span><span class="p">)</span> <span class="p">(</span><span class="n">py</span> <span class="o">-</span> <span class="n">px</span><span class="p">),</span> <span class="n">px</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="cp">#define YYMTAGP(t) mtag(&t, YYCURSOR, &tp)</span>
+<span class="cp">#define YYMTAGN(t) mtag(&t, NULL, &tp)</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">,</span> <span class="o">*</span><span class="n">n1</span><span class="p">,</span> <span class="o">*</span><span class="n">n2</span><span class="p">,</span> <span class="o">*</span><span class="n">a1</span><span class="p">,</span> <span class="o">*</span><span class="n">a2</span><span class="p">,</span> <span class="o">*</span><span class="n">c1</span><span class="p">,</span> <span class="o">*</span><span class="n">c2</span><span class="p">;</span>
+ <span class="n">mtagpool_t</span> <span class="n">tp</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">h1</span><span class="p">,</span> <span class="n">h2</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "const char *@@;"; */</span>
+ <span class="cm">/*!mtags:re2c format = "int @@;"; */</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="n">tp</span><span class="p">.</span><span class="n">clear</span><span class="p">();</span>
+ <span class="cm">/*!mtags:re2c format = "@@ = -1;"; */</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> end = "\x00";</span>
+<span class="cm"> eol = "\n";</span>
+<span class="cm"> wsp = [ \t]*;</span>
+<span class="cm"> eq = wsp "=" wsp;</span>
+<span class="cm"> nick = [a-zA-Z0-9_]+;</span>
+<span class="cm"> name = [A-Z] ("." | [a-z]+);</span>
+<span class="cm"> names = name (wsp name)*;</span>
+<span class="cm"> country = [A-Za-z ]+;</span>
+<span class="cm"> channel = ([a-z0-9-]+ "/")? "#" [a-z0-9-]+;</span>
+
+<span class="cm"> * { printf("error: %s\n", YYCURSOR); return 1; }</span>
+<span class="cm"> end { return 0; }</span>
+<span class="cm"> wsp | eol { goto loop; }</span>
+
+<span class="cm"> @n1 nick @n2 wsp "{" wsp eol</span>
+<span class="cm"> wsp "name" eq @a1 names @a2 wsp eol</span>
+<span class="cm"> wsp "country" eq @c1 country @c2 wsp eol</span>
+<span class="cm"> wsp "channels" eq (wsp #h1 channel #h2 wsp ";")* wsp eol</span>
+<span class="cm"> wsp "}" {</span>
+<span class="cm"> printf("\n%.*s\n", (int) (n2 - n1), n1);</span>
+<span class="cm"> printf(" name: %.*s\n", (int) (a2 - a1), a1);</span>
+<span class="cm"> printf(" country: %.*s\n", (int) (c2 - c1), c1);</span>
+<span class="cm"> printf(" channels:\n");</span>
+<span class="cm"> print_channels(tp, h1, h2);</span>
+<span class="cm"> goto loop;</span>
+<span class="cm"> }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o"><</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"no input files</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="s">"r"</span><span class="p">);</span>
+
+ <span class="n">fseek</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_END</span><span class="p">);</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">fsize</span> <span class="o">=</span> <span class="p">(</span><span class="kt">size_t</span><span class="p">)</span> <span class="n">ftell</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="n">fseek</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_SET</span><span class="p">);</span>
+
+ <span class="kt">char</span> <span class="o">*</span><span class="n">buffer</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="o">*</span><span class="p">)</span> <span class="n">malloc</span><span class="p">(</span><span class="n">fsize</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>
+
+ <span class="n">fread</span><span class="p">(</span><span class="n">buffer</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">fsize</span><span class="p">,</span> <span class="n">file</span><span class="p">);</span>
+ <span class="n">buffer</span><span class="p">[</span><span class="n">fsize</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+ <span class="k">const</span> <span class="kt">int</span> <span class="n">status</span> <span class="o">=</span> <span class="n">lex</span><span class="p">(</span><span class="n">buffer</span><span class="p">);</span>
+
+ <span class="n">fclose</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="n">free</span><span class="p">(</span><span class="n">buffer</span><span class="p">);</span>
+
+ <span class="k">return</span> <span class="n">status</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --tags -o records.cc records.re
+$ g++ -o records records.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./records records.dat
+
+h4cker1970
+ name: Jon Smith
+ country: UK
+ channels:
+ freenode/#gentoo-dev
+ freenode/#gentoo-arch
+ freenode/#alpha
+
+mitek
+ name: Mitrofan Rygoravich
+ country: Belarus
+ channels:
+ bynets/#haskell
+ freenode/#unix
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Options & arguments — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="options-arguments">
+<h1>Options & arguments<a class="headerlink" href="#options-arguments" title="Permalink to this headline">¶</a></h1>
+<p>This example shows how to parse command-line options
+with possible arguments, where each individual option may need its own argument format.
+Our parser handles errors and typos:
+for known options it reports ill-formed arguments;
+for unrecognized options it collects them and reports at the end of parsing.
+Our imaginary options are summarized below:</p>
+<ul class="simple">
+<li><code class="docutils literal notranslate"><span class="pre">-v</span></code>, <code class="docutils literal notranslate"><span class="pre">--verbose</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-l</span> <span class="pre">LIMIT</span></code>, <code class="docutils literal notranslate"><span class="pre">--limit=LIMIT</span></code>, where <code class="docutils literal notranslate"><span class="pre">LIMIT</span></code> is a decimal number followed by one of the suffixes <code class="docutils literal notranslate"><span class="pre">B</span></code>, <code class="docutils literal notranslate"><span class="pre">K</span></code>, <code class="docutils literal notranslate"><span class="pre">M</span></code> or <code class="docutils literal notranslate"><span class="pre">G</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-d</span> <span class="pre">DATE</span></code>, <code class="docutils literal notranslate"><span class="pre">--date=DATE</span></code>, where <code class="docutils literal notranslate"><span class="pre">DATE</span></code> has the form <code class="docutils literal notranslate"><span class="pre">DD/MM/YYYY</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-p</span> <span class="pre">PATH</span></code>, <code class="docutils literal notranslate"><span class="pre">--path=PATH</span></code>, where <code class="docutils literal notranslate"><span class="pre">PATH</span></code> is a <code class="docutils literal notranslate"><span class="pre">/</span></code>-separated file path</li>
+<li><code class="docutils literal notranslate"><span class="pre">-f</span> <span class="pre">FORMAT</span></code>, <code class="docutils literal notranslate"><span class="pre">--format=FORMAT</span></code>, where <code class="docutils literal notranslate"><span class="pre">FORMAT</span></code> is a double-quoted format string</li>
+</ul>
+<p><a class="reference download internal" href="../_downloads/14_options.i--tags.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[options.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><vector></span><span class="cp"></span>
+
+<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">pair</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="o">></span> <span class="n">unknown_t</span><span class="p">;</span>
+
+<span class="k">struct</span> <span class="n">options_t</span>
+<span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">date</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">path</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">format</span><span class="p">;</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">limit</span><span class="p">;</span>
+ <span class="kt">bool</span> <span class="n">verbose</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">show</span><span class="p">(</span><span class="k">const</span> <span class="n">options_t</span> <span class="o">&</span><span class="n">o</span><span class="p">,</span> <span class="k">const</span> <span class="n">unknown_t</span> <span class="o">&</span><span class="n">u</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">options:</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" date: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">date</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" path: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">path</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" format: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">format</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" limit: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">limit</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" verbose: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">o</span><span class="p">.</span><span class="n">verbose</span> <span class="o">?</span> <span class="s">"yes"</span> <span class="o">:</span> <span class="s">"no"</span><span class="p">);</span>
+
+ <span class="n">printf</span><span class="p">(</span><span class="s">"</span><span class="se">\n</span><span class="s">unknown:</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="n">unknown_t</span><span class="o">::</span><span class="n">const_iterator</span> <span class="n">i</span> <span class="o">=</span> <span class="n">u</span><span class="p">.</span><span class="n">begin</span><span class="p">(),</span> <span class="n">e</span> <span class="o">=</span> <span class="n">u</span><span class="p">.</span><span class="n">end</span><span class="p">();</span>
+ <span class="k">for</span> <span class="p">(;</span> <span class="n">i</span> <span class="o">!=</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">" %s: '%s'</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">i</span><span class="o">-></span><span class="n">first</span><span class="p">.</span><span class="n">c_str</span><span class="p">(),</span> <span class="n">i</span><span class="o">-></span><span class="n">second</span><span class="p">.</span><span class="n">c_str</span><span class="p">());</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">bad_arg</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">k</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">v</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">e</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"bad argument '%.*s' to option %.*s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span>
+ <span class="p">(</span><span class="kt">int</span><span class="p">)</span> <span class="p">(</span><span class="n">e</span> <span class="o">-</span> <span class="n">v</span><span class="p">),</span> <span class="n">v</span><span class="p">,</span> <span class="p">(</span><span class="kt">int</span><span class="p">)</span> <span class="p">(</span><span class="n">v</span> <span class="o">-</span> <span class="n">k</span><span class="p">),</span> <span class="n">k</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">options_t</span> <span class="n">o</span><span class="p">;</span>
+ <span class="n">unknown_t</span> <span class="n">u</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">m</span><span class="p">,</span> <span class="o">*</span><span class="n">k</span><span class="p">,</span> <span class="o">*</span><span class="n">v</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = 'const char *@@;'; */</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYCURSOR = s;</span>
+<span class="cm"> re2c:define:YYMARKER = m;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> end = "\x00";</span>
+<span class="cm"> sp = [ \t\n\r];</span>
+<span class="cm"> eq = "=";</span>
+<span class="cm"> wsp = sp*;</span>
+<span class="cm"> char = [^=] \ end;</span>
+<span class="cm"> ochar = char \ sp;</span>
+<span class="cm"> pchar = ochar \ [/];</span>
+<span class="cm"> str = ["] (char \ ["] | [\]["])* ["];</span>
+<span class="cm"> opt = ochar+;</span>
+<span class="cm"> arg = ochar* | str;</span>
+<span class="cm"> date = [0-9]{2} "/" [0-9]{2} "/" [0-9]{4};</span>
+<span class="cm"> path = pchar* ("/" pchar*)*;</span>
+<span class="cm"> format = str;</span>
+<span class="cm"> limit = [0-9]+ [BKMG]?;</span>
+
+<span class="cm"> * { printf("error: %s\n", s); return 1; }</span>
+<span class="cm"> end { show(o, u); return 0; }</span>
+<span class="cm"> wsp { goto loop; }</span>
+
+<span class="cm"> "-v" | "--verbose" { o.verbose = true; goto loop; }</span>
+<span class="cm"> ("-l" | "--limit" eq) @v limit { o.limit = std::string(v, s); goto loop; }</span>
+<span class="cm"> ("-f" | "--format" eq) @v str { o.format = std::string(v, s); goto loop; }</span>
+<span class="cm"> ("-d" | "--date" eq) @v date { o.date = std::string(v, s); goto loop; }</span>
+<span class="cm"> ("-p" | "--path" eq) @v path { o.path = std::string(v, s); goto loop; }</span>
+
+<span class="cm"> @k ("--" ("limit" | "format" | "date" | "path") | "-" [lfdp]) @v eq? arg {</span>
+<span class="cm"> bad_arg(k, v, s);</span>
+<span class="cm"> goto loop;</span>
+<span class="cm"> }</span>
+<span class="cm"> [-]{1,2} @k opt @v eq? arg {</span>
+<span class="cm"> u.push_back(std::make_pair(std::string(k, v), std::string(v, s)));</span>
+<span class="cm"> goto loop;</span>
+<span class="cm"> }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">argc</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="n">lex</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --tags -o options.cc options.re
+$ g++ -o options options.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./options <span class="s1">'-v --limit=8K -d08/08/1985 -p/usr/src/linux --format="%s" --limit -f=3 --verbos --d"19th May"'</span>
+bad argument <span class="s1">''</span> to option --limit
+bad argument <span class="s1">'=3'</span> to option -f
+
+options:
+ date: <span class="m">08</span>/08/1985
+ path: /usr/src/linux
+ format: <span class="s2">"%s"</span>
+ limit: 8K
+ verbose: yes
+
+unknown:
+ verbos: <span class="s1">''</span>
+ d: <span class="s1">'"19th May"'</span>
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Strings in binaries — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="strings-in-binaries">
+<h1>Strings in binaries<a class="headerlink" href="#strings-in-binaries" title="Permalink to this headline">¶</a></h1>
+<p>The program below searches all strings starting with double underscore in the given binary file.
+The same method can be used to search for arbitrary signatures or keywords.
+Since we are dealing with a <em>binary</em> file, we cannot use the sentinel method to check for the end of input:
+binary files can contain all kinds of characters, so no sentinel can be chosen.
+The usual way in such cases is to use <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code>-based checking: it requires padding input with <code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code> fake characters,
+but it’s not a problem since the input is buffered anyway.</p>
+<p>However, this exampe takes another approach:
+it uses generic API to override the default checking mechanism.
+First, it disables the usual mechanism: suppresses the generation of <code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span></code> and <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> with <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code> configuration.
+Second, it redefines <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> to perform checking before advancing to the next input character.
+In principle, this approach is less efficient:
+checking happens more frequently, as <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> is invoked on each input character,
+while <code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span></code> happens only once per each strongly connected component of automaton.
+However, it allows to avoid padding.</p>
+<p><a class="reference download internal" href="../_downloads/15_binsyms.i--input(custom).re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[binsyms.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdlib.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">cur</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">lim</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">mar</span><span class="p">,</span> <span class="o">*</span><span class="n">tok</span><span class="p">;</span>
+<span class="cp"># define YYCTYPE char</span>
+<span class="cp"># define YYPEEK() *cur</span>
+<span class="cp"># define YYSKIP() if (++cur == lim) return;</span>
+<span class="cp"># define YYBACKUP() mar = cur</span>
+<span class="cp"># define YYRESTORE() cur = mar</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="n">tok</span> <span class="o">=</span> <span class="n">cur</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> * { goto loop; }</span>
+<span class="cm"> "__" [a-zA-Z0-9_]+ {</span>
+<span class="cm"> printf("%.*s\n", (int) (cur - tok), tok);</span>
+<span class="cm"> goto loop;</span>
+<span class="cm"> }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o"><</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"no input files</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">file</span> <span class="o">==</span> <span class="nb">NULL</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">fprintf</span><span class="p">(</span><span class="n">stderr</span><span class="p">,</span> <span class="s">"cannot open file</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+
+ <span class="n">fseek</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_END</span><span class="p">);</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">fsize</span> <span class="o">=</span> <span class="p">(</span><span class="kt">size_t</span><span class="p">)</span> <span class="n">ftell</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="n">fseek</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">SEEK_SET</span><span class="p">);</span>
+
+ <span class="kt">char</span> <span class="o">*</span><span class="n">buffer</span> <span class="o">=</span> <span class="p">(</span><span class="kt">char</span><span class="o">*</span><span class="p">)</span> <span class="n">malloc</span><span class="p">(</span><span class="n">fsize</span><span class="p">);</span>
+ <span class="n">fread</span><span class="p">(</span><span class="n">buffer</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">fsize</span><span class="p">,</span> <span class="n">file</span><span class="p">);</span>
+ <span class="n">lex</span><span class="p">(</span><span class="n">buffer</span><span class="p">,</span> <span class="n">buffer</span> <span class="o">+</span> <span class="n">fsize</span><span class="p">);</span>
+
+ <span class="n">free</span><span class="p">(</span><span class="n">buffer</span><span class="p">);</span>
+ <span class="n">fclose</span><span class="p">(</span><span class="n">file</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --input custom -o binsyms.cc binsyms.re
+$ g++ -o binsyms binsyms.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./binsyms binsyms
+__gmon_start__
+__libc_start_main
+__off_t
+__cxx11
+__gnu_cxx3divExx
+__off64_t
+__pad1
+__pad2
+__pad3
+__pad4
+__pad5
+__compar_fn_t
+__gnu_cxx
+__init_array_start
+__libc_csu_fini
+__libc_csu_init
+__init_array_end
+__GNU_EH_FRAME_HDR
+__init_array_end
+__init_array_start
+__libc_csu_fini
+__gmon_start__
+__libc_start_main
+__data_start
+__TMC_END__
+__dso_handle
+__libc_csu_init
+__bss_start
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Fake sentinel — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="fake-sentinel">
+<h1>Fake sentinel<a class="headerlink" href="#fake-sentinel" title="Permalink to this headline">¶</a></h1>
+<p>This example explores the case when we know the <em>length</em> of input,
+but there is no terminating character and buffering is not possible.
+In such cases we cannot use the usual sentinel method; and we cannot use <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code>-based method as it requires <code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code> padding.
+The choiche then is to use generic API:
+disable the default cheching mechanism with <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code>
+and use one of the primitives <code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> and <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> to check for the end of input.</p>
+<p>In this example we use <code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> to emulate <em>fake sentinel</em>:
+every time the lexer peeks a new character, it first checks for the end of input:
+if it has already been reached, <code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> returns <code class="docutils literal notranslate"><span class="pre">NULL</span></code> (though the actual string has no terminating <code class="docutils literal notranslate"><span class="pre">NULL</span></code>).
+Checking on every <code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> is less efficient than the usual sentinel method
+(which performs no checking at all), but it can be more efficient than copying input to buffer and padding it with a real sentinel character.</p>
+<p>Note that fake sentinel method also relies on the fact that sentinel cannot appear in the middle of well-formed input.
+If the input can contain arbitrary characters, then one should utilize <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> as shown in <a class="reference external" href="example_15.html">this example</a>.</p>
+<p><a class="reference download internal" href="../_downloads/16_fake_sentinel.i--input(custom).re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[fake_sentinel.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">cur</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">lim</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">mar</span><span class="p">,</span> <span class="o">*</span><span class="n">tok</span> <span class="o">=</span> <span class="n">cur</span><span class="p">;</span>
+<span class="cp"># define YYCTYPE char</span>
+<span class="cp"># define YYPEEK() (cur < lim ? *cur : 0)</span>
+<span class="cp"># define YYSKIP() ++cur</span>
+<span class="cp"># define YYBACKUP() mar = cur</span>
+<span class="cp"># define YYRESTORE() cur = mar</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> * { printf("error\n"); return 1; }</span>
+<span class="cm"> [0-9a-zA-Z]+ [;] [\x00] {</span>
+<span class="cm"> printf("%.*s\n", (int) (cur - tok) - 1, tok);</span>
+<span class="cm"> return 0;</span>
+<span class="cm"> }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o">!=</span> <span class="mi">2</span><span class="p">)</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+
+ <span class="kt">char</span> <span class="o">*</span><span class="n">s</span> <span class="o">=</span> <span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">];</span>
+ <span class="kt">size_t</span> <span class="n">l</span> <span class="o">=</span> <span class="n">strlen</span><span class="p">(</span><span class="n">s</span><span class="p">);</span>
+ <span class="n">s</span><span class="p">[</span><span class="n">l</span><span class="p">]</span> <span class="o">=</span> <span class="sc">';'</span><span class="p">;</span> <span class="c1">// overwrite terminating NULL</span>
+ <span class="k">return</span> <span class="n">lex</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">s</span> <span class="o">+</span> <span class="n">l</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --input custom -o fake_sentinel.cc fake_sentinel.re
+$ g++ -o fake_sentinel fake_sentinel.cc
+</pre></div>
+</div>
+<p>Run:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./fake_sentinel somestring
+somestring<span class="p">;</span>
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>std::ifstream — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="std-ifstream">
+<h1>std::ifstream<a class="headerlink" href="#std-ifstream" title="Permalink to this headline">¶</a></h1>
+<p>This example shows how to override re2c input mechanism:
+instead of reading input characters from a buffer in memory, read them directly from file using STL <code class="docutils literal notranslate"><span class="pre">std::ifstream</span></code> class.
+Note that we use <code class="docutils literal notranslate"><span class="pre">tellg</span></code> / <code class="docutils literal notranslate"><span class="pre">seekg</span></code> and rely on the ability to move backward and forward in the input stream:
+this might not be possible, for example with <code class="docutils literal notranslate"><span class="pre">stdin</span></code> stream.
+The program below converts Windows-style line endings <code class="docutils literal notranslate"><span class="pre">CR</span> <span class="pre">LF</span></code> to Unix-style line endings <code class="docutils literal notranslate"><span class="pre">LF</span></code>.</p>
+<p>This program uses a non-standard way of checking for the end of input:
+it disables the usual cheching mechnism with <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code>
+(this suppresses the generation of <code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span></code> and <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>)
+and puts the responsibility for checking on <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code>.
+This results in more frequent checks: <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> is happens on each input character,
+while <code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span></code> happens only once per each strongly connected component of automaton.
+However, this method allows to avoid padding, which would require buffering input and nullify all advantages of direct-file input.</p>
+<p><a class="reference download internal" href="../_downloads/17_ifstream.i--input(custom).re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[ifstream.re]</span></code></a></p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><fstream></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">conv</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">ifstream</span> <span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="n">std</span><span class="o">::</span><span class="n">ofstream</span> <span class="o">&</span><span class="n">out</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">streampos</span> <span class="n">mar</span><span class="p">;</span>
+<span class="cp"># define YYCTYPE char</span>
+<span class="cp"># define YYPEEK() in.peek()</span>
+<span class="cp"># define YYSKIP() do { in.ignore(); if (in.eof()) return; } while(0)</span>
+<span class="cp"># define YYBACKUP() mar = in.tellg()</span>
+<span class="cp"># define YYRESTORE() in.seekg(mar)</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> * { out.put(yych); goto loop; }</span>
+<span class="cm"> "\r\n" { out.put('\n'); goto loop; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o">!=</span> <span class="mi">3</span><span class="p">)</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+
+ <span class="n">std</span><span class="o">::</span><span class="n">ifstream</span> <span class="n">in</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">std</span><span class="o">::</span><span class="n">ios</span><span class="o">::</span><span class="n">binary</span><span class="p">);</span>
+ <span class="n">std</span><span class="o">::</span><span class="n">ofstream</span> <span class="n">out</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="n">std</span><span class="o">::</span><span class="n">ios</span><span class="o">::</span><span class="n">binary</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="p">.</span><span class="n">fail</span><span class="p">()</span> <span class="o">||</span> <span class="n">out</span><span class="p">.</span><span class="n">fail</span><span class="p">())</span> <span class="k">return</span> <span class="mi">2</span><span class="p">;</span>
+
+ <span class="n">conv</span><span class="p">(</span><span class="n">in</span><span class="p">,</span> <span class="n">out</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Compile:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c --input custom -o ifstream.cc ifstream.re
+$ g++ -o ifstream ifstream.cc
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title><no title> — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="toctree-wrapper compound">
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="example_04.html">Parsing integers with multiple interrelated blocks</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_05.html">Parsing integers with start conditions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_09.html">Parsing /etc/passwd with tags</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_14.html">Parsing options and arguments with tags</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_13.html">Parsing records and structs with tags</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_07.html">C++98 lexer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_10.html">Parsing URI (RFC-3986)</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_11.html">Parsing HTTP message headers (RFC-7230)</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_06.html">Parsing Braille patterns with multiple encodings</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_15.html">Finding strings in binaries with generic API</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_16.html">Faking sentinel characted with generic API</a></li>
+<li class="toctree-l1"><a class="reference internal" href="example_17.html">Reading from std::ifstream with generic API</a></li>
+</ul>
+</div>
+<p>All examples are written in C-90 and in C++98, so they should be portable.
+Feel free to <a class="reference external" href="mailto:re2c-general%40lists.sourceforge.net">report bugs</a>.</p>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title>re2c</title>
+ <link rel="self" href="http://re2c.org/feed/atom.xml"/>
+ <id>http://re2c.org/</id>
+ <updated>2016-01-21T00:00:00Z</updated>
+
+ <entry>
+ <title>Release 0.15</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-0-15"/>
+ <id>http://re2c.org/releases/release_notes.html#release-0-15</id>
+ <updated>2015-11-22T00:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Major release re2c-0.15 (<a href="http://re2c.org/releases/release_notes.html#release-0-15">release notes</a>). :)
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+ <entry>
+ <title>Release 0.15.1</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-0-15-1"/>
+ <id>http://re2c.org/releases/release_notes.html#release-0-15-1</id>
+ <updated>2015-11-23T00:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Minor release re2c-0.15.1 (<a href="http://re2c.org/releases/release_notes.html#release-0-15-1">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+ <entry>
+ <title>Release 0.15.2</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-0-15-2"/>
+ <id>http://re2c.org/releases/release_notes.html#release-0-15-2</id>
+ <updated>2015-11-23T22:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Minor release re2c-0.15.2 (<a href="http://re2c.org/releases/release_notes.html#release-0-15-2">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+ <entry>
+ <title>Release 0.15.3</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-0-15-3"/>
+ <id>http://re2c.org/releases/release_notes.html#release-0-15-3</id>
+ <updated>2015-12-02T00:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Minor release re2c-0.15.3 (<a href="http://re2c.org/releases/release_notes.html#release-0-15-3">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+ <entry>
+ <title>Release 0.16</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-0-16"/>
+ <id>http://re2c.org/releases/release_notes.html#release-0-16</id>
+ <updated>2016-01-21T00:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Major release re2c-0.16 (<a href="http://re2c.org/releases/release_notes.html#release-0-16">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+ <entry>
+ <title>Release 1.0</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-0"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-0</id>
+ <updated>2017-08-11T00:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Release re2c-1.0! (<a href="http://re2c.org/releases/release_notes.html#release-1-0">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+
+ <entry>
+ <title>Release 1.0.1</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-0-1"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-0-1</id>
+ <updated>2017-08-14T09:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Release re2c-1.0.1! (<a href="http://re2c.org/releases/release_notes.html#release-1-0-1">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+
+ <entry>
+ <title>Release 1.0.2</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-0-2"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-0-2</id>
+ <updated>2017-08-26T22:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Another small release re2c-1.0.2! (<a href="http://re2c.org/releases/release_notes.html#release-1-0-2">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+
+ <entry>
+ <title>Release 1.0.3</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-0-3"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-0-3</id>
+ <updated>2017-11-08T22:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Yet another small release re2c-1.0.3 :) (<a href="http://re2c.org/releases/release_notes.html#release-1-0-3">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+
+ <entry>
+ <title>Release 1.1</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-1"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-1</id>
+ <updated>2018-08-27T23:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Release re2c-1.1 (<a href="http://re2c.org/releases/release_notes.html#release-1-1">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+
+ <entry>
+ <title>Release 1.1.1</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-1-1"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-1-1</id>
+ <updated>2018-08-30T23:30:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Release re2c-1.1.1 (<a href="http://re2c.org/releases/release_notes.html#release-1-1-1">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+
+ <entry>
+ <title>Release 1.2</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-2"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-2</id>
+ <updated>2019-08-02T00:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Major release re2c-1.2 (<a href="http://re2c.org/releases/release_notes.html#release-1-2">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+
+ <entry>
+ <title>Release 1.2.1</title>
+ <link href="http://re2c.org/releases/release_notes.html#release-1-2-1"/>
+ <id>http://re2c.org/releases/release_notes.html#release-1-2-1</id>
+ <updated>2019-08-11T00:00:00Z</updated>
+ <summary type="xhtml">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ Minor release re2c-1.2.1 (<a href="http://re2c.org/releases/release_notes.html#release-1-2-1">release notes</a>).
+ </div>
+ </summary>
+ <author>
+ <name>Ulya Trofimovich</name>
+ <email>skvadrik@gmail.com</email>
+ </author>
+ </entry>
+
+</feed>
--- /dev/null
+
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Index — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <link rel="shortcut icon" href="_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper">
+<div id="searchbox" style="display: none" role="search">
+ <h3>Quick search</h3>
+ <div class="searchformwrapper">
+ <form class="search" action="search.html" method="get">
+ <input type="text" name="q" />
+ <input type="submit" value="Go" />
+ <input type="hidden" name="check_keywords" value="yes" />
+ <input type="hidden" name="area" value="default" />
+ </form>
+ </div>
+</div>
+<script type="text/javascript">$('#searchbox').show(0);</script>
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+
+<h1 id="index">Index</h1>
+
+<div class="genindex-jumpbox">
+
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>re2c — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <link rel="shortcut icon" href="_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3>Documentation</h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+<h3>Home</h3>
+<div class="re2c-toc-local">
+ <ul>
+<li><a class="reference internal" href="#">re2c</a><ul>
+<li><a class="reference internal" href="#download">Download</a></li>
+<li><a class="reference internal" href="#bugs-patches">Bugs & patches</a></li>
+<li><a class="reference internal" href="#papers">Papers</a></li>
+<li><a class="reference internal" href="#authors">Authors</a></li>
+<li><a class="reference internal" href="#license">License</a></li>
+<li><a class="reference internal" href="#version">Version</a></li>
+</ul>
+</li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="re2c">
+<h1>re2c<a class="headerlink" href="#re2c" title="Permalink to this headline">¶</a></h1>
+<div class="toctree-wrapper compound">
+</div>
+<p>Re2c is a free and open-source lexer generator for C and C++.
+The main goal of the project is to generate <em>very fast</em> lexers that match or
+exceed the speed of carefully optimized hand-written code. Instead of using
+traditional table-driven approach, re2c encodes the underlying finite state
+automata directly in the form of conditional jumps and applies numerous optimizations to the generated code.
+The resulting programs are faster and often smaller than their table-driven counterparts, and they
+are much easier to debug and understand.
+Re2c has an unusual <em>flexible user interface</em>:
+instead of assuming a fixed program template, it leaves the definition of
+the interface code to the user and allows to configure almost every aspect of the generated
+code. This gives the users a lot of freedom in the way they bind the
+lexer to their particular environment and allows them to decide on the optimal input model.
+Re2c supports <em>fast and lightweight submatch extraction</em>
+which does not requre the overhead on full parsing — a feature that is rarely found in the wild.
+Re2c is used by many other projects
+(such as
+<a class="reference external" href="http://php.net/">php</a>,
+<a class="reference external" href="https://ninja-build.org/">ninja</a>,
+<a class="reference external" href="http://yasm.tortall.net/">yasm</a>,
+<a class="reference external" href="https://spamassassin.apache.org/">spamassassin</a>,
+<a class="reference external" href="http://brlcad.org/">BRL-CAD</a>
+and <a class="reference external" href="https://github.com/sifive/wake">wake</a>)
+and aims at being fully backward compatible.
+On the other hand, it is a research project and a playground for the development of new algorithms in the field of formal grammars and automata.</p>
+<p><a class="reference external" href="feed/atom.xml"><img alt="feed" class="feed" src="_images/feed.png" style="width: 2em;" /></a> <a class="reference external" href="feed/atom.xml">Subscribe</a> to receive the latest news and updates.
+See the <a class="reference external" href="manual/manual.html">user manual</a> for a complete overview with
+examples.</p>
+<div class="section" id="download">
+<h2>Download<a class="headerlink" href="#download" title="Permalink to this headline">¶</a></h2>
+<p>You can get the
+<a class="reference external" href="https://github.com/skvadrik/re2c/releases/latest">latest release</a> on Github,
+as well as the <a class="reference external" href="https://github.com/skvadrik/re2c/releases">older releases</a>
+(make sure you download the latest minor version in each series).
+Many Linux distributions and other systems provide their own packages.
+Re2c source code is hosted on both Github
+(<a class="reference external" href="https://github.com/skvadrik/re2c">https://github.com/skvadrik/re2c</a>) and SourceForge
+(<a class="reference external" href="https://sourceforge.net/p/re2c">https://sourceforge.net/p/re2c</a>).
+Github serves as the main repository, bugtracker and tarball hosting.
+SourceForge is used as a backup repository and email hosting.</p>
+</div>
+<div class="section" id="bugs-patches">
+<h2>Bugs & patches<a class="headerlink" href="#bugs-patches" title="Permalink to this headline">¶</a></h2>
+<p>Please send bugs reports, patches and other feedback to <a class="reference external" href="https://github.com/skvadrik/re2c">github issue tracker</a> or email them to
+<a class="reference external" href="mailto:re2c-devel%40lists.sourceforge.net">re2c-devel<span>@</span>lists<span>.</span>sourceforge<span>.</span>net</a> and
+<a class="reference external" href="mailto:re2c-general%40lists.sourceforge.net">re2c-general<span>@</span>lists<span>.</span>sourceforge<span>.</span>net</a>
+mailing lists.
+Re2c has an IRC channel <code class="docutils literal notranslate"><span class="pre">#re2c</span></code> on <a class="reference external" href="https://freenode.net">freenode</a>.
+Re2c developers are happy to answer questions and provide help.
+Contributions are always welcome!</p>
+</div>
+<div class="section" id="papers">
+<h2>Papers<a class="headerlink" href="#papers" title="Permalink to this headline">¶</a></h2>
+<ul class="simple">
+<li><a class="reference external" href="1994_bumbulis_cowan_re2c_a_more_versatile_scanner_generator.ps">“RE2C: a more versatile scanner generator”</a>
+by Peter Bumbulis and Donald D. Cowan,
+ACM Letters on Programming Languages and Systems (LOPLAS),
+1994</li>
+<li><a class="reference external" href="2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">“Tagged Deterministic Finite Automata with Lookahead”</a>
+by Ulya Trofimovich,
+arXiv:1907.08837,
+2017</li>
+<li><a class="reference external" href="2019_borsotti_trofimovich_efficient_posix_submatch_extraction_on_nfa.pdf">“Efficient POSIX submatch extraction on NFA”</a>
+by Angelo Borsotti and Ulya Trofimovich,
+2019</li>
+</ul>
+</div>
+<div class="section" id="authors">
+<h2>Authors<a class="headerlink" href="#authors" title="Permalink to this headline">¶</a></h2>
+<p>Re2c was originally written by Peter Bumbulis (<a class="reference external" href="mailto:peter%40csg.uwaterloo.ca">peter<span>@</span>csg<span>.</span>uwaterloo<span>.</span>ca</a>) in 1993.
+Since then it has been maintained and developed by multiple volunteers,
+most notably,
+Brian Young (<a class="reference external" href="mailto:bayoung%40acm.org">bayoung<span>@</span>acm<span>.</span>org</a>),
+Markus Boerger (<a class="reference external" href="mailto:helly%40users.sourceforge.net">helly<span>@</span>users<span>.</span>sourceforge<span>.</span>net</a>),
+Dan Nuffer (<a class="reference external" href="mailto:nuffer%40users.sourceforge.net">nuffer<span>@</span>users<span>.</span>sourceforge<span>.</span>net</a>)
+and Ulya Trofimovich (<a class="reference external" href="mailto:skvadrik%40gmail.com">skvadrik<span>@</span>gmail<span>.</span>com</a>).
+Other re2c contributors are
+Derick Rethans,
+Emmanuel Mogenet,
+Hartmut Kaiser,
+jcfp,
+joscherl,
+Mike Gilbert,
+Nerd,
+nuno-lopes,
+Oleksii Taran,
+Peter Bumbulis,
+Petr Skocik,
+Paulo Custodio,
+Ross Burton,
+Ryan Mast,
+Serghei Iakovlev,
+Sergei Trofimovich
+and Tim Kelly
+(apologies if someone is missing).</p>
+</div>
+<div class="section" id="license">
+<h2>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2>
+<p>Re2c is in the public domain. The data structures and algorithms used
+in re2c are all either taken from documents available to the general
+public or are inventions of the author. Programs generated by re2c may
+be distributed freely. Re2c itself may be distributed freely, in source
+or binary, unchanged or modified. Distributors may charge whatever fees
+they can obtain for re2c. If you do make use of re2c, or incorporate it into a larger project an
+acknowledgement somewhere (documentation, research report, etc.) would
+be appreciated.
+Re2c is distributed with no warranty whatsoever.
+The code is certain to contain errors.
+Neither the author nor any contributor takes responsibility for any consequences of its use.</p>
+</div>
+<div class="section" id="version">
+<h2>Version<a class="headerlink" href="#version" title="Permalink to this headline">¶</a></h2>
+<p>This website describes re2c version 1.2.</p>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Build instructions — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+ <h3>Build instructions</h3>
+ <div class="re2c-toc-local">
+ <ul>
+<li><a class="reference internal" href="#">Build instructions</a><ul>
+<li><a class="reference internal" href="#dependencies">Dependencies</a></li>
+<li><a class="reference internal" href="#building">Building</a></li>
+<li><a class="reference internal" href="#testing">Testing</a></li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="build-instructions">
+<h1>Build instructions<a class="headerlink" href="#build-instructions" title="Permalink to this headline">¶</a></h1>
+<div class="toctree-wrapper compound">
+</div>
+<div class="section" id="dependencies">
+<h2>Dependencies<a class="headerlink" href="#dependencies" title="Permalink to this headline">¶</a></h2>
+<p>Re2c users need only a C++ compiler to build re2c from a release tarball, and
+optionally Bash if they want to run the tests.</p>
+<p>Re2c developers also need Autotools, Bison (if they change parser code), rst2man
+(if they change documentation), Sphinx (if they change this website), Mingw and
+Wine (if they test builds for Windows) and Libtool (if they change the
+experimental libre2c library). A few occasional helper scripts are written in
+Haskell (but they are not necessary for re2c development).
+Re2c is a bootstrapping project with all the consequences.</p>
+</div>
+<div class="section" id="building">
+<h2>Building<a class="headerlink" href="#building" title="Permalink to this headline">¶</a></h2>
+<p>If you are building re2c from repository, <em>not</em> from a release tarball, first of
+all you should run Autotools:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ autoreconf -i -W all
+</pre></div>
+</div>
+<p>The simplest possible build is an in-tree build (will install re2c to
+<code class="docutils literal notranslate"><span class="pre">$RE2C_PATH</span></code> location):</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./configure --prefix<span class="o">=</span><span class="nv">$RE2C_PATH</span>
+$ make
+$ make install
+</pre></div>
+</div>
+<p>Out-of-tree build (puts build artifacts in a separate directory):</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ mkdir <span class="nv">$BUILD_DIR</span>
+$ <span class="nb">cd</span> <span class="nv">$BUILD_DIR</span>
+$ ../configure --prefix<span class="o">=</span><span class="nv">$RE2C_PATH</span>
+$ make
+$ make install
+</pre></div>
+</div>
+<p>Bootstrapping build (rebuilds re2c with the freshly built re2c and updates
+precompiled bootstrap files):</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make bootstrap
+</pre></div>
+</div>
+<p>Building on Windows is more tricky. The best option is to use
+<a class="reference external" href="https://cygwin.com/">Cygwin</a>, or build re2c with <a class="reference external" href="http://mingw.org/">Mingw</a>
+(Mingw builds are supported and tested regularly).
+For some Mingw versions you might have to use <code class="docutils literal notranslate"><span class="pre">-std=gnu++11</span></code> compiler option
+to avoid spurious build errors (re2c uses <code class="docutils literal notranslate"><span class="pre">-std=c++98</span></code> by default).</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./configure --host i686-w64-ming <span class="m">32</span> <span class="nv">CXXFLAGS</span><span class="o">=</span><span class="s2">"-std=gnu++11"</span>
+</pre></div>
+</div>
+<p>To build documentation:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./configure --enable-docs
+</pre></div>
+</div>
+<p>To enable debug:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./configure --enable-debug
+</pre></div>
+</div>
+<p>To build the experimental libre2c library:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./configure --enable-libs
+</pre></div>
+</div>
+<p>Re2c provides a bunch of build scripts <code class="docutils literal notranslate"><span class="pre">__build_*.sh</span></code> that can be used
+for specialized builds with <code class="docutils literal notranslate"><span class="pre">GLIBCXX_DEBUG</span></code>, AddressSanitizer, etc.</p>
+</div>
+<div class="section" id="testing">
+<h2>Testing<a class="headerlink" href="#testing" title="Permalink to this headline">¶</a></h2>
+<p>Re2c has a main test suite and a couple of small unit tests. Run them all:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make check
+</pre></div>
+</div>
+<p>Run only the main test suite and watch the progress dumped on <code class="docutils literal notranslate"><span class="pre">stdout</span></code>:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./run_tests.sh -j<N>
+</pre></div>
+</div>
+<p>Run the main test suite with <code class="docutils literal notranslate"><span class="pre">--skeleton</span></code> re2c option:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ ./run_tests.sh --skeleton
+</pre></div>
+</div>
+<p>Run the test suite under Valgrind (takes some time and memory):</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make vtests
+</pre></div>
+</div>
+<p>Test mingw builds with Wine:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make wtests
+</pre></div>
+</div>
+<p>Check the distribution:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make distcheck
+</pre></div>
+</div>
+<p>Re2c provides a helper script <code class="docutils literal notranslate"><span class="pre">__alltest.sh</span></code> that builds and tests various
+re2c build flavours with <code class="docutils literal notranslate"><span class="pre">GLIBCXX_DEBUG</span></code>, AddressSanitizer, etc.
+There is a couple of fuzz-testing Haskell scripts in the <code class="docutils literal notranslate"><span class="pre">fuzz</span></code> subdirectory;
+they are based on the QuickCheck library and can be easily modified to fuzz-test
+various aspects of re2c by comparing current re2c version against older versions
+or against other regular expression libraries.</p>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title><no title> — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <p>Below is an example of generating a picture of DFA that accepts any UTF-8 code point
+(<code class="docutils literal notranslate"><span class="pre">utf8_any.re</span></code>):</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> [^] {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</div>
+<p>Generate and render:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -D -8 utf8_any.re | dot -Tpng -o utf8_any.png
+</pre></div>
+</div>
+<p>Here is the picture:</p>
+<a class="reference internal image-reference" href="../../_images/utf8_any.png"><img alt="../../_images/utf8_any.png" src="../../_images/utf8_any.png" style="width: 90%;" /></a>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>User manual — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1 current"><a class="current reference internal" href="#">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+ <h3>User manual</h3>
+ <div class="re2c-toc-local">
+ <ul>
+<li><a class="reference internal" href="#">User manual</a><ul>
+<li><a class="reference internal" href="#syntax">Syntax</a><ul>
+<li><a class="reference internal" href="#a-basic-example">A basic example</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#regular-expressions">Regular expressions</a></li>
+<li><a class="reference internal" href="#user-interface">User interface</a><ul>
+<li><a class="reference internal" href="#default-api">Default API</a></li>
+<li><a class="reference internal" href="#generic-api">Generic API</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#directives">Directives</a></li>
+<li><a class="reference internal" href="#options">Options</a></li>
+<li><a class="reference internal" href="#configurations">Configurations</a></li>
+<li><a class="reference internal" href="#eof-handling">EOF handling</a><ul>
+<li><a class="reference internal" href="#using-sentinel-symbol">Using sentinel symbol</a></li>
+<li><a class="reference internal" href="#bounds-checking-with-padding">Bounds checking with padding</a></li>
+<li><a class="reference internal" href="#eof-rule">EOF rule</a></li>
+<li><a class="reference internal" href="#using-generic-api">Using generic API</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#buffer-refilling">Buffer refilling</a><ul>
+<li><a class="reference internal" href="#yyfill-with-eof-rule">YYFILL with EOF rule</a></li>
+<li><a class="reference internal" href="#yyfill-with-padding">YYFILL with padding</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#include-files">Include files</a></li>
+<li><a class="reference internal" href="#header-files">Header files</a></li>
+<li><a class="reference internal" href="#submatch-extraction">Submatch extraction</a></li>
+<li><a class="reference internal" href="#storable-state">Storable state</a></li>
+<li><a class="reference internal" href="#reusable-blocks">Reusable blocks</a></li>
+<li><a class="reference internal" href="#encoding-support">Encoding support</a></li>
+<li><a class="reference internal" href="#start-conditions">Start conditions</a></li>
+<li><a class="reference internal" href="#skeleton-programs">Skeleton programs</a></li>
+<li><a class="reference internal" href="#visualization-and-debug">Visualization and debug</a></li>
+<li><a class="reference internal" href="#warnings">Warnings</a><ul>
+<li><a class="reference internal" href="#wundefined-control-flow">[-Wundefined-control-flow]</a><ul>
+<li><a class="reference internal" href="#the-old-default-rule">The old default rule</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#wunreachable-rules">[-Wunreachable-rules]</a></li>
+<li><a class="reference internal" href="#wcondition-order">[-Wcondition-order]</a></li>
+<li><a class="reference internal" href="#wuseless-escape">[-Wuseless-escape]</a></li>
+<li><a class="reference internal" href="#wswapped-range">[-Wswapped-range]</a></li>
+<li><a class="reference internal" href="#wempty-character-class">[-Wempty-character-class]</a></li>
+<li><a class="reference internal" href="#wmatch-empty-string">[-Wmatch-empty-string]</a></li>
+<li><a class="reference internal" href="#wsentinel-in-midrule">[-Wsentinel-in-midrule]</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#more-examples">More examples</a></li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="user-manual">
+<h1>User manual<a class="headerlink" href="#user-manual" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="syntax">
+<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
+<p>A re2c program consists of a number of re2c blocks and directives intermixed
+with normal C/C++ code. Each re2c block consists of a sequence of named
+definitions, configurations and rules that contain regular expressions. The
+generated lexer communicates with the outer world by the means of user
+interface.
+Rules consist of a regular expression followed by a user-defined action
+(semantic action): a block of C/C++ code that is executed in case of successful
+match. Semantic action can be either an arbitrary block of code enclosed in
+curly braces <code class="docutils literal notranslate"><span class="pre">{</span></code> and <code class="docutils literal notranslate"><span class="pre">}</span></code>, or a block of code without curly braces preceded
+with <code class="docutils literal notranslate"><span class="pre">:=</span></code> and ended with a newline that is not followed by a whitespace.
+If multiple rules match, longest match takes precedence. If multiple rules match
+the same string, the earlier rule takes priority. If <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">--conditions</span></code> option
+is used, then rules have more complex form described in the section about
+conditions. There are two special kinds of rules:</p>
+<ul class="simple">
+<li>Default rule <code class="docutils literal notranslate"><span class="pre">*</span></code> which has the lowest priority reagrdless of its place in
+the source code, matches any code unit and consumes exactly one code unit.
+This rule should always be defined.</li>
+<li>EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code> which matches the end of input. This rule should be defined if
+the simplified EOF handling method is used.</li>
+</ul>
+<p>Named definitions are of the form <code class="docutils literal notranslate"><span class="pre">name</span> <span class="pre">=</span> <span class="pre">regexp</span> <span class="pre">;</span></code> where <code class="docutils literal notranslate"><span class="pre">name</span></code> is an
+identifier that consists of letters, digits and underscores, and <code class="docutils literal notranslate"><span class="pre">regexp</span></code> is a
+regular expression. With <code class="docutils literal notranslate"><span class="pre">-F</span> <span class="pre">--flex-syntax</span></code> option named definitions are also
+of the form <code class="docutils literal notranslate"><span class="pre">name</span> <span class="pre">regexp</span></code>. Each name should be defined before it is used.</p>
+<div class="section" id="a-basic-example">
+<h3>A basic example<a class="headerlink" href="#a-basic-example" title="Permalink to this headline">¶</a></h3>
+<p>Here is an example program <a class="reference download internal" href="../_downloads/syntax.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[syntax.re]</span></code></a>
+that shows various aspects of re2c syntax:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cm">/*!re2c re2c:flags:i = 1; */</span> <span class="c1">// re2c block with configuration that turns off #line directives</span>
+ <span class="c1">//</span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h> // C/C++ code</span><span class="cp"></span>
+ <span class="c1">//</span>
+<span class="cm">/*!max:re2c*/</span> <span class="c1">// directive that defines YYMAXFILL (unused)</span>
+<span class="cm">/*!re2c // start of re2c block</span>
+<span class="cm"> digit = [0-9]; // named definition of 'digit'</span>
+<span class="cm"> number = digit+; // named definition of 'number'</span>
+<span class="cm">*/</span> <span class="c1">// end of re2c block</span>
+ <span class="c1">//</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span> <span class="c1">// YYCURSOR is defined as a function parameter</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span> <span class="c1">// YYMARKER is defined as a local variable</span>
+ <span class="cm">/*!re2c // start of re2c block</span>
+<span class="cm"> re2c:define:YYCTYPE = char; // configuration that defines YYCTYPE</span>
+<span class="cm"> re2c:yyfill:enable = 0; // configuration that turns off YYFILL</span>
+<span class="cm"> //</span>
+<span class="cm"> * { return 1; } // default rule with its semantic action</span>
+<span class="cm"> //</span>
+<span class="cm"> number { // a normal rule with its semantic action</span>
+<span class="cm"> printf("number\n"); // ... semantic action (continued)</span>
+<span class="cm"> return 0; // ... semantic action (continued)</span>
+<span class="cm"> } // end of semantic action</span>
+<span class="cm"> //</span>
+<span class="cm"> */</span> <span class="c1">// end of re2c block</span>
+<span class="p">}</span> <span class="c1">//</span>
+ <span class="c1">//</span>
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="c1">//</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">"1024"</span><span class="p">);</span> <span class="c1">// C/C++ code</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">";]"</span><span class="p">);</span> <span class="c1">//</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">//</span>
+<span class="p">}</span> <span class="c1">//</span>
+</pre></div>
+</div>
+<p>Run re2c as <code class="docutils literal notranslate"><span class="pre">re2c</span> <span class="pre">-W</span> <span class="pre">syntax.re</span> <span class="pre">-o</span> <span class="pre">syntax.c</span></code> (option <code class="docutils literal notranslate"><span class="pre">-W</span></code> enables warnings).
+The generated code <a class="reference download internal" href="../_downloads/syntax.c.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[syntax.c]</span></code></a>
+looks like this:</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span> <span class="c1">// re2c block with configuration that turns off #line directives</span>
+ <span class="c1">//</span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h> // C/C++ code</span><span class="cp"></span>
+ <span class="c1">//</span>
+<span class="cp">#define YYMAXFILL 1 </span><span class="c1">// directive that defines YYMAXFILL (unused)</span>
+ <span class="c1">// end of re2c block</span>
+ <span class="c1">//</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span> <span class="c1">// YYCURSOR is defined as a function parameter</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span> <span class="c1">// YYMARKER is defined as a local variable</span>
+
+<span class="p">{</span>
+ <span class="kt">char</span> <span class="n">yych</span><span class="p">;</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'0'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'1'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'2'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'3'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'4'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'5'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'6'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'7'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'8'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'9'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy4</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy2</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy2</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span> <span class="p">}</span>
+<span class="nl">yy4</span><span class="p">:</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'0'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'1'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'2'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'3'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'4'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'5'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'6'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'7'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'8'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'9'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy4</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy6</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy6</span><span class="p">:</span>
+ <span class="p">{</span> <span class="c1">// a normal rule with its semantic action</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"number</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="c1">// ... semantic action (continued)</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// ... semantic action (continued)</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+ <span class="c1">// end of re2c block</span>
+<span class="p">}</span> <span class="c1">//</span>
+ <span class="c1">//</span>
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="c1">//</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">"1024"</span><span class="p">);</span> <span class="c1">// C/C++ code</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">";]"</span><span class="p">);</span> <span class="c1">//</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">//</span>
+<span class="p">}</span> <span class="c1">//</span>
+</pre></div>
+</div>
+<p>The lines without comments correspond to the code generated by re2c. Not all
+comments are present in the output — only those which are in C/C++ code, and
+not inside of re2c blocks.</p>
+</div>
+</div>
+<div class="section" id="regular-expressions">
+<h2>Regular expressions<a class="headerlink" href="#regular-expressions" title="Permalink to this headline">¶</a></h2>
+<p>re2c uses the following syntax for regular expressions:</p>
+<ul class="simple">
+<li><code class="docutils literal notranslate"><span class="pre">"foo"</span></code> case-sensitive string literal</li>
+<li><code class="docutils literal notranslate"><span class="pre">'foo'</span></code> case-insensitive string literal</li>
+<li><code class="docutils literal notranslate"><span class="pre">[a-xyz]</span></code>, <code class="docutils literal notranslate"><span class="pre">[^a-xyz]</span></code> character class (possibly negated)</li>
+<li><code class="docutils literal notranslate"><span class="pre">.</span></code> any character except newline</li>
+<li><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">\</span> <span class="pre">S</span></code> difference of character classes <code class="docutils literal notranslate"><span class="pre">R</span></code> and <code class="docutils literal notranslate"><span class="pre">S</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">R*</span></code> zero or more occurrences of <code class="docutils literal notranslate"><span class="pre">R</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">R+</span></code> one or more occurrences of <code class="docutils literal notranslate"><span class="pre">R</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">R?</span></code> optional <code class="docutils literal notranslate"><span class="pre">R</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">R{n}</span></code> repetition of <code class="docutils literal notranslate"><span class="pre">R</span></code> exactly <code class="docutils literal notranslate"><span class="pre">n</span></code> times</li>
+<li><code class="docutils literal notranslate"><span class="pre">R{n,}</span></code> repetition of <code class="docutils literal notranslate"><span class="pre">R</span></code> at least <code class="docutils literal notranslate"><span class="pre">n</span></code> times</li>
+<li><code class="docutils literal notranslate"><span class="pre">R{n,m}</span></code> repetition of <code class="docutils literal notranslate"><span class="pre">R</span></code> from <code class="docutils literal notranslate"><span class="pre">n</span></code> to <code class="docutils literal notranslate"><span class="pre">m</span></code> times</li>
+<li><code class="docutils literal notranslate"><span class="pre">(R)</span></code> just <code class="docutils literal notranslate"><span class="pre">R</span></code>; parentheses are used to override precedence or for POSIX-style submatch</li>
+<li><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">S</span></code> concatenation: <code class="docutils literal notranslate"><span class="pre">R</span></code> followed by <code class="docutils literal notranslate"><span class="pre">S</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">|</span> <span class="pre">S</span></code> alternative: <code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">or</span> <span class="pre">S</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">R</span> <span class="pre">/</span> <span class="pre">S</span></code> lookahead: <code class="docutils literal notranslate"><span class="pre">R</span></code> followed by <code class="docutils literal notranslate"><span class="pre">S</span></code>, but <code class="docutils literal notranslate"><span class="pre">S</span></code> is not consumed</li>
+<li><code class="docutils literal notranslate"><span class="pre">name</span></code> the regular expression defined as <code class="docutils literal notranslate"><span class="pre">name</span></code> (or literal string <code class="docutils literal notranslate"><span class="pre">"name"</span></code> in Flex compatibility mode)</li>
+<li><code class="docutils literal notranslate"><span class="pre">{name}</span></code> the regular expression defined as <code class="docutils literal notranslate"><span class="pre">name</span></code> in Flex compatibility mode</li>
+<li><code class="docutils literal notranslate"><span class="pre">@stag</span></code> an <em>s-tag</em>: saves the last input position at which <code class="docutils literal notranslate"><span class="pre">@stag</span></code> matches in a variable named <code class="docutils literal notranslate"><span class="pre">stag</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">#mtag</span></code> an <em>m-tag</em>: saves all input positions at which <code class="docutils literal notranslate"><span class="pre">#mtag</span></code> matches in a variable named <code class="docutils literal notranslate"><span class="pre">mtag</span></code></li>
+</ul>
+<p>Character classes and string literals may contain the following escape sequences:
+<code class="docutils literal notranslate"><span class="pre">\a</span></code>, <code class="docutils literal notranslate"><span class="pre">\b</span></code>, <code class="docutils literal notranslate"><span class="pre">\f</span></code>, <code class="docutils literal notranslate"><span class="pre">\n</span></code>, <code class="docutils literal notranslate"><span class="pre">\r</span></code>, <code class="docutils literal notranslate"><span class="pre">\t</span></code>, <code class="docutils literal notranslate"><span class="pre">\v</span></code>, <code class="docutils literal notranslate"><span class="pre">\\</span></code>, octal escapes <code class="docutils literal notranslate"><span class="pre">\ooo</span></code> and hexadecimal escapes <code class="docutils literal notranslate"><span class="pre">\xhh</span></code>, <code class="docutils literal notranslate"><span class="pre">\uhhhh</span></code> and <code class="docutils literal notranslate"><span class="pre">\Uhhhhhhhh</span></code>.</p>
+</div>
+<div class="section" id="user-interface">
+<h2>User interface<a class="headerlink" href="#user-interface" title="Permalink to this headline">¶</a></h2>
+<p>Below is the list of all symbols which may be used by the lexer in order to interact with the outer world.
+These symbols should be defined by the user,
+either in the form of inplace configurations,
+or as C/C++ variables, functions, macros and other language constructs.
+Which primitives are necessary depends on the particular use case.</p>
+<dl class="docutils">
+<dt><code class="docutils literal notranslate"><span class="pre">yyaccept</span></code></dt>
+<dd>L-value of unsigned integral type that is used to hold the number of the last matched rule.
+Explicit definition by the user is necessary only with <code class="docutils literal notranslate"><span class="pre">-f</span></code> <code class="docutils literal notranslate"><span class="pre">--storable-state</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYBACKUP</span> <span class="pre">()</span></code></dt>
+<dd>Backup current input position (used only with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYBACKUPCTX</span> <span class="pre">()</span></code></dt>
+<dd>Backup current input position for trailing context (used only with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">yych</span></code></dt>
+<dd>L-value of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> that is used to hold current input character.
+Explicit definition by the user is necessary only with <code class="docutils literal notranslate"><span class="pre">-f</span></code> <code class="docutils literal notranslate"><span class="pre">--storable-state</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYCONDTYPE</span></code></dt>
+<dd>The type of <em>condition</em> identifiers (used only with <code class="docutils literal notranslate"><span class="pre">-c</span></code> <code class="docutils literal notranslate"><span class="pre">--conditions</span></code> option).
+Should be generated either with <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> directive, or with <code class="docutils literal notranslate"><span class="pre">-t</span></code> <code class="docutils literal notranslate"><span class="pre">--type-header</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYCTXMARKER</span></code></dt>
+<dd>L-value of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span> <span class="pre">*</span></code> that is used to backup input position of trailing context.
+It is needed only if regular expressions use the lookahead operator <code class="docutils literal notranslate"><span class="pre">/</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code></dt>
+<dd>The type of the input characters (<em>code units</em>).
+Usually it should be <code class="docutils literal notranslate"><span class="pre">unsigned</span> <span class="pre">char</span></code> for ASCII, EBCDIC and UTF-8 encodings,
+<code class="docutils literal notranslate"><span class="pre">unsigned</span> <span class="pre">short</span></code> for UTF-16 or UCS-2 encodings,
+and <code class="docutils literal notranslate"><span class="pre">unsigned</span> <span class="pre">int</span></code> for UTF-32 encoding.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code></dt>
+<dd>L-value of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span> <span class="pre">*</span></code> that is used as a pointer to the current input symbol.
+Initially <code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code> points to the first character and is advanced by the lexer during matching.
+When a rule matches, <code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code> points past the last character of the matched string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYDEBUG</span> <span class="pre">(state,</span> <span class="pre">symbol)</span></code></dt>
+<dd>A function-like primitive that is used to dump debug information (only used with <code class="docutils literal notranslate"><span class="pre">-d</span></code> <code class="docutils literal notranslate"><span class="pre">--debug-output</span></code> option).
+<code class="docutils literal notranslate"><span class="pre">YYDEBUG</span></code> should return no value and accept two arguments:
+<code class="docutils literal notranslate"><span class="pre">state</span></code> (either lexer state or <code class="docutils literal notranslate"><span class="pre">-1</span></code>) and <code class="docutils literal notranslate"><span class="pre">symbol</span></code> (current input symbol).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYFILL</span> <span class="pre">(n)</span></code></dt>
+<dd>A function-like primitive that is called by the lexer when there is not enough input.
+<code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> should return no value and supply at least <code class="docutils literal notranslate"><span class="pre">n</span></code> additional characters.
+Maximal value of <code class="docutils literal notranslate"><span class="pre">n</span></code> equals <code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code>, which can be obtained with the <code class="docutils literal notranslate"><span class="pre">/*!max:re2c*/</span></code> directive.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYGETCONDITION</span> <span class="pre">()</span></code></dt>
+<dd>R-value of type <code class="docutils literal notranslate"><span class="pre">YYCONDTYPE</span></code> that represents current <em>condition</em> identifier (used only with <code class="docutils literal notranslate"><span class="pre">-c</span></code> <code class="docutils literal notranslate"><span class="pre">--conditions</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYGETSTATE</span> <span class="pre">()</span></code></dt>
+<dd>R-value of signed integral type that represents current lexer state (used only with <code class="docutils literal notranslate"><span class="pre">-f</span></code> <code class="docutils literal notranslate"><span class="pre">--storable-state</span></code> option).
+Initial value of lexer state should be <code class="docutils literal notranslate"><span class="pre">-1</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span> <span class="pre">(n)</span></code></dt>
+<dd>R-value of boolean type that is <code class="docutils literal notranslate"><span class="pre">true</span></code> if and only if there is less than <code class="docutils literal notranslate"><span class="pre">n</span></code> input characters left (used only with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code></dt>
+<dd>R-value of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span> <span class="pre">*</span></code> that marks the end of input (<code class="docutils literal notranslate"><span class="pre">YYLIMIT[-1]</span></code> should be the last input character).
+Lexer compares <code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code> and <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code> in order to determine if there is enough input characters left.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYMARKER</span></code></dt>
+<dd>L-value of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span> <span class="pre">*</span></code> used to backup input position of successful match.
+This might be necessary if there is an overlapping longer rule that might also match.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYMTAGP</span> <span class="pre">(t)</span></code></dt>
+<dd>Append current input position to the history of <em>m-tag</em> <code class="docutils literal notranslate"><span class="pre">t</span></code> (used only with <code class="docutils literal notranslate"><span class="pre">-T</span></code> <code class="docutils literal notranslate"><span class="pre">--tags</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYMTAGN</span> <span class="pre">(t)</span></code></dt>
+<dd>Append default value to the history of <em>m-tag</em> <code class="docutils literal notranslate"><span class="pre">t</span></code> (used only with <code class="docutils literal notranslate"><span class="pre">-T</span></code> <code class="docutils literal notranslate"><span class="pre">--tags</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code></dt>
+<dd>Integral constant that denotes maximal value of <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> argument
+and is autogenerated by <code class="docutils literal notranslate"><span class="pre">/*!max:re2c*/</span></code> directive.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYMAXNMATCH</span></code></dt>
+<dd>Integral constant that denotes maximal number of capturing groups in a rule
+and is autogenerated by <code class="docutils literal notranslate"><span class="pre">/*!maxnmatch:re2c*/</span></code> directive (used only with <code class="docutils literal notranslate"><span class="pre">--posix-captures</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">yynmatch</span></code></dt>
+<dd>L-value of unsigned integral type that is used to hold the number of capturing groups in the matching rule.
+Used only with <code class="docutils literal notranslate"><span class="pre">-P</span></code> <code class="docutils literal notranslate"><span class="pre">--posix-captures</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYPEEK</span> <span class="pre">()</span></code></dt>
+<dd>R-value of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> that denotes current input character (used only with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">yypmatch</span></code></dt>
+<dd>An array of l-values that are used to hold the values of <em>s-tags</em>
+corresponding to the capturing parentheses in the matching rule.
+The length of array must be at least <code class="docutils literal notranslate"><span class="pre">yynmatch</span> <span class="pre">*</span> <span class="pre">2</span></code> (ideally <code class="docutils literal notranslate"><span class="pre">YYMAXNMATCH</span> <span class="pre">*</span> <span class="pre">2</span></code>).
+Used only with <code class="docutils literal notranslate"><span class="pre">-P</span></code> <code class="docutils literal notranslate"><span class="pre">--posix-captures</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYRESTORE</span> <span class="pre">()</span></code></dt>
+<dd>Restore input position (used only with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYRESTORECTX</span> <span class="pre">()</span></code></dt>
+<dd>Restore input position from the value of trailing context (used only with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYRESTORETAG</span> <span class="pre">(t)</span></code></dt>
+<dd>Restore input position from the value of <em>s-tag</em> <code class="docutils literal notranslate"><span class="pre">t</span></code> (used only with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYSETCONDITION</span> <span class="pre">(condition)</span></code></dt>
+<dd>Set current <em>condition</em> identifier to <code class="docutils literal notranslate"><span class="pre">condition</span></code> (used only with <code class="docutils literal notranslate"><span class="pre">-c</span></code> <code class="docutils literal notranslate"><span class="pre">--conditions</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYSETSTATE</span> <span class="pre">(state)</span></code></dt>
+<dd>Set current lexer state to <code class="docutils literal notranslate"><span class="pre">state</span></code> (used only with <code class="docutils literal notranslate"><span class="pre">-f</span></code> <code class="docutils literal notranslate"><span class="pre">--storable-state</span></code> option).
+Parameter <code class="docutils literal notranslate"><span class="pre">state</span></code> is of signed integral type.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYSKIP</span> <span class="pre">()</span></code></dt>
+<dd>Advance input position to the next character (used only with generic API).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYSTAGP</span> <span class="pre">(t)</span></code></dt>
+<dd>Save current input position to <em>s-tag</em> <code class="docutils literal notranslate"><span class="pre">t</span></code> (used only with <code class="docutils literal notranslate"><span class="pre">-T</span></code> <code class="docutils literal notranslate"><span class="pre">--tags</span></code> and <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">YYSTAGN</span> <span class="pre">(t)</span></code></dt>
+<dd>Save default value to <em>s-tag</em> <code class="docutils literal notranslate"><span class="pre">t</span></code> (used only with <code class="docutils literal notranslate"><span class="pre">-T</span></code> <code class="docutils literal notranslate"><span class="pre">--tags</span></code> and <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> options).</dd>
+</dl>
+<div class="section" id="default-api">
+<h3>Default API<a class="headerlink" href="#default-api" title="Permalink to this headline">¶</a></h3>
+<p>By default <code class="docutils literal notranslate"><span class="pre">re2c</span></code> operates on input using pointer-like primitives
+<code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code>, <code class="docutils literal notranslate"><span class="pre">YYMARKER</span></code>, <code class="docutils literal notranslate"><span class="pre">YYCTXMARKER</span></code>, and <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code>.
+Normally pointer-like primitives are defined as variables of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE*</span></code>,
+but it is possible to use STL iterators or any other abstraction as long as it syntactically fits into the following use cases:</p>
+<ul class="simple">
+<li><code class="docutils literal notranslate"><span class="pre">++YYCURSOR;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">yych</span> <span class="pre">=</span> <span class="pre">*YYCURSOR;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">yych</span> <span class="pre">=</span> <span class="pre">*++YYCURSOR;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">yych</span> <span class="pre">=</span> <span class="pre">*(YYMARKER</span> <span class="pre">=</span> <span class="pre">YYCURSOR);</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">yych</span> <span class="pre">=</span> <span class="pre">*(YYMARKER</span> <span class="pre">=</span> <span class="pre">++YCURSOR);</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYMARKER</span> <span class="pre">=</span> <span class="pre">YYCURSOR;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYMARKER</span> <span class="pre">=</span> <span class="pre">++YYCURSOR;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYCURSOR</span> <span class="pre">=</span> <span class="pre">YYMARKER;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYCTXMARKER</span> <span class="pre">=</span> <span class="pre">YYCURSOR</span> <span class="pre">+</span> <span class="pre">1;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYCURSOR</span> <span class="pre">=</span> <span class="pre">YYCTXMARKER;</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">if</span> <span class="pre">(YYLIMIT</span> <span class="pre"><=</span> <span class="pre">YYCURSOR)</span> <span class="pre">...</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">if</span> <span class="pre">((YYLIMIT</span> <span class="pre">-</span> <span class="pre">YYCURSOR)</span> <span class="pre"><</span> <span class="pre">n)</span> <span class="pre">...</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYDEBUG</span> <span class="pre">(label,</span> <span class="pre">*YYCURSOR);</span></code></li>
+</ul>
+</div>
+<div class="section" id="generic-api">
+<h3>Generic API<a class="headerlink" href="#generic-api" title="Permalink to this headline">¶</a></h3>
+<p>If the default input model is too restrictive, then it is possible to use generic input API enabled with <code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre">custom</span></code> option.
+In this mode all input operations are expressed in terms of the primitives below.
+These primitives can be defined in any suitable way; one doesn’t have to stick to the pointer semantics.
+For example, it is possible to read input directly from file without any buffering,
+or to disable <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> mechanism and perform end-of-input checking on each input character from inside of <code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> or <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code>.</p>
+<ul class="simple">
+<li><code class="docutils literal notranslate"><span class="pre">YYPEEK</span> <span class="pre">()</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYSKIP</span> <span class="pre">()</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYBACKUP</span> <span class="pre">()</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYBACKUPCTX</span> <span class="pre">()</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYSTAGP</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYSTAGN</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYMTAGP</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYMTAGN</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYRESTORE</span> <span class="pre">()</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYRESTORECTX</span> <span class="pre">()</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYRESTORETAG</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span> <span class="pre">(n)</span></code></li>
+</ul>
+<p>Default input model can be expressed in terms of generic API as follows
+(except for <code class="docutils literal notranslate"><span class="pre">YMTAGP</span></code> and <code class="docutils literal notranslate"><span class="pre">YYMTAGN</span></code>, which have no default implementation):</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cp">#define YYPEEK () *YYCURSOR</span>
+<span class="cp">#define YYSKIP () ++YYCURSOR</span>
+<span class="cp">#define YYBACKUP () YYMARKER = YYCURSOR</span>
+<span class="cp">#define YYBACKUPCTX () YYCTXMARKER = YYCURSOR</span>
+<span class="cp">#define YYRESTORE () YYCURSOR = YYMARKER</span>
+<span class="cp">#define YYRESTORECTX () YYCURSOR = YYCTXMARKER</span>
+<span class="cp">#define YYRESTORERAG (t) YYCURSOR = t</span>
+<span class="cp">#define YYLESSTHAN (n) YYLIMIT - YYCURSOR < n</span>
+<span class="cp">#define YYSTAGP (t) t = YYCURSOR</span>
+<span class="cp">#define YYSTAGN (t) t = NULL</span>
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="directives">
+<h2>Directives<a class="headerlink" href="#directives" title="Permalink to this headline">¶</a></h2>
+<p>Below is the list of all directives provided by re2c (in no particular order).
+More information on each directive can be found in the related sections.</p>
+<dl class="docutils">
+<dt><code class="docutils literal notranslate"><span class="pre">/*!re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></dt>
+<dd>A standard re2c block.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">%{</span> <span class="pre">...</span> <span class="pre">%}</span></code></dt>
+<dd>A standard re2c block in <code class="docutils literal notranslate"><span class="pre">-F</span> <span class="pre">--flex-support</span></code> mode.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!rules:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></dt>
+<dd>A reusable re2c block (requires <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">--reuse</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!use:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></dt>
+<dd>A block that reuses previous rules-block specified with
+<code class="docutils literal notranslate"><span class="pre">/*!rules:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code> (requires <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">--reuse</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!ignore:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></dt>
+<dd>A block which contents are ignored and cut off from the output file.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!max:re2c*/</span></code></dt>
+<dd>This directive is substituted with the macro-definition of <code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!maxnmatch:re2c*/</span></code></dt>
+<dd>This directive is substituted with the macro-definition of <code class="docutils literal notranslate"><span class="pre">YYMAXNMATCH</span></code>
+(requires <code class="docutils literal notranslate"><span class="pre">-P</span> <span class="pre">--posix-captures</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!getstate:re2c*/</span></code></dt>
+<dd>This directive is substituted with conditional dispatch on lexer state
+(requires <code class="docutils literal notranslate"><span class="pre">-f</span> <span class="pre">--storable-state</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!types:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></dt>
+<dd>This directive is substituted with the definition of condition <code class="docutils literal notranslate"><span class="pre">enum</span></code>
+(requires <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">--conditions</span></code> option).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!stags:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code>, <code class="docutils literal notranslate"><span class="pre">/*!mtags:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></dt>
+<dd>These directives allow one to specify a template piece of code that is expanded
+for each s-tag/m-tag variable generated by re2c. This block has two optional
+configurations: <code class="docutils literal notranslate"><span class="pre">format</span> <span class="pre">=</span> <span class="pre">"@@";</span></code> (specifies the template where <code class="docutils literal notranslate"><span class="pre">@@</span></code> is
+substituted with the name of each tag variable), and <code class="docutils literal notranslate"><span class="pre">separator</span> <span class="pre">=</span> <span class="pre">"";</span></code>
+(specifies the piece of code used to join the generated pieces for different
+tag variables).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!include:re2c</span> <span class="pre">FILE</span> <span class="pre">*/</span></code></dt>
+<dd>This directive allows one to include <code class="docutils literal notranslate"><span class="pre">FILE</span></code> (in the same sense as <code class="docutils literal notranslate"><span class="pre">#include</span></code>
+directive in C/C++).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!header:re2c:on*/</span></code></dt>
+<dd>This directive marks the start of header file. Everything after it and up to
+the following <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:off*/</span></code> directive is processed by re2c and
+written to the header file specified with <code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">/*!header:re2c:off*/</span></code></dt>
+<dd>This directive marks the end of header file started with
+<code class="docutils literal notranslate"><span class="pre">/*!header:re2c:on*/</span></code>.</dd>
+</dl>
+</div>
+<div class="section" id="options">
+<h2>Options<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt><code class="docutils literal notranslate"><span class="pre">-?</span> <span class="pre">-h</span> <span class="pre">--help</span></code></dt>
+<dd>Show help message.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-1</span> <span class="pre">--single-pass</span></code></dt>
+<dd>Deprecated. Does nothing (single pass is the default now).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-8</span> <span class="pre">--utf-8</span></code></dt>
+<dd>Generate a lexer that reads input in UTF-8 encoding.
+re2c assumes that character range is 0 – 0x10FFFF and character size is
+1 byte.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-b</span> <span class="pre">--bit-vectors</span></code></dt>
+<dd>Optimize conditional jumps using bit masks. Implies <code class="docutils literal notranslate"><span class="pre">-s</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">--conditions</span> <span class="pre">--start-conditions</span></code></dt>
+<dd>Enable support of Flex-like “conditions”: multiple interrelated lexers
+within one block. Option <code class="docutils literal notranslate"><span class="pre">--start-conditions</span></code> is a legacy alias; use
+<code class="docutils literal notranslate"><span class="pre">--conditions</span></code> instead.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--case-insensitive</span></code></dt>
+<dd>Treat single-quoted and double-quoted strings as case-insensitive.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--case-inverted</span></code></dt>
+<dd>Invert the meaning of single-quoted and double-quoted strings:
+treat single-quoted strings as case-sensitive and double-quoted strings
+as case-insensitive.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-D</span> <span class="pre">--emit-dot</span></code></dt>
+<dd>Instead of normal output generate lexer graph in .dot format.
+The output can be converted to an image with the help of Graphviz
+(e.g. something like <code class="docutils literal notranslate"><span class="pre">dot</span> <span class="pre">-Tpng</span> <span class="pre">-odfa.png</span> <span class="pre">dfa.dot</span></code>).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-d</span> <span class="pre">--debug-output</span></code></dt>
+<dd>Emit <code class="docutils literal notranslate"><span class="pre">YYDEBUG</span></code> in the generated code.
+<code class="docutils literal notranslate"><span class="pre">YYDEBUG</span></code> should be defined by the user in the form of a void function
+with two parameters: <code class="docutils literal notranslate"><span class="pre">state</span></code> (lexer state or -1) and <code class="docutils literal notranslate"><span class="pre">symbol</span></code> (current
+input symbol of type <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code>).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dfa-minimization</span> <span class="pre"><moore</span> <span class="pre">|</span> <span class="pre">table></span></code></dt>
+<dd>The internal algorithm used by re2c to minimize the DFA: <code class="docutils literal notranslate"><span class="pre">moore</span></code> (the
+default) is Moore algorithm, and <code class="docutils literal notranslate"><span class="pre">table</span></code> is the “table filling” algorithm.
+Both algorithms should produce the same DFA up to states relabeling; table
+filling is simpler and much slower and serves as a reference implementation.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-adfa</span></code></dt>
+<dd>Debug option: output DFA after tunneling (in .dot format).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-cfg</span></code></dt>
+<dd>Debug option: output control flow graph of tag variables (in .dot format).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-closure-stats</span></code></dt>
+<dd>Debug option: output statistics on the number of states in closure.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-dfa-det</span></code></dt>
+<dd>Debug option: output DFA immediately after determinization (in .dot format).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-dfa-min</span></code></dt>
+<dd>Debug option: output DFA after minimization (in .dot format).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-dfa-tagopt</span></code></dt>
+<dd>Debug option: output DFA after tag optimizations (in .dot format).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-dfa-raw</span></code></dt>
+<dd>Debug option: output DFA under construction with expanded state-sets
+(in .dot format).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-interf</span></code></dt>
+<dd>Debug option: output interference table produced by liveness analysis of tag
+variables.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--dump-nfa</span></code></dt>
+<dd>Debug option: output NFA (in .dot format).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-e</span> <span class="pre">--ecb</span></code></dt>
+<dd>Generate a lexer that reads input in EBCDIC encoding.
+re2c assumes that character range is 0 – 0xFF an character size is 1 byte.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--eager-skip</span></code></dt>
+<dd>Make the generated lexer advance the input position “eagerly”:
+immediately after reading input symbol.
+By default this happens after transition to the next state.
+Implied by <code class="docutils literal notranslate"><span class="pre">--no-lookahead</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--empty-class</span> <span class="pre"><match-empty</span> <span class="pre">|</span> <span class="pre">match-none</span> <span class="pre">|</span> <span class="pre">error></span></code></dt>
+<dd>Define the way re2c treats empty character classes. With <code class="docutils literal notranslate"><span class="pre">match-empty</span></code>
+(the default) empty class matches empty input (which is illogical, but
+backwards-compatible). With``match-none`` empty class always fails to match.
+With <code class="docutils literal notranslate"><span class="pre">error</span></code> empty class raises a compilation error.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--encoding-policy</span> <span class="pre"><fail</span> <span class="pre">|</span> <span class="pre">substitute</span> <span class="pre">|</span> <span class="pre">ignore></span></code></dt>
+<dd>Define the way re2c treats Unicode surrogates.
+With <code class="docutils literal notranslate"><span class="pre">fail</span></code> re2c aborts with an error when a surrogate is encountered.
+With <code class="docutils literal notranslate"><span class="pre">substitute</span></code> re2c silently replaces surrogates with the error code
+point 0xFFFD. With <code class="docutils literal notranslate"><span class="pre">ignore</span></code> (the default) re2c treats surrogates as
+normal code points. The Unicode standard says that standalone surrogates
+are invalid, but real-world libraries and programs behave in different ways.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-f</span> <span class="pre">--storable-state</span></code></dt>
+<dd>Generate a lexer which can store its inner state.
+This is useful in push-model lexers which are stopped by an outer program
+when there is not enough input, and then resumed when more input becomes
+available. In this mode users should additionally define <code class="docutils literal notranslate"><span class="pre">YYGETSTATE()</span></code>
+and <code class="docutils literal notranslate"><span class="pre">YYSETSTATE(state)</span></code> macros and variables <code class="docutils literal notranslate"><span class="pre">yych</span></code>, <code class="docutils literal notranslate"><span class="pre">yyaccept</span></code>
+and <code class="docutils literal notranslate"><span class="pre">state</span></code> as part of the lexer state.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-F</span> <span class="pre">--flex-syntax</span></code></dt>
+<dd>Partial support for Flex syntax: in this mode named definitions don’t need
+the equal sign and the terminating semicolon, and when used they must be
+surrounded by curly braces. Names without curly braces are treated as
+double-quoted strings.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-g</span> <span class="pre">--computed-gotos</span></code></dt>
+<dd>Optimize conditional jumps using non-standard “computed goto” extension
+(which must be supported by the C/C++ compiler). re2c generates jump tables
+only in complex cases with a lot of conditional branches. Complexity
+threshold can be configured with <code class="docutils literal notranslate"><span class="pre">cgoto:threshold</span></code> configuration. This
+option implies <code class="docutils literal notranslate"><span class="pre">-b</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-I</span> <span class="pre">PATH</span></code></dt>
+<dd>Add <code class="docutils literal notranslate"><span class="pre">PATH</span></code> to the list of locations which are used when searching for
+include files. This option is useful in combination with
+<code class="docutils literal notranslate"><span class="pre">/*!include:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code> directive. Re2c looks for <code class="docutils literal notranslate"><span class="pre">FILE</span></code> in the
+directory of including file and in the list of include paths specified by
+<code class="docutils literal notranslate"><span class="pre">-I</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-i</span> <span class="pre">--no-debug-info</span></code></dt>
+<dd>Do not output <code class="docutils literal notranslate"><span class="pre">#line</span></code> information. This is useful when the generated code
+is tracked by some version control system or IDE.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--input</span> <span class="pre"><default</span> <span class="pre">|</span> <span class="pre">custom></span></code></dt>
+<dd>Specify re2c input API.
+Option <code class="docutils literal notranslate"><span class="pre">default</span></code> is the default API composed of pointer-like primitives
+<code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code>, <code class="docutils literal notranslate"><span class="pre">YYMARKER</span></code>, <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code> etc.
+Option <code class="docutils literal notranslate"><span class="pre">custom</span></code> is the generic API composed of function-like primitives
+<code class="docutils literal notranslate"><span class="pre">YYPEEK()</span></code>, <code class="docutils literal notranslate"><span class="pre">YYSKIP()</span></code>, <code class="docutils literal notranslate"><span class="pre">YYBACKUP()</span></code>, <code class="docutils literal notranslate"><span class="pre">YYRESTORE()</span></code> etc.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--input-encoding</span> <span class="pre"><ascii</span> <span class="pre">|</span> <span class="pre">utf8></span></code></dt>
+<dd>Specify the way re2c parses regular expressions.
+With <code class="docutils literal notranslate"><span class="pre">ascii</span></code> (the default) re2c handles input as ASCII-encoded: any
+sequence of code units is a sequence of standalone 1-byte characters.
+With <code class="docutils literal notranslate"><span class="pre">utf8</span></code> re2c handles input as UTF8-encoded and recognizes multibyte
+characters.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--location-format</span> <span class="pre"><gnu</span> <span class="pre">|</span> <span class="pre">msvc></span></code></dt>
+<dd>Specify location format in messages.
+With <code class="docutils literal notranslate"><span class="pre">gnu</span></code> locations are printed as ‘filename:line:column: …’.
+With <code class="docutils literal notranslate"><span class="pre">msvc</span></code> locations are printed as ‘filename(line,column) …’.
+Default is <code class="docutils literal notranslate"><span class="pre">gnu</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--no-generation-date</span></code></dt>
+<dd>Suppress date output in the generated file.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--no-lookahead</span></code></dt>
+<dd>Use TDFA(0) instead of TDFA(1).
+This option has effect only with <code class="docutils literal notranslate"><span class="pre">--tags</span></code> or <code class="docutils literal notranslate"><span class="pre">--posix-captures</span></code> options.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--no-optimize-tags</span></code></dt>
+<dd>Suppress optimization of tag variables (useful for debugging).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--no-version</span></code></dt>
+<dd>Suppress version output in the generated file.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">OUTPUT</span> <span class="pre">--output=OUTPUT</span></code></dt>
+<dd>Specify the <code class="docutils literal notranslate"><span class="pre">OUTPUT</span></code> file.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-P</span> <span class="pre">--posix-captures</span></code></dt>
+<dd>Enable submatch extraction with POSIX-style capturing groups.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--posix-closure</span> <span class="pre"><gor1</span> <span class="pre">|</span> <span class="pre">gtop></span></code></dt>
+<dd>Specify shortest-path algorithm used for construction of epsilon-closure
+with POSIX disambiguation semantics: <code class="docutils literal notranslate"><span class="pre">gor1</span></code> (the default) stands for
+Goldberg-Radzik algorithm, and <code class="docutils literal notranslate"><span class="pre">gtop</span></code> stands for “global topological
+order” algorithm.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">--reusable</span></code></dt>
+<dd>Allows reuse of re2c rules with <code class="docutils literal notranslate"><span class="pre">/*!rules:re2c</span> <span class="pre">*/</span></code> and <code class="docutils literal notranslate"><span class="pre">/*!use:re2c</span> <span class="pre">*/</span></code>
+blocks. Exactly one rules-block must be present. The rules are saved and
+used by every use-block that follows, which may add its own rules and
+configurations.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-S</span> <span class="pre">--skeleton</span></code></dt>
+<dd>Ignore user-defined interface code and generate a self-contained “skeleton”
+program. Additionally, generate input files with strings derived from the
+regular grammar and compressed match results that are used to verify
+“skeleton” behavior on all inputs. This option is useful for finding bugs
+in optimizations and code generation.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-s</span> <span class="pre">--nested-ifs</span></code></dt>
+<dd>Use nested <code class="docutils literal notranslate"><span class="pre">if</span></code> statements instead of <code class="docutils literal notranslate"><span class="pre">switch</span></code> statements in conditional
+jumps. This usually results in more efficient code with non-optimizing C/C++
+compilers.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-T</span> <span class="pre">--tags</span></code></dt>
+<dd>Enable submatch extraction with tags.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">HEADER</span> <span class="pre">--type-header=HEADER</span></code></dt>
+<dd>Generate a <code class="docutils literal notranslate"><span class="pre">HEADER</span></code> file that contains enum with condition names.
+Requires <code class="docutils literal notranslate"><span class="pre">-c</span></code> option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-u</span> <span class="pre">--unicode</span></code></dt>
+<dd>Generate a lexer that reads UTF32-encoded input. Re2c assumes that character
+range is 0 – 0x10FFFF and character size is 4 bytes. This option implies
+<code class="docutils literal notranslate"><span class="pre">-s</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-V</span> <span class="pre">--vernum</span></code></dt>
+<dd>Show version information in <code class="docutils literal notranslate"><span class="pre">MMmmpp</span></code> format (major, minor, patch).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">--verbose</span></code></dt>
+<dd>Output a short message in case of success.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-v</span> <span class="pre">--version</span></code></dt>
+<dd>Show version information.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-w</span> <span class="pre">--wide-chars</span></code></dt>
+<dd>Generate a lexer that reads UCS2-encoded input. Re2c assumes that character
+range is 0 – 0xFFFF and character size is 2 bytes. This option implies
+<code class="docutils literal notranslate"><span class="pre">-s</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-x</span> <span class="pre">--utf-16</span></code></dt>
+<dd>Generate a lexer that reads UTF16-encoded input. Re2c assumes that character
+range is 0 – 0x10FFFF and character size is 2 bytes. This option implies
+<code class="docutils literal notranslate"><span class="pre">-s</span></code>.</dd>
+</dl>
+</div>
+<div class="section" id="configurations">
+<h2>Configurations<a class="headerlink" href="#configurations" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:cgoto:threshold</span> <span class="pre">=</span> <span class="pre">9;</span></code></dt>
+<dd>With <code class="docutils literal notranslate"><span class="pre">-g</span></code> <code class="docutils literal notranslate"><span class="pre">--computed-gotos</span></code> option this value specifies
+the complexity threshold that triggers the generation of jump tables rather
+than nested <code class="docutils literal notranslate"><span class="pre">if</span></code> statements and bit masks.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:cond:divider</span> <span class="pre">=</span> <span class="pre">'/*</span> <span class="pre">***********************************</span> <span class="pre">*/';</span></code></dt>
+<dd>Allows one to customize the divider for condition blocks. One can use <code class="docutils literal notranslate"><span class="pre">@@</span></code> to insert condition name.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:cond:divider@cond</span> <span class="pre">=</span> <span class="pre">@@;</span></code></dt>
+<dd>Specifies the placeholder that will be replaced with condition name in <code class="docutils literal notranslate"><span class="pre">re2c:cond:divider</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:condenumprefix</span> <span class="pre">=</span> <span class="pre">yyc;</span></code></dt>
+<dd>Specifies the prefix used for condition identifiers.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:cond:goto@cond</span> <span class="pre">=</span> <span class="pre">@@;</span></code></dt>
+<dd>Specifies the placeholder that will be replaced with condition label in <code class="docutils literal notranslate"><span class="pre">re2c:cond:goto</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:cond:goto</span> <span class="pre">=</span> <span class="pre">'goto</span> <span class="pre">@@;';</span></code></dt>
+<dd>Allows one to customize <code class="docutils literal notranslate"><span class="pre">goto</span></code> statements used with <code class="docutils literal notranslate"><span class="pre">:=></span></code> style rules.
+One can use <code class="docutils literal notranslate"><span class="pre">@@</span></code> to insert the condition name.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:condprefix</span> <span class="pre">=</span> <span class="pre">yyc;</span></code></dt>
+<dd>Specifies the prefix used for condition labels.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYBACKUPCTX</span> <span class="pre">=</span> <span class="pre">'YYBACKUPCTX';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYBACKUPCTX</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYBACKUP</span> <span class="pre">=</span> <span class="pre">'YYBACKUP';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYBACKUP</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYCONDTYPE</span> <span class="pre">=</span> <span class="pre">'YYCONDTYPE';</span></code></dt>
+<dd>Enumeration type used for condition identifiers.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYCTXMARKER</span> <span class="pre">=</span> <span class="pre">'YYCTXMARKER';</span></code></dt>
+<dd>Replaces the <code class="docutils literal notranslate"><span class="pre">YYCTXMARKER</span></code> placeholder with the specified identifier.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYCTYPE</span> <span class="pre">=</span> <span class="pre">'YYCTYPE';</span></code></dt>
+<dd>Replaces the <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> placeholder with the specified type.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYCURSOR</span> <span class="pre">=</span> <span class="pre">'YYCURSOR';</span></code></dt>
+<dd>Replaces the <code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code> placeholder with the specified identifier.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYDEBUG</span> <span class="pre">=</span> <span class="pre">'YYDEBUG';</span></code></dt>
+<dd>Replaces the <code class="docutils literal notranslate"><span class="pre">YYDEBUG</span></code> placeholder with the specified identifier.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYFILL@len</span> <span class="pre">=</span> <span class="pre">'@@';</span></code></dt>
+<dd>Any occurrence of this text inside of a <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> will be replaced with the actual argument.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYFILL:naked</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Allows to customize <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> invocation.
+If the value is non-zero, re2c outputs the value of <code class="docutils literal notranslate"><span class="pre">re2c:define:YYFILL</span></code>
+configuration (<code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> by default) without any decoration: no parentheses
+and no semicolon (or comparison against zero in the case of EOF rule).
+Otherwise the semicolon (or the comparison) is generated, and parentheses
+are controlled by the <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:parameter</span></code> configuration.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYFILL</span> <span class="pre">=</span> <span class="pre">'YYFILL';</span></code></dt>
+<dd>Define a substitution for <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>.
+By default re2c generates an argument in parentheses and a semicolon after <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>.
+If you need to make <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> an arbitrary statement rather than a call,
+set <code class="docutils literal notranslate"><span class="pre">re2c:define:YYFILL:naked</span></code> to a non-zero value.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYGETCONDITION:naked</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Controls the parentheses after <code class="docutils literal notranslate"><span class="pre">YYGETCONDITION</span></code>.
+If non-zero, the parentheses are omitted. If zero, they are generated.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYGETCONDITION</span> <span class="pre">=</span> <span class="pre">'YYGETCONDITION';</span></code></dt>
+<dd>Substitution for <code class="docutils literal notranslate"><span class="pre">YYGETCONDITION</span></code>.
+By default re2c generates parentheses after <code class="docutils literal notranslate"><span class="pre">YYGETCONDITION</span></code>.
+Set <code class="docutils literal notranslate"><span class="pre">re2c:define:YYGETCONDITION:naked</span></code> to non-zero in order to omit the parentheses.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYGETSTATE:naked</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Controls the parentheses that follow <code class="docutils literal notranslate"><span class="pre">YYGETSTATE</span></code>.
+If non-zero, the parentheses are omitted. If zero, they are generated.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYGETSTATE</span> <span class="pre">=</span> <span class="pre">'YYGETSTATE';</span></code></dt>
+<dd>Substitution for <code class="docutils literal notranslate"><span class="pre">YYGETSTATE</span></code>.
+By default re2c generates parentheses after <code class="docutils literal notranslate"><span class="pre">YYGETSTATE</span></code>.
+Set <code class="docutils literal notranslate"><span class="pre">re2c:define:YYGETSTATE:naked</span></code> to non-zero to omit the parentheses.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYLESSTHAN</span> <span class="pre">=</span> <span class="pre">'YYLESSTHAN';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYLIMIT</span> <span class="pre">=</span> <span class="pre">'YYLIMIT';</span></code></dt>
+<dd>Replaces the <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code> placeholder with the specified identifier.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYMARKER</span> <span class="pre">=</span> <span class="pre">'YYMARKER';</span></code></dt>
+<dd>Replaces the <code class="docutils literal notranslate"><span class="pre">YYMARKER</span></code> placeholder with the specified identifier.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYMTAGN</span> <span class="pre">=</span> <span class="pre">'YYMTAGN';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYMTAGN</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYMTAGP</span> <span class="pre">=</span> <span class="pre">'YYMTAGP';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYMTAGP</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYPEEK</span> <span class="pre">=</span> <span class="pre">'YYPEEK';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYRESTORECTX</span> <span class="pre">=</span> <span class="pre">'YYRESTORECTX';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYRESTORECTX</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYRESTORE</span> <span class="pre">=</span> <span class="pre">'YYRESTORE';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYRESTORE</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYRESTORETAG</span> <span class="pre">=</span> <span class="pre">'YYRESTORETAG';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYRESTORETAG</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETCONDITION@cond</span> <span class="pre">=</span> <span class="pre">'@@';</span></code></dt>
+<dd>Any occurrence of this
+text inside of <code class="docutils literal notranslate"><span class="pre">YYSETCONDITION</span></code> will be replaced with the actual argument.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETCONDITION:naked</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Controls the argument in parentheses
+and the semicolon after <code class="docutils literal notranslate"><span class="pre">YYSETCONDITION</span></code>. If non-zero, both the argument and
+the semicolon are omitted. If zero, both the argument and the semicolon are
+generated.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETCONDITION</span> <span class="pre">=</span> <span class="pre">'YYSETCONDITION';</span></code></dt>
+<dd>Substitution for
+<code class="docutils literal notranslate"><span class="pre">YYSETCONDITION</span></code>. By default re2c generates an argument in
+parentheses followed by semicolon after <code class="docutils literal notranslate"><span class="pre">YYSETCONDITION</span></code>. If you need to make
+<code class="docutils literal notranslate"><span class="pre">YYSETCONDITION</span></code> an arbitrary statement rather than a call, set
+<code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETCONDITION:naked</span></code> to non-zero.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETSTATE:naked</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Controls the argument in parentheses and the
+semicolon after <code class="docutils literal notranslate"><span class="pre">YYSETSTATE</span></code>. If non-zero, both argument and the semicolon are
+omitted. If zero, both the argument and the semicolon are generated.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETSTATE@state</span> <span class="pre">=</span> <span class="pre">'@@';</span></code></dt>
+<dd>Any occurrence of this text
+inside of <code class="docutils literal notranslate"><span class="pre">YYSETSTATE</span></code> will be replaced with the actual argument.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETSTATE</span> <span class="pre">=</span> <span class="pre">'YYSETSTATE';</span></code></dt>
+<dd>Substitution for
+<code class="docutils literal notranslate"><span class="pre">YYSETSTATE</span></code>. By default re2c generates an argument in parentheses
+followed by a semicolon after <code class="docutils literal notranslate"><span class="pre">YYSETSTATE</span></code>. If you need to make <code class="docutils literal notranslate"><span class="pre">YYSETSTATE</span></code> an
+arbitrary statement rather than a call, set
+<code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETSTATE:naked</span></code> to non-zero.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSKIP</span> <span class="pre">=</span> <span class="pre">'YYSKIP';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSTAGN</span> <span class="pre">=</span> <span class="pre">'YYSTAGN';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYSTAGN</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSTAGP</span> <span class="pre">=</span> <span class="pre">'YYSTAGP';</span></code></dt>
+<dd>Replaces <code class="docutils literal notranslate"><span class="pre">YYSTAGP</span></code> identifier with the specified string.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:eof</span> <span class="pre">=</span> <span class="pre">-1;</span></code></dt>
+<dd>Specifies the sentinel symbol used with EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code> to check for the end
+of input in the generated lexer. Default value is <code class="docutils literal notranslate"><span class="pre">-1</span></code> (EOF rule is not
+used). Other possible values include all valid code units. Only decimal
+numbers are recognized.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:sentinel</span> <span class="pre">=</span> <span class="pre">-1;</span></code></dt>
+<dd>Specifies the sentinel symbol used with the sentinel method of checking for
+the end of input in the generated lexer (the case when when bounds checking
+is disabled with <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code> and EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code> is not
+used). This configuration does not affect code generation. It is used by
+re2c to verify that the sentinel symbol is not allowed in the middle of the
+rule, and thus prevent possible reads past the end of buffer and crashes in
+the generated lexer. Default value is <code class="docutils literal notranslate"><span class="pre">-1</span></code>: in this case re2c assumes that
+the sentinel symbol is <code class="docutils literal notranslate"><span class="pre">0</span></code> (which is by far the most common case). Other
+possible values include all valid code units. Only decimal numbers are
+recognized.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:8</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:utf-8</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-8</span> <span class="pre">--utf-8</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:b</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:bit-vectors</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-b</span> <span class="pre">--bit-vectors</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:case-insensitive</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">--case-insensitive</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:case-inverted</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">--case-inverted</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:d</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:debug-output</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-d</span> <span class="pre">--debug-output</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:dfa-minimization</span> <span class="pre">=</span> <span class="pre">'moore';</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">--dfa-minimization</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:eager-skip</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">--eager-skip</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:e</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:ecb</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-e</span> <span class="pre">--ecb</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:empty-class</span> <span class="pre">=</span> <span class="pre">'match-empty';</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">--empty-class</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:encoding-policy</span> <span class="pre">=</span> <span class="pre">'ignore';</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">--encoding-policy</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:g</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:computed-gotos</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-g</span> <span class="pre">--computed-gotos</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:i</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:no-debug-info</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-i</span> <span class="pre">--no-debug-info</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:input</span> <span class="pre">=</span> <span class="pre">'default';</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">--input</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:lookahead</span> <span class="pre">=</span> <span class="pre">1;</span></code></dt>
+<dd>Same as inverted <code class="docutils literal notranslate"><span class="pre">--no-lookahead</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:optimize-tags</span> <span class="pre">=</span> <span class="pre">1;</span></code></dt>
+<dd>Same as inverted <code class="docutils literal notranslate"><span class="pre">--no-optimize-tags</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:P</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:posix-captures</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-P</span> <span class="pre">--posix-captures</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:s</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:nested-ifs</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-s</span> <span class="pre">--nested-ifs</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:T</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:tags</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-T</span> <span class="pre">--tags</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:u</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:unicode</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-u</span> <span class="pre">--unicode</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:w</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:wide-chars</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-w</span> <span class="pre">--wide-chars</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:flags:x</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:utf-16</span></code></dt>
+<dd>Same as <code class="docutils literal notranslate"><span class="pre">-x</span> <span class="pre">--utf-16</span></code> command-line option.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:indent:string</span> <span class="pre">=</span> <span class="pre">'\t';</span></code></dt>
+<dd>Specifies the string to use for indentation. Requires a string that contains
+only whitespace (unless you need something else for external tools). The easiest
+way to specify spaces is to enclose them in single or double quotes.
+If you do not want any indentation at all, you can set this to ‘’.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:indent:top</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Specifies the minimum amount of indentation to
+use. Requires a numeric value greater than or equal to zero.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:labelprefix</span> <span class="pre">=</span> <span class="pre">'yy';</span></code></dt>
+<dd>Allows one to change the prefix of numbered
+labels. The default is <code class="docutils literal notranslate"><span class="pre">yy</span></code>. Can be set any string that is valid in
+a label name.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:label:yyFillLabel</span> <span class="pre">=</span> <span class="pre">'yyFillLabel';</span></code></dt>
+<dd>Overrides the name of the <code class="docutils literal notranslate"><span class="pre">yyFillLabel</span></code> label.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:label:yyNext</span> <span class="pre">=</span> <span class="pre">'yyNext';</span></code></dt>
+<dd>Overrides the name of the <code class="docutils literal notranslate"><span class="pre">yyNext</span></code> label.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:startlabel</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>If set to a non zero integer, then the start
+label of the next scanner block will be generated even if it isn’t used by
+the scanner itself. Otherwise, the normal <code class="docutils literal notranslate"><span class="pre">yy0</span></code>-like start label is only
+generated if needed. If set to a text value, then a label with that
+text will be generated regardless of whether the normal start label is
+used or not. This setting is reset to 0 after a start label has been generated.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:state:abort</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>When not zero and the <code class="docutils literal notranslate"><span class="pre">-f</span></code> <code class="docutils literal notranslate"><span class="pre">--storable-state</span></code> switch is active, then
+the <code class="docutils literal notranslate"><span class="pre">YYGETSTATE</span></code> block will contain a default case that aborts and a -1
+case will be used for initialization.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:state:nextlabel</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>Used when <code class="docutils literal notranslate"><span class="pre">-f</span></code> <code class="docutils literal notranslate"><span class="pre">--storable-state</span></code> is active to control
+whether the <code class="docutils literal notranslate"><span class="pre">YYGETSTATE</span></code> block is followed by a <code class="docutils literal notranslate"><span class="pre">yyNext:</span></code> label line.
+Instead of using <code class="docutils literal notranslate"><span class="pre">yyNext</span></code>, you can usually also use configuration
+<code class="docutils literal notranslate"><span class="pre">startlabel</span></code> to force a specific start label or default to <code class="docutils literal notranslate"><span class="pre">yy0</span></code> as
+a start label. Instead of using a dedicated label, it is often better to
+separate the <code class="docutils literal notranslate"><span class="pre">YYGETSTATE</span></code> code from the actual scanner code by placing a
+<code class="docutils literal notranslate"><span class="pre">/*!getstate:re2c*/</span></code> comment.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:tags:expression</span> <span class="pre">=</span> <span class="pre">'@@';</span></code></dt>
+<dd>Allows one to customize the way re2c addresses tag variables:
+by default it emits expressions of the form <code class="docutils literal notranslate"><span class="pre">yyt<N></span></code>,
+but this might be inconvenient if tag variables are defined as fields in a struct,
+or for any other reason require special accessors.
+For example, setting <code class="docutils literal notranslate"><span class="pre">re2c:tags:expression</span> <span class="pre">=</span> <span class="pre">p->@@</span></code> will result in <code class="docutils literal notranslate"><span class="pre">p->yyt<N></span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:tags:prefix</span> <span class="pre">=</span> <span class="pre">'yyt';</span></code></dt>
+<dd>Allows one to override prefix of tag variables.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:variable:yyaccept</span> <span class="pre">=</span> <span class="pre">yyaccept;</span></code></dt>
+<dd>Overrides the name of the <code class="docutils literal notranslate"><span class="pre">yyaccept</span></code> variable.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:variable:yybm</span> <span class="pre">=</span> <span class="pre">'yybm';</span></code></dt>
+<dd>Overrides the name of the <code class="docutils literal notranslate"><span class="pre">yybm</span></code> variable.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:variable:yych</span> <span class="pre">=</span> <span class="pre">'yych';</span></code></dt>
+<dd>Overrides the name of the <code class="docutils literal notranslate"><span class="pre">yych</span></code> variable.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:variable:yyctable</span> <span class="pre">=</span> <span class="pre">'yyctable';</span></code></dt>
+<dd>When both <code class="docutils literal notranslate"><span class="pre">-c</span></code> <code class="docutils literal notranslate"><span class="pre">--conditions</span></code> and <code class="docutils literal notranslate"><span class="pre">-g</span></code> <code class="docutils literal notranslate"><span class="pre">--computed-gotos</span></code> are active,
+re2c will use this variable to generate a static jump table
+for <code class="docutils literal notranslate"><span class="pre">YYGETCONDITION</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:variable:yystable</span> <span class="pre">=</span> <span class="pre">'yystable';</span></code></dt>
+<dd>Deprecated.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:variable:yytarget</span> <span class="pre">=</span> <span class="pre">'yytarget';</span></code></dt>
+<dd>Overrides the name of the <code class="docutils literal notranslate"><span class="pre">yytarget</span></code> variable.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:yybm:hex</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>If set to zero, a decimal table will be used. Otherwise, a hexadecimal table will be generated.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:yych:conversion</span> <span class="pre">=</span> <span class="pre">0;</span></code></dt>
+<dd>When this setting is non zero, re2c automatically generates
+conversion code whenever yych gets read. In this case, the type must be
+defined using <code class="docutils literal notranslate"><span class="pre">re2c:define:YYCTYPE</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:yych:emit</span> <span class="pre">=</span> <span class="pre">1;</span></code></dt>
+<dd>Set this to zero to suppress the generation of <em>yych</em>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:yyfill:check</span> <span class="pre">=</span> <span class="pre">1;</span></code></dt>
+<dd>This can be set to 0 to suppress the generations of
+<code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code> and <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code> based precondition checks. This option is useful when
+<code class="docutils literal notranslate"><span class="pre">YYLIMIT</span> <span class="pre">+</span> <span class="pre">YYMAXFILL</span></code> is always accessible.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">1;</span></code></dt>
+<dd>Set this to zero to suppress the generation of <code class="docutils literal notranslate"><span class="pre">YYFILL</span> <span class="pre">(n)</span></code>. When using this, be sure to verify that the generated
+scanner does not read beyond the available input, as allowing such behavior might
+introduce severe security issues to your programs.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">re2c:yyfill:parameter</span> <span class="pre">=</span> <span class="pre">1;</span></code></dt>
+<dd>Controls the argument in the parentheses that follow <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>. If zero, the argument is omitted.
+If non-zero, the argument is generated unless <code class="docutils literal notranslate"><span class="pre">re2c:define:YYFILL:naked</span></code> is set to non-zero.</dd>
+</dl>
+</div>
+<div class="section" id="eof-handling">
+<h2>EOF handling<a class="headerlink" href="#eof-handling" title="Permalink to this headline">¶</a></h2>
+<p>Re2c provides a number of ways to handle end-of-input situation. Which way to
+use depends on the complexity of regular expressions, performance
+considerations, the need for input buffering and various other factors. EOF
+handling is probably the most complex part of re2c user interface — it
+definitely requires a bit of understanding of how the generated lexer works.
+But in return is allows the user to customize lexer for a particular environment
+and avoid the unnecessary overhead of generic methods when a simpler method is
+sufficient. Roughly speaking, there are four main methods:</p>
+<ul class="simple">
+<li>using sentinel symbol (simple and efficient, but limited)</li>
+<li>bounds checking with padding (generic, but complex)</li>
+<li>EOF rule: a combination of sentinel symbol and bounds checking (generic and
+simple, can be more or less efficient than bounds checking with padding
+depending on the grammar)</li>
+<li>using generic API (user-defined, so may be incorrect ;])</li>
+</ul>
+<div class="section" id="using-sentinel-symbol">
+<h3>Using sentinel symbol<a class="headerlink" href="#using-sentinel-symbol" title="Permalink to this headline">¶</a></h3>
+<p>This is the simplest and the most efficient method. It is applicable in cases
+when the input is small enough to fit into a continuous memory buffer and there
+is a natural “sentinel” symbol — a code unit that is not allowed by any of the
+regular expressions in grammar (except possibly as a terminating character).
+Sentinel symbol never appears in well-formed input, therefore it can be appended
+at the end of input and used as a stop signal by the lexer. A good example of
+such input is a null-terminated C-string, provided that the grammar does not
+allow <code class="docutils literal notranslate"><span class="pre">NULL</span></code> in the middle of lexemes. Sentinel method is very efficient,
+because the lexer does not need to perform any additional checks for the end of
+input — it comes naturally as a part of processing the next character.
+It is very important that the sentinel symbol is not allowed in the middle of
+the rule — otherwise on some inputs the lexer may read past the end of buffer
+and crash or cause memory corruption. Re2c verifies this automatically.
+Use <code class="docutils literal notranslate"><span class="pre">re2c:sentinel</span></code> configuration to specify which sentinel symbol is used.</p>
+<p>Below is an example of using sentinel method. Configuration
+<code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code> suppresses generation of end-of-input checks and
+<code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> calls.</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> * { return -1; }</span>
+<span class="cm"> [\x00] { return count; }</span>
+<span class="cm"> [a-z]+ { ++count; goto loop; }</span>
+<span class="cm"> [ ]+ { goto loop; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">""</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two three"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two 123?"</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="bounds-checking-with-padding">
+<h3>Bounds checking with padding<a class="headerlink" href="#bounds-checking-with-padding" title="Permalink to this headline">¶</a></h3>
+<p>Bounds checking is a generic method: it can be used with any input grammar.
+The basic idea is simple: we need to check for the end of input before reading
+the next input character. However, if implemented in a straightforward way, this
+would be quite inefficient: checking on each input character would cause a major
+slowdown. Re2c avoids slowdown by generating checks only in certain key states
+of the lexer, and letting it run without checks in-between the key states.
+More precisely, re2c computes strongly connected components (SCCs) of
+the underlying DFA (which roughly correspond to loops), and generates only a few
+checks per each SCC (usually just one, but in general enough to make the SCC
+acyclic). The check is of the form <code class="docutils literal notranslate"><span class="pre">(YYLIMIT</span> <span class="pre">-</span> <span class="pre">YYCURSOR)</span> <span class="pre"><</span> <span class="pre">n</span></code>, where <code class="docutils literal notranslate"><span class="pre">n</span></code>
+is the maximal length of a simple path in the corresponding SCC. If this
+condiiton is true, the lexer calls <code class="docutils literal notranslate"><span class="pre">YYFILL(n)</span></code>, which must either supply at
+least <code class="docutils literal notranslate"><span class="pre">n</span></code> input characters, or do not return. When the lexer continues after
+the check, it is certain that the next <code class="docutils literal notranslate"><span class="pre">n</span></code> characters can be read safely
+without checks.</p>
+<p>This approach reduces the number of checks significantly (and makes the lexer
+much faster as a result), but it has a downside. Since the lexer checks for
+multiple characters at once, it may end up in a situation when there are a few
+remaining input characters (less than <code class="docutils literal notranslate"><span class="pre">n</span></code>) corresponding to a short path in
+the SCC, but the lexer cannot proceed because of the check, and <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>
+cannot supply more character because it is the end of input. To solve this
+problem, re2c requires that additional padding consisting of fake characters is
+appended at the end of input. The length of padding should be <code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code>,
+which equals to the maximum <code class="docutils literal notranslate"><span class="pre">n</span></code> parameter to <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> and must be generated
+by re2c using <code class="docutils literal notranslate"><span class="pre">/*!max:re2c*/</span></code> directive. The fake characters should not form a
+valid lexeme suffix, otherwise the lexer may be fooled into matching a fake
+lexeme. Usually it’s a good idea to use <code class="docutils literal notranslate"><span class="pre">NULL</span></code> characters for padding.</p>
+<p>Below is an example of using bounds checking with padding. Note that the grammar
+rule for single-quoted strings allows arbitrary symbols in the middle of lexeme,
+so there is no natural sentinel in the grammar. Strings like <code class="docutils literal notranslate"><span class="pre">"aha\0ha"</span></code> are
+perfectly valid, but ill-formed strings like <code class="docutils literal notranslate"><span class="pre">"aha\0</span></code> are also possible and
+shouldn’t crash the lexer. In this example we do not use buffer refilling,
+therefore <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> definition simply returns an error. Note that <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>
+will only be called after the lexer reaches padding, because only then will the
+check condition be satisfied.</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdlib.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="cm">/*!max:re2c*/</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">len</span> <span class="o">=</span> <span class="n">strlen</span><span class="p">(</span><span class="n">str</span><span class="p">);</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">buf</span> <span class="o">=</span> <span class="n">malloc</span><span class="p">(</span><span class="n">len</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+ <span class="n">memcpy</span><span class="p">(</span><span class="n">buf</span><span class="p">,</span> <span class="n">str</span><span class="p">,</span> <span class="n">len</span><span class="p">);</span>
+ <span class="n">memset</span><span class="p">(</span><span class="n">buf</span> <span class="o">+</span> <span class="n">len</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">buf</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYLIMIT</span> <span class="o">=</span> <span class="n">buf</span> <span class="o">+</span> <span class="n">len</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYFILL:naked = 1;</span>
+<span class="cm"> re2c:define:YYFILL = "goto error;";</span>
+
+<span class="cm"> * { goto error; }</span>
+<span class="cm"> [\x00] { if (YYCURSOR == YYLIMIT) goto end; else goto error; }</span>
+<span class="cm"> [a-z]+ { ++count; goto loop; }</span>
+<span class="cm"> ['] ([^'] | [\\]['])* ['] { ++count; goto loop; }</span>
+<span class="cm"> [ ]+ { goto loop; }</span>
+
+<span class="cm"> */</span>
+<span class="nl">error</span><span class="p">:</span>
+ <span class="n">count</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+<span class="nl">end</span><span class="p">:</span>
+ <span class="n">free</span><span class="p">(</span><span class="n">buf</span><span class="p">);</span>
+ <span class="k">return</span> <span class="n">count</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">""</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two three"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two 123?"</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one 'two' 'th</span><span class="se">\\</span><span class="s">'ree' '123?' ''"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">5</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one 'two' 'three"</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="eof-rule">
+<h3>EOF rule<a class="headerlink" href="#eof-rule" title="Permalink to this headline">¶</a></h3>
+<p>EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code> was introduced in version 1.2. It is a hybrid approach that tries
+to take the best of both worlds: simplicity and efficiency of the sentinel
+method combined with the generality of bounds-checking method. The idea is to
+appoint an arbitrary symbol to be the sentinel, and only perform further bounds
+checking if the sentinel symbol matches (more precisely, if the symbol class that
+contains it matches). The check is of the form <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span> <span class="pre"><=</span> <span class="pre">YYCURSOR</span></code>.
+If this condition is not satisfied, then the sentinel is just an ordinary input
+character and the lexer continues. Otherwise this is a real sentinel, and the
+lexer calls <code class="docutils literal notranslate"><span class="pre">YYFILL()</span></code>. If <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> returns zero, the lexer assumes that it
+has more input and tries to re-match. Otherwise <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> returns non-zero and
+the lexer knows that it has reached the end of input. At this point there are
+three possibilities. First, it might have already matched a shorter lexeme —
+in this case it just rolls back to the last accepting state. Second, it might
+have consumed some characters, but failed to match — in this case it falls
+back to default rule <code class="docutils literal notranslate"><span class="pre">*</span></code>. Finally, it might be in the initial state — in
+this (and only this!) case it matches EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code>.</p>
+<p>Below is an example of using EOF rule. Configuration <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code>
+suppresses generation of <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> calls (but not the bounds checks).</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">str</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYLIMIT</span> <span class="o">=</span> <span class="n">str</span> <span class="o">+</span> <span class="n">strlen</span><span class="p">(</span><span class="n">str</span><span class="p">);</span>
+ <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:eof = 0;</span>
+
+<span class="cm"> * { return -1; }</span>
+<span class="cm"> $ { return count; }</span>
+<span class="cm"> [a-z]+ { ++count; goto loop; }</span>
+<span class="cm"> ['] ([^'] | [\\]['])* ['] { ++count; goto loop; }</span>
+<span class="cm"> [ ]+ { goto loop; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">""</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two three"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two 123?"</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one 'two' 'th</span><span class="se">\\</span><span class="s">'ree' '123?' ''"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">5</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one 'two' 'three"</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="using-generic-api">
+<h3>Using generic API<a class="headerlink" href="#using-generic-api" title="Permalink to this headline">¶</a></h3>
+<p>Generic API can be used with any of the above methods. It also allows one to use a
+user-defined method by placing EOF checks in one of the basic primitives.
+Usually this is either <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> (the check is performed when advancing to the
+next input character), or <code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> (the check is performed when reading the
+next input character). The resulting methods are inefficient, as they check on
+each input character. However, they can be useful in cases when the input cannot
+be buffered or padded and does not contain a sentinel character at the end. One
+should be cautious when using such ad-hoc methods, as it is easy to overlook
+some corner cases and come up with a method that only partially works. Also it
+should be noted that not everything can be expressed via generic API: for
+example, it is impossible to reimplement the way EOF rule works (in particular,
+it is impossible to re-match the character after successful <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>).</p>
+<p>Below is an example of using <code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code> to perform bounds checking without
+padding. <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> generation is suppressed using <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:enable</span> <span class="pre">=</span> <span class="pre">0;</span></code>
+configuration. Note that if the grammar was more complex, this method might not
+work in case when two rules overlap and EOF check fails after a shorter lexeme
+has already been matched (as it happens in our example, there are no overlapping
+rules).</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="cp">#define YYPEEK() *cur</span>
+<span class="cp">#define YYSKIP() if (++cur > lim) return -1</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">str</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">cur</span> <span class="o">=</span> <span class="n">str</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">lim</span> <span class="o">=</span> <span class="n">str</span> <span class="o">+</span> <span class="n">strlen</span><span class="p">(</span><span class="n">str</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:flags:input = custom;</span>
+
+<span class="cm"> * { return -1; }</span>
+<span class="cm"> [\x00] { return cur == lim ? count : -1; }</span>
+<span class="cm"> [a-z]+ { ++count; goto loop; }</span>
+<span class="cm"> ['] ([^'] | [\\]['])* ['] { ++count; goto loop; }</span>
+<span class="cm"> [ ]+ { goto loop; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">""</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two three"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">3</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one two 123?"</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one 'two' 'th</span><span class="se">\\</span><span class="s">'ree' '123?' ''"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">5</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one 'two' 'three"</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="buffer-refilling">
+<h2>Buffer refilling<a class="headerlink" href="#buffer-refilling" title="Permalink to this headline">¶</a></h2>
+<p>The need for buffering arises when the input cannot be mapped in memory all at
+once: either it is too large, or it comes in a streaming fashion (like reading
+from a socket). The usual technique in such cases is to allocate a fixed-sized
+memory buffer and process input in chunks that fit into the buffer. When the
+current chunk is processed, it is moved out and new data is moved in. In
+practice it is somewhat more complex, because lexer state consists not of a
+single input position, but a set of interrelated posiitons:</p>
+<ul class="simple">
+<li>cursor: the next input character to be read (<code class="docutils literal notranslate"><span class="pre">YYCURSOR</span></code> in default API or
+<code class="docutils literal notranslate"><span class="pre">YYSKIP</span></code>/<code class="docutils literal notranslate"><span class="pre">YYPEEK</span></code> in generic API)</li>
+<li>limit: the position after the last available input character (<code class="docutils literal notranslate"><span class="pre">YYLIMIT</span></code> in
+default API, implicitly handled by <code class="docutils literal notranslate"><span class="pre">YYLESSTHAN</span></code> in generic API)</li>
+<li>marker: the position of the most recent match, if any (<code class="docutils literal notranslate"><span class="pre">YYMARKER</span></code> in default
+API or <code class="docutils literal notranslate"><span class="pre">YYBACKUP</span></code>/<code class="docutils literal notranslate"><span class="pre">YYRESTORE</span></code> in generic API)</li>
+<li>token: the start of the current lexeme (implicit in re2c API, as it is not
+needed for the normal lexer operation and can be defined and updated by the
+user)</li>
+<li>context marker: the position of the trailing context (<code class="docutils literal notranslate"><span class="pre">YYCTXMARKER</span></code> in
+default API or <code class="docutils literal notranslate"><span class="pre">YYBACKUPCTX</span></code>/<code class="docutils literal notranslate"><span class="pre">YYRESTORECTX</span></code> in generic API)</li>
+<li>tag variables: submatch positions (defined with <code class="docutils literal notranslate"><span class="pre">/*!stags:re2c*/</span></code> and
+<code class="docutils literal notranslate"><span class="pre">/*!mtags:re2c*/</span></code> directives and
+<code class="docutils literal notranslate"><span class="pre">YYSTAGP</span></code>/<code class="docutils literal notranslate"><span class="pre">YYSTAGN</span></code>/<code class="docutils literal notranslate"><span class="pre">YYMTAGP</span></code>/<code class="docutils literal notranslate"><span class="pre">YYMTAGN</span></code> in generic API)</li>
+</ul>
+<p>Not all these are used in every case, but if used, they must be updated by
+<code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>. All active positions are contained in the segment between token and
+cursor, therefore everything between buffer start and token can be discarded,
+the segment from token and up to limit should be moved to the beginning of
+buffer, and the free space at the end of buffer should be filled with new data.
+In order to avoid frequent <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> calls it is best to fill in as many input
+characters as possible (even though fewer characters might suffice to resume the
+lexer). The details of <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> implementation are slightly different
+depending on which EOF handling method is used: the case of EOF rule is somewhat
+simpler than the case of bounds-checking with padding. Also note that if
+<code class="docutils literal notranslate"><span class="pre">-f</span> <span class="pre">--storable-state</span></code> option is used, <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> has slightly different
+semantics (desrbed in the section about storable state).</p>
+<div class="section" id="yyfill-with-eof-rule">
+<h3>YYFILL with EOF rule<a class="headerlink" href="#yyfill-with-eof-rule" title="Permalink to this headline">¶</a></h3>
+<p>If EOF rule is used, <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> is a function-like primitive that accepts
+no arguments and returns a value which is checked against zero. <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>
+invocation is triggered by condition <code class="docutils literal notranslate"><span class="pre">YYLIMIT</span> <span class="pre"><=</span> <span class="pre">YYCURSOR</span></code> in default API and
+<code class="docutils literal notranslate"><span class="pre">YYLESSTHAN()</span></code> in generic API. A non-zero return value means that <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>
+has failed. A successful <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> call must supply at least one character and
+adjust input positions accordingly. Limit must always be set to one after the
+last input position in buffer, and the character at the limit position must be
+the sentinel symbol specified by <code class="docutils literal notranslate"><span class="pre">re2c:eof</span></code> configuration. The pictures below
+show the relative locations of input positions in buffer before and after
+<code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> call (sentinel symbol is marked with <code class="docutils literal notranslate"><span class="pre">#</span></code>, and the second picture
+shows the case when there is not enough input to fill the whole buffer).</p>
+<div class="highlight-text notranslate"><div class="highlight"><pre><span></span> <-- shift -->
+ >-A------------B---------C-------------D#-----------E->
+ buffer token marker limit,
+ cursor
+>-A------------B---------C-------------D------------E#->
+ buffer, marker cursor limit
+ token
+
+ <-- shift -->
+ >-A------------B---------C-------------D#--E (EOF)
+ buffer token marker limit,
+ cursor
+>-A------------B---------C-------------D---E#........
+ buffer, marker cursor limit
+ token
+</pre></div>
+</div>
+<p>Here is an example of a program that reads input file <code class="docutils literal notranslate"><span class="pre">input.txt</span></code> in chunks of
+4096 bytes and uses EOF rule.</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="cp">#define SIZE 4096</span>
+
+<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="n">buf</span><span class="p">[</span><span class="n">SIZE</span> <span class="o">+</span> <span class="mi">1</span><span class="p">],</span> <span class="o">*</span><span class="n">lim</span><span class="p">,</span> <span class="o">*</span><span class="n">cur</span><span class="p">,</span> <span class="o">*</span><span class="n">tok</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">eof</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">Input</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">fill</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">eof</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">free</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">free</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="mi">2</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="n">memmove</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">fread</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">free</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">file</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">|=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o"><</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">;</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">init</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">file</span> <span class="o">=</span> <span class="n">file</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="n">fill</span><span class="p">(</span><span class="n">in</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="cp">#define YYFILL() fill(in)</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">cur</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYCURSOR = in->cur;</span>
+<span class="cm"> re2c:define:YYLIMIT = in->lim;</span>
+<span class="cm"> re2c:eof = 0;</span>
+
+<span class="cm"> * { return -1; }</span>
+<span class="cm"> $ { return count; }</span>
+<span class="cm"> [a-z]+ { ++count; goto loop; }</span>
+<span class="cm"> ['] ([^'] | [\\]['])* ['] { ++count; goto loop; }</span>
+<span class="cm"> [ ]+ { goto loop; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">f</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="s">"input.txt"</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">f</span><span class="p">)</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+
+ <span class="n">Input</span> <span class="n">in</span><span class="p">;</span>
+ <span class="n">init</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="n">f</span><span class="p">);</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"count: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">lex</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">));</span>
+
+ <span class="n">fclose</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="yyfill-with-padding">
+<h3>YYFILL with padding<a class="headerlink" href="#yyfill-with-padding" title="Permalink to this headline">¶</a></h3>
+<p>In the default case (when EOF rule is not used) <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> is a function-like
+primitive that accepts a single argument and does not return any value.
+<code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> invocation is triggered by condition <code class="docutils literal notranslate"><span class="pre">(YYLIMIT</span> <span class="pre">-</span> <span class="pre">YYCURSOR)</span> <span class="pre"><</span> <span class="pre">n</span></code> in
+default API and <code class="docutils literal notranslate"><span class="pre">YYLESSTHAN(n)</span></code> in generic API. The argument passed to
+<code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> is the minimal number of characters that must be supplied. If it
+fails to do so, <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> must not return to the lexer (for that reason it is
+best implemented as a macro that returns from the calling function on failure).
+In case of a successful <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> invocation the limit position must be set
+either to one after the last input position in buffer, or to the end of
+<code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code> padding (in case <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> has successfully read at least <code class="docutils literal notranslate"><span class="pre">n</span></code>
+characters, but not enough to fill the entire buffer). The pictures below show
+the relative locations of input positions in buffer before and after <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>
+invocation (<code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code> padding on the second picture is marked with <code class="docutils literal notranslate"><span class="pre">#</span></code>
+symbols).</p>
+<div class="highlight-text notranslate"><div class="highlight"><pre><span></span> <-- shift --> <-- need -->
+ >-A------------B---------C-----D-------E---F--------G->
+ buffer token marker cursor limit
+
+>-A------------B---------C-----D-------E---F--------G->
+ buffer, marker cursor limit
+ token
+
+ <-- shift --> <-- need -->
+ >-A------------B---------C-----D-------E-F (EOF)
+ buffer token marker cursor limit
+
+>-A------------B---------C-----D-------E-F###############
+ buffer, marker cursor limit
+ token <- YYMAXFILL ->
+</pre></div>
+</div>
+<p>Here is an example of a program that reads input file <code class="docutils literal notranslate"><span class="pre">input.txt</span></code> in chunks of
+4096 bytes and uses bounds-checking with padding.</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="cm">/*!max:re2c*/</span>
+<span class="cp">#define SIZE 4096</span>
+
+<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="n">buf</span><span class="p">[</span><span class="n">SIZE</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">],</span> <span class="o">*</span><span class="n">lim</span><span class="p">,</span> <span class="o">*</span><span class="n">cur</span><span class="p">,</span> <span class="o">*</span><span class="n">tok</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">eof</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">Input</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">fill</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">size_t</span> <span class="n">need</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">eof</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">free</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">free</span> <span class="o"><</span> <span class="n">need</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">return</span> <span class="mi">2</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="n">memmove</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-=</span> <span class="n">free</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">fread</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">free</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">file</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o"><</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="n">memset</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">YYMAXFILL</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">YYMAXFILL</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">init</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">FILE</span> <span class="o">*</span><span class="n">file</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">file</span> <span class="o">=</span> <span class="n">file</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">eof</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="n">fill</span><span class="p">(</span><span class="n">in</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="cp">#define YYFILL(n) if (fill(in, n) != 0) return -1</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">int</span> <span class="n">count</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">cur</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYCURSOR = in->cur;</span>
+<span class="cm"> re2c:define:YYLIMIT = in->lim;</span>
+
+<span class="cm"> * { return -1; }</span>
+<span class="cm"> [\x00] { return (YYMAXFILL == in->lim - in->tok) ? count : -1; }</span>
+<span class="cm"> [a-z]+ { ++count; goto loop; }</span>
+<span class="cm"> ['] ([^'] | [\\]['])* ['] { ++count; goto loop; }</span>
+<span class="cm"> [ ]+ { goto loop; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="kt">FILE</span> <span class="o">*</span><span class="n">f</span> <span class="o">=</span> <span class="n">fopen</span><span class="p">(</span><span class="s">"input.txt"</span><span class="p">,</span> <span class="s">"rb"</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">f</span><span class="p">)</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+
+ <span class="n">Input</span> <span class="n">in</span><span class="p">;</span>
+ <span class="n">init</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="n">f</span><span class="p">);</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"count: %d</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">lex</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">));</span>
+
+ <span class="n">fclose</span><span class="p">(</span><span class="n">f</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+</div>
+<div class="section" id="include-files">
+<h2>Include files<a class="headerlink" href="#include-files" title="Permalink to this headline">¶</a></h2>
+<p>Re2c allows one to include other files using directive <code class="docutils literal notranslate"><span class="pre">/*!include:re2c</span> <span class="pre">FILE</span> <span class="pre">*/</span></code>,
+where <code class="docutils literal notranslate"><span class="pre">FILE</span></code> is the name of file to be included. Re2c looks for included
+files in the directory of the including file and in include locations, which
+can be specified with <code class="docutils literal notranslate"><span class="pre">-I</span></code> option.
+Re2c include directive works in the same way as C/C++ <code class="docutils literal notranslate"><span class="pre">#include</span></code>: the contents
+of <code class="docutils literal notranslate"><span class="pre">FILE</span></code> are copy-pasted verbatim in place of the directive. Include files
+may have further includes of their own.
+Re2c provides some predefined include files that can be found in the
+<code class="docutils literal notranslate"><span class="pre">include/</span></code> subdirectory of the project. These files contain definitions that
+can be useful to other projects (such as Unicode categories) and form something
+like a standard library for re2c.</p>
+<p>Here is an example of using include files:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="c1">// definitions.re</span>
+<span class="cm">/*!re2c</span>
+<span class="cm"> alpha = [a-zA-Z];</span>
+<span class="cm"> digit = [0-9];</span>
+<span class="cm">*/</span>
+
+<span class="c1">// main.re</span>
+<span class="cm">/*!include:re2c "definitions.re" */</span>
+<span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> alpha { return 1; }</span>
+<span class="cm"> digit { return 2; }</span>
+<span class="cm"> * { return 0; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="header-files">
+<h2>Header files<a class="headerlink" href="#header-files" title="Permalink to this headline">¶</a></h2>
+<p>Re2c allows one to generate header file from the input <code class="docutils literal notranslate"><span class="pre">.re</span></code> file using option
+<code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> (or the corresponding configurations) and directives
+<code class="docutils literal notranslate"><span class="pre">/*!header:re2c:on*/</span></code> and <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:off*/</span></code>. The first directive
+marks the beginning of header file, and the second directive marks the end of
+it. Everything between these directives is processed by re2c, and the generated
+code is written to the file specified by the <code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> option (or
+<code class="docutils literal notranslate"><span class="pre">stdout</span></code> if this option was not used). Autogenerated header file may be needed
+in cases when re2c is used to generate definitions of constants, variables and
+structs that must be visible from other translation units.</p>
+<p>Here is an example of generating a header that contains definitions of
+<code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code> and lexer state with tag variables. Note that <code class="docutils literal notranslate"><span class="pre">YYMAXFILL</span></code> and
+tag variables depend on the grammar in the <code class="docutils literal notranslate"><span class="pre">.re</span></code> file and cannot be
+hard-coded.</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cm">/*!header:re2c:on*/</span>
+<span class="cm">/*!max:re2c*/</span>
+<span class="k">struct</span> <span class="n">State</span> <span class="p">{</span>
+ <span class="kt">char</span> <span class="n">buffer</span><span class="p">[</span><span class="mi">4096</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">],</span> <span class="o">*</span><span class="n">cursor</span><span class="p">,</span> <span class="o">*</span><span class="n">marker</span><span class="p">,</span> <span class="o">*</span><span class="n">limit</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = "char *@@; "; */</span>
+<span class="p">};</span>
+<span class="cm">/*!header:re2c:off*/</span>
+
+<span class="cp">#include</span> <span class="cpf">"lex.h"</span><span class="cp"></span>
+<span class="cp">#define YYCTYPE char</span>
+<span class="cp">#define YYCURSOR state->cursor</span>
+<span class="cp">#define YYMARKER state->marker</span>
+<span class="cp">#define YYLIMIT state->limit</span>
+<span class="cp">#define YYFILL(n) return 2</span>
+<span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="n">State</span> <span class="o">*</span><span class="n">state</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">x</span><span class="p">,</span> <span class="o">*</span><span class="n">y</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:tags:expression = state->@@;</span>
+<span class="cm"> re2c:flags:t = lex.h;</span>
+
+<span class="cm"> "a"* @x "b"* @y "c"* { return 0; }</span>
+<span class="cm"> * { return 1; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>The generated header looks like this:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cp">#define YYMAXFILL 1</span>
+
+<span class="k">struct</span> <span class="n">State</span> <span class="p">{</span>
+ <span class="kt">char</span> <span class="n">buffer</span><span class="p">[</span><span class="mi">4096</span> <span class="o">+</span> <span class="n">YYMAXFILL</span><span class="p">],</span> <span class="o">*</span><span class="n">cursor</span><span class="p">,</span> <span class="o">*</span><span class="n">marker</span><span class="p">,</span> <span class="o">*</span><span class="n">limit</span><span class="p">;</span>
+ <span class="kt">char</span> <span class="o">*</span><span class="n">yyt1</span><span class="p">;</span> <span class="kt">char</span> <span class="o">*</span><span class="n">yyt2</span><span class="p">;</span>
+<span class="p">};</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="submatch-extraction">
+<h2>Submatch extraction<a class="headerlink" href="#submatch-extraction" title="Permalink to this headline">¶</a></h2>
+<p>Submatch extraction in re2c is based on the lookahead-TDFA algorithm described
+in the
+<a class="reference external" href="https://arxiv.org/abs/1907.08837">Tagged Deterministic Finite Automata with Lookahead</a>
+paper. The algorithm uses the notion of “tags” — position markers that denote
+positions in the regular expression for which the lexer must determine the
+corresponding position in the input string.
+Re2c provides two options for submatch extraction: the first one allows to use
+raw tags, and the second one allows to use the more conventional parenthesized
+capturing groups.</p>
+<p>The first option is <code class="docutils literal notranslate"><span class="pre">-T</span> <span class="pre">--tags</span></code>. With this option one can use standalone tags
+of the form <code class="docutils literal notranslate"><span class="pre">@stag</span></code> and <code class="docutils literal notranslate"><span class="pre">#mtag</span></code>, where <code class="docutils literal notranslate"><span class="pre">stag</span></code> and <code class="docutils literal notranslate"><span class="pre">mtag</span></code> are arbitrary
+used-defined names. Tags can be used anywhere inside of a regular expression.
+Tags of the form <code class="docutils literal notranslate"><span class="pre">@stag</span></code> are
+called s-tags: they denote a single submatch value (the last input position
+where this tag matched). Tags of the form <code class="docutils literal notranslate"><span class="pre">#mtag</span></code> are called m-tags: they
+denote multiple submatch values (the whole history of repetitions of this tag).
+All tags should be defined by the user as variables with the corresponding
+names. With standalone tags re2c uses leftmost greedy disambiguation: submatch
+positions correspond to the leftmost matching path through the regular
+expression.</p>
+<p>The second option is <code class="docutils literal notranslate"><span class="pre">-P</span> <span class="pre">--posix-captures</span></code>: it enables POSIX-compliant
+capturing groups. In this mode parentheses in regular expressions denote the
+beginning and the end of capturing groups; the whole regular expression is group
+number zero. The number of groups for the matching rule is stored in a variable
+<code class="docutils literal notranslate"><span class="pre">yynmatch</span></code>, and submatch results are stored in <code class="docutils literal notranslate"><span class="pre">yypmatch</span></code> array. Both
+<code class="docutils literal notranslate"><span class="pre">yynmatch</span></code> and <code class="docutils literal notranslate"><span class="pre">yypmatch</span></code> should be defined by the user, and <code class="docutils literal notranslate"><span class="pre">yypmatch</span></code>
+size must be at least <code class="docutils literal notranslate"><span class="pre">[yynmatch</span> <span class="pre">*</span> <span class="pre">2]</span></code>. Re2c provides a directive
+<code class="docutils literal notranslate"><span class="pre">/*!maxnmatch:re2c*/</span></code> that defines <code class="docutils literal notranslate"><span class="pre">YYMAXNMATCH</span></code>: a constant equal to the
+maximal value of <code class="docutils literal notranslate"><span class="pre">yynmatch</span></code> among all rules. Note that re2c implements
+POSIX-compliant disambiguation: each subexpression matches as long as possible,
+and subexpressions that start earlier in regular expression have priority over
+those starting later. Capturing groups are translated into s-tags under the
+hood.</p>
+<p>The overhead on submatch extraction in the generated lexer grows with the
+number of tags — if this number is moderate, the overhead is barely
+noticeable. In the lexer tags are implemented using a number of tag variables
+generated by re2c. There is no one-to-one correspondence between tag variables
+and tags: a single variable may be reused for different tags, and one tag may
+require multiple variables to hold all its ambiguous values. Eventually
+ambiguity is resolved, and only one final variable per tag survives. When a rule
+matches, all its tags are set to the values of the corresponding tag variables.
+The exact number of tag variables is unknown to the user; this number is
+determined by re2c. However, tag variables should be defined by the user as a
+part of the lexer state and updated by <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code>, therefore re2c provides
+directives <code class="docutils literal notranslate"><span class="pre">/*!stags:re2c*/</span></code> and <code class="docutils literal notranslate"><span class="pre">/*!mtags:re2c*/</span></code> that can be used to
+declare, initialize and manipulate tag variables. These directives have two
+optional configurations: <code class="docutils literal notranslate"><span class="pre">format</span> <span class="pre">=</span> <span class="pre">"@@";</span></code> (specifies the template where <code class="docutils literal notranslate"><span class="pre">@@</span></code>
+is substituted with the name of each tag variable), and <code class="docutils literal notranslate"><span class="pre">separator</span> <span class="pre">=</span> <span class="pre">"";</span></code>
+(specifies the piece of code used to join the generated pieces for different
+tag variables).</p>
+<p>S-tags support the following operations:</p>
+<ul class="simple">
+<li>save input position to an s-tag: <code class="docutils literal notranslate"><span class="pre">t</span> <span class="pre">=</span> <span class="pre">YYCURSOR</span></code> with default API or a
+user-defined operation <code class="docutils literal notranslate"><span class="pre">YYSTAGP(t)</span></code> with generic API</li>
+<li>save default value to an s-tag: <code class="docutils literal notranslate"><span class="pre">t</span> <span class="pre">=</span> <span class="pre">NULL</span></code> with default API or a
+user-defined operation <code class="docutils literal notranslate"><span class="pre">YYSTAGN(t)</span></code> with generic API</li>
+<li>copy one s-tag to another: <code class="docutils literal notranslate"><span class="pre">t1</span> <span class="pre">=</span> <span class="pre">t2</span></code></li>
+</ul>
+<p>M-tags support the following operations:</p>
+<ul class="simple">
+<li>append input position to an m-tag: a user-defined operation <code class="docutils literal notranslate"><span class="pre">YYMTAGP(t)</span></code>
+with both default and generic API</li>
+<li>append default value to an m-tag: a user-defined operation <code class="docutils literal notranslate"><span class="pre">YYMTAGN(t)</span></code>
+with both default and generic API</li>
+<li>copy one m-tag to another: <code class="docutils literal notranslate"><span class="pre">t1</span> <span class="pre">=</span> <span class="pre">t2</span></code></li>
+</ul>
+<p>S-tags can be implemented as scalar values (pointers or offsets). M-tags need a
+more complex representation, as they need to store a sequence of tag values. The
+most naive and inefficient representation of an m-tag is a list (array, vector)
+of tag values; a more efficient representation is to store all m-tags in a
+prefix-tree represented as array of nodes <code class="docutils literal notranslate"><span class="pre">(v,</span> <span class="pre">p)</span></code>, where <code class="docutils literal notranslate"><span class="pre">v</span></code> is tag value
+and <code class="docutils literal notranslate"><span class="pre">p</span></code> is a pointer to parent node.</p>
+<p>Here is an example of using s-tags to parse an IPv4 address.</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdint.h></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="kt">uint32_t</span> <span class="nf">num</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">e</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">uint32_t</span> <span class="n">n</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="k">for</span> <span class="p">(;</span> <span class="n">s</span> <span class="o"><</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">s</span><span class="p">)</span> <span class="n">n</span> <span class="o">=</span> <span class="n">n</span> <span class="o">*</span> <span class="mi">10</span> <span class="o">+</span> <span class="p">(</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="sc">'0'</span><span class="p">);</span>
+ <span class="k">return</span> <span class="n">n</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">uint32_t</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">,</span> <span class="o">*</span><span class="n">o1</span><span class="p">,</span> <span class="o">*</span><span class="n">o2</span><span class="p">,</span> <span class="o">*</span><span class="n">o3</span><span class="p">,</span> <span class="o">*</span><span class="n">o4</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = 'const char *@@;'; */</span>
+
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:flags:tags = 1;</span>
+
+<span class="cm"> oct = [0-9]{1,3};</span>
+<span class="cm"> dot = [.];</span>
+
+<span class="cm"> @o1 oct dot @o2 oct dot @o3 oct dot @o4 oct {</span>
+<span class="cm"> return num(o4, YYCURSOR)</span>
+<span class="cm"> + (num(o3, o4 - 1) << 8)</span>
+<span class="cm"> + (num(o2, o3 - 1) << 16)</span>
+<span class="cm"> + (num(o1, o2 - 1) << 24);</span>
+<span class="cm"> }</span>
+<span class="cm"> * { return 0; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"1.2.3.4"</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0x01020304</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0x7f000001</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"255.255.255.255"</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0xffffffff</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Here is an example of using POSIX capturing groups to parse an IPv4 address.</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdint.h></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="kt">uint32_t</span> <span class="nf">num</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">s</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">e</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="kt">uint32_t</span> <span class="n">n</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="k">for</span> <span class="p">(;</span> <span class="n">s</span> <span class="o"><</span> <span class="n">e</span><span class="p">;</span> <span class="o">++</span><span class="n">s</span><span class="p">)</span> <span class="n">n</span> <span class="o">=</span> <span class="n">n</span> <span class="o">*</span> <span class="mi">10</span> <span class="o">+</span> <span class="p">(</span><span class="o">*</span><span class="n">s</span> <span class="o">-</span> <span class="sc">'0'</span><span class="p">);</span>
+ <span class="k">return</span> <span class="n">n</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="cm">/*!maxnmatch:re2c*/</span>
+
+<span class="k">static</span> <span class="kt">uint32_t</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">yypmatch</span><span class="p">[</span><span class="n">YYMAXNMATCH</span><span class="p">];</span>
+ <span class="kt">uint32_t</span> <span class="n">yynmatch</span><span class="p">;</span>
+ <span class="cm">/*!stags:re2c format = 'const char *@@;'; */</span>
+
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:flags:posix-captures = 1;</span>
+
+<span class="cm"> oct = [0-9]{1,3};</span>
+<span class="cm"> dot = [.];</span>
+
+<span class="cm"> (oct) dot (oct) dot (oct) dot (oct) {</span>
+<span class="cm"> return num(yypmatch[8], yypmatch[9])</span>
+<span class="cm"> + (num(yypmatch[6], yypmatch[7]) << 8)</span>
+<span class="cm"> + (num(yypmatch[4], yypmatch[5]) << 16)</span>
+<span class="cm"> + (num(yypmatch[2], yypmatch[3]) << 24);</span>
+<span class="cm"> }</span>
+<span class="cm"> * { return 0; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"1.2.3.4"</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0x01020304</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"127.0.0.1"</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0x7f000001</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"255.255.255.255"</span><span class="p">)</span> <span class="o">==</span> <span class="mh">0xffffffff</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Here is an example of using m-tags to parse a semicolon-separated sequence of
+words (C++). Tag variables are stored in a tree that is packed in a vector.</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><vector></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string></span><span class="cp"></span>
+
+<span class="k">static</span> <span class="k">const</span> <span class="kt">int</span> <span class="n">ROOT</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+
+<span class="k">struct</span> <span class="n">Mtag</span> <span class="p">{</span>
+ <span class="kt">int</span> <span class="n">pred</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">tag</span><span class="p">;</span>
+<span class="p">};</span>
+
+<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">Mtag</span><span class="o">></span> <span class="n">MtagTree</span><span class="p">;</span>
+<span class="k">typedef</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o"><</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="o">></span> <span class="n">Words</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">mtag</span><span class="p">(</span><span class="kt">int</span> <span class="o">*</span><span class="n">pt</span><span class="p">,</span> <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">t</span><span class="p">,</span> <span class="n">MtagTree</span> <span class="o">*</span><span class="n">tree</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">Mtag</span> <span class="n">m</span> <span class="o">=</span> <span class="p">{</span><span class="o">*</span><span class="n">pt</span><span class="p">,</span> <span class="n">t</span><span class="p">};</span>
+ <span class="o">*</span><span class="n">pt</span> <span class="o">=</span> <span class="p">(</span><span class="kt">int</span><span class="p">)</span><span class="n">tree</span><span class="o">-></span><span class="n">size</span><span class="p">();</span>
+ <span class="n">tree</span><span class="o">-></span><span class="n">push_back</span><span class="p">(</span><span class="n">m</span><span class="p">);</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">unfold</span><span class="p">(</span><span class="k">const</span> <span class="n">MtagTree</span> <span class="o">&</span><span class="n">tree</span><span class="p">,</span> <span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="kt">int</span> <span class="n">y</span><span class="p">,</span> <span class="n">Words</span> <span class="o">&</span><span class="n">words</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">x</span> <span class="o">==</span> <span class="n">ROOT</span><span class="p">)</span> <span class="k">return</span><span class="p">;</span>
+ <span class="n">unfold</span><span class="p">(</span><span class="n">tree</span><span class="p">,</span> <span class="n">tree</span><span class="p">[</span><span class="n">x</span><span class="p">].</span><span class="n">pred</span><span class="p">,</span> <span class="n">tree</span><span class="p">[</span><span class="n">y</span><span class="p">].</span><span class="n">pred</span><span class="p">,</span> <span class="n">words</span><span class="p">);</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">px</span> <span class="o">=</span> <span class="n">tree</span><span class="p">[</span><span class="n">x</span><span class="p">].</span><span class="n">tag</span><span class="p">,</span> <span class="o">*</span><span class="n">py</span> <span class="o">=</span> <span class="n">tree</span><span class="p">[</span><span class="n">y</span><span class="p">].</span><span class="n">tag</span><span class="p">;</span>
+ <span class="n">words</span><span class="p">.</span><span class="n">push_back</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span><span class="p">(</span><span class="n">px</span><span class="p">,</span> <span class="n">py</span> <span class="o">-</span> <span class="n">px</span><span class="p">));</span>
+<span class="p">}</span>
+
+<span class="cp">#define YYMTAGP(t) mtag(&t, YYCURSOR, &tree)</span>
+<span class="cp">#define YYMTAGN(t) mtag(&t, NULL, &tree)</span>
+<span class="k">static</span> <span class="kt">bool</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">,</span> <span class="n">Words</span> <span class="o">&</span><span class="n">words</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="cm">/*!mtags:re2c format = "int @@ = ROOT;"; */</span>
+ <span class="n">MtagTree</span> <span class="n">tree</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">;</span>
+
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:flags:tags = 1;</span>
+
+<span class="cm"> (#x [a-zA-Z0-9_]+ #y [;])+ {</span>
+<span class="cm"> words.clear();</span>
+<span class="cm"> unfold(tree, x, y, words);</span>
+<span class="cm"> return true;</span>
+<span class="cm"> }</span>
+<span class="cm"> * { return false; }</span>
+
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">Words</span> <span class="n">w</span><span class="p">;</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"one;tw0;three;"</span><span class="p">,</span> <span class="n">w</span><span class="p">)</span> <span class="o">&&</span> <span class="n">w</span> <span class="o">==</span> <span class="n">Words</span><span class="p">({</span><span class="s">"one"</span><span class="p">,</span> <span class="s">"tw0"</span><span class="p">,</span> <span class="s">"three"</span><span class="p">}));</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="storable-state">
+<h2>Storable state<a class="headerlink" href="#storable-state" title="Permalink to this headline">¶</a></h2>
+<p>With <code class="docutils literal notranslate"><span class="pre">-f</span></code> <code class="docutils literal notranslate"><span class="pre">--storable-state</span></code> option re2c generates a lexer that can store
+its current state, return to the caller, and later resume operations exactly
+where it left off. The default mode of operation in re2c is a “pull” model,
+in which the lexer “pulls” more input whenever it needs it. This may be
+unacceptable in cases when the input becomes available piece by piece (for
+example, if the lexer is invoked by the parser, or if the lexer program
+communicates via a socket protocol with some other program that must wait for a
+reply from the lexer before it transmits the next message). Storable state
+feature is intended exactly for such cases: it allows one to generate lexers that
+work in a “push” model. When the lexer needs more input, it stores its state and
+returns to the caller. Later, when more input becomes available, the caller
+resumes the lexer exactly where it stopped. There are a few changes necessary
+compared to the “pull” model:</p>
+<ul class="simple">
+<li>Define <code class="docutils literal notranslate"><span class="pre">YYSETSTATE()</span></code> and <code class="docutils literal notranslate"><span class="pre">YYGETSTATE(state)</span></code> promitives.</li>
+<li>Define <code class="docutils literal notranslate"><span class="pre">yych</span></code>, <code class="docutils literal notranslate"><span class="pre">yyaccept</span></code> and <code class="docutils literal notranslate"><span class="pre">state</span></code> variables as a part of persistent
+lexer state. The <code class="docutils literal notranslate"><span class="pre">state</span></code> variable should be initialized to <code class="docutils literal notranslate"><span class="pre">-1</span></code>.</li>
+<li><code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> should return to the outer program instead of trying to supply more
+input. Return code should indicate that lexer needs more input.</li>
+<li>The outer program should recognize situations when lexer needs more input and
+respond appropriately.</li>
+<li>Use <code class="docutils literal notranslate"><span class="pre">/*!getstate:re2c*/</span></code> directive if it is necessary to execute any code
+before entering the lexer.</li>
+<li>Use configurations <code class="docutils literal notranslate"><span class="pre">state:abort</span></code> and <code class="docutils literal notranslate"><span class="pre">state:nextlabel</span></code> to further tweak
+the generated code.</li>
+</ul>
+<p>Here is an example of a “push”-model lexer that reads input from <code class="docutils literal notranslate"><span class="pre">stdin</span></code> and
+expects a sequence of words separated by spaces and newlines. The lexer loops
+forever, waiting for more input. It can be terminated by sending a special EOF
+token — a word “stop”, in which case the lexer terminates successfully and
+prints the number of words it has seen. Abnormal termination happens in case of
+a syntax error, premature end of input (without the “stop” word) or in case the
+buffer is too small to hold a lexeme (for example, if one of the words exceeds
+buffer size). Premature end of input happens in case the lexer fails to read any
+input while being in the initial state — this is the only case when EOF rule
+matches. Note that the lexer may call <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> twice before terminating (and
+thus require hitting <code class="docutils literal notranslate"><span class="pre">Ctrl+D</span></code> a few times). First time <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> is called
+when the lexer expects continuation of the current greedy lexeme (either a word
+or a whitespace sequence). If <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> fails, the lexer knows that it has
+reached the end of the current lexeme and executes the corresponding semantic
+action. The action jumps to the beginning of the loop, the lexer enters the
+initial state and calls <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> once more. If it fails, the lexer matches EOF
+rule. (Alternatively EOF rule can be used for termination instead of a special
+EOF lexeme.)</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><string.h></span><span class="cp"></span>
+
+<span class="cp">#define SIZE 4096</span>
+
+<span class="k">typedef</span> <span class="k">struct</span> <span class="p">{</span>
+ <span class="kt">char</span> <span class="n">buf</span><span class="p">[</span><span class="n">SIZE</span> <span class="o">+</span> <span class="mi">1</span><span class="p">],</span> <span class="o">*</span><span class="n">lim</span><span class="p">,</span> <span class="o">*</span><span class="n">cur</span><span class="p">,</span> <span class="o">*</span><span class="n">tok</span><span class="p">,</span> <span class="n">yych</span><span class="p">;</span>
+ <span class="kt">unsigned</span> <span class="n">yyaccept</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">state</span><span class="p">;</span>
+<span class="p">}</span> <span class="n">Input</span><span class="p">;</span>
+
+<span class="k">static</span> <span class="kt">void</span> <span class="nf">init</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span> <span class="o">+</span> <span class="n">SIZE</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// append sentinel symbol</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">yych</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">yyaccept</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">state</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">fill</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">shift</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">;</span>
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">free</span> <span class="o">=</span> <span class="n">SIZE</span> <span class="o">-</span> <span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">);</span>
+
+ <span class="k">if</span> <span class="p">(</span><span class="n">free</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span> <span class="c1">// not enough space in buffer</span>
+
+ <span class="n">memmove</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">buf</span><span class="p">,</span> <span class="n">in</span><span class="o">-></span><span class="n">tok</span><span class="p">,</span> <span class="n">SIZE</span> <span class="o">-</span> <span class="n">shift</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">-=</span> <span class="n">shift</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">cur</span> <span class="o">-=</span> <span class="n">shift</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">-=</span> <span class="n">shift</span><span class="p">;</span>
+
+ <span class="k">const</span> <span class="kt">size_t</span> <span class="n">read</span> <span class="o">=</span> <span class="n">fread</span><span class="p">(</span><span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">free</span><span class="p">,</span> <span class="n">stdin</span><span class="p">);</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span> <span class="o">+=</span> <span class="n">read</span><span class="p">;</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">lim</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// append sentinel symbol</span>
+
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+<span class="k">typedef</span> <span class="k">enum</span> <span class="p">{</span><span class="n">OK</span><span class="p">,</span> <span class="n">SYNTAX_ERROR</span><span class="p">,</span> <span class="n">UNEXPECTED_EOF</span><span class="p">,</span> <span class="n">NEED_MORE_INPUT</span><span class="p">}</span> <span class="n">Status</span><span class="p">;</span>
+
+<span class="cp">#define YYGETSTATE() in->state</span>
+<span class="cp">#define YYSETSTATE(s) in->state = s</span>
+<span class="cp">#define YYFILL() return NEED_MORE_INPUT</span>
+<span class="k">static</span> <span class="n">Status</span> <span class="nf">lex</span><span class="p">(</span><span class="n">Input</span> <span class="o">*</span><span class="n">in</span><span class="p">,</span> <span class="kt">unsigned</span> <span class="o">*</span><span class="n">words</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="cm">/*!getstate:re2c*/</span>
+<span class="nl">loop</span><span class="p">:</span>
+ <span class="n">in</span><span class="o">-></span><span class="n">tok</span> <span class="o">=</span> <span class="n">in</span><span class="o">-></span><span class="n">cur</span><span class="p">;</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:define:YYCURSOR = in->cur;</span>
+<span class="cm"> re2c:define:YYLIMIT = in->lim;</span>
+<span class="cm"> re2c:variable:yych = in->yych;</span>
+<span class="cm"> re2c:eof = 0;</span>
+
+<span class="cm"> * { return SYNTAX_ERROR; }</span>
+<span class="cm"> $ { return UNEXPECTED_EOF; }</span>
+<span class="cm"> "stop" { return OK; }</span>
+<span class="cm"> [\n ]+ { goto loop; }</span>
+<span class="cm"> [a-zA-Z]+ { *words = *words + 1; goto loop; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="kt">unsigned</span> <span class="n">words</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
+ <span class="n">Input</span> <span class="n">in</span><span class="p">;</span>
+ <span class="n">init</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">);</span>
+
+ <span class="k">for</span> <span class="p">(;;)</span> <span class="p">{</span>
+ <span class="k">const</span> <span class="n">Status</span> <span class="n">st</span> <span class="o">=</span> <span class="n">lex</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">,</span> <span class="o">&</span><span class="n">words</span><span class="p">);</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">st</span> <span class="o">==</span> <span class="n">OK</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"word count: %u</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">words</span><span class="p">);</span>
+ <span class="k">break</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">st</span> <span class="o">==</span> <span class="n">SYNTAX_ERROR</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"error: unexpected symbol</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">1</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">st</span> <span class="o">==</span> <span class="n">UNEXPECTED_EOF</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"error: unexpected end of input</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">2</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">fill</span><span class="p">(</span><span class="o">&</span><span class="n">in</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"error: not enough space in buffer</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">3</span><span class="p">;</span>
+ <span class="p">}</span>
+ <span class="p">}</span>
+
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+</div>
+<div class="section" id="reusable-blocks">
+<h2>Reusable blocks<a class="headerlink" href="#reusable-blocks" title="Permalink to this headline">¶</a></h2>
+<p>Reuse mode is enabled with the <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">--reusable</span></code> option. In this mode re2c
+allows one to reuse definitions, configurations and rules specified by a
+<code class="docutils literal notranslate"><span class="pre">/*!rules:re2c*/</span></code> block in subsequent <code class="docutils literal notranslate"><span class="pre">/*!use:re2c*/</span></code> blocks. As of
+re2c-1.2 it is possible to mix such blocks with normal <code class="docutils literal notranslate"><span class="pre">/*!re2c*/</span></code> blocks;
+prior to that re2c expects a single rules-block followed by use-blocks (normal
+blocks are disallowed). Use-blocks can have additional definitions,
+configurations and rules: they are merged to those specified by the rules-block.
+A very common use case for <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">--reusable</span></code> option is a lexer that supports
+multiple input encodings: lexer rules are defined once and reused multiple times
+with encoding-specific configurations, such as <code class="docutils literal notranslate"><span class="pre">re2c:flags:utf-8</span></code>.</p>
+<p>Below is an example of a multi-encoding lexer: it reads a phrase with Unicode
+math symbols and accepts input either in UTF8 or in UT32. Note that the
+<code class="docutils literal notranslate"><span class="pre">--input-encoding</span> <span class="pre">utf8</span></code> option allows us to write UTF8-encoded symbols in the
+regular expressions; without this option re2c would parse them as a plain ASCII
+byte sequnce (and we would have to use hexadecimal escape sequences).</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+<span class="cp">#include</span> <span class="cpf"><stdint.h></span><span class="cp"></span>
+
+<span class="cm">/*!rules:re2c</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+
+<span class="cm"> "∀x ∃y: p(x, y)" { return 0; }</span>
+<span class="cm"> * { return 1; }</span>
+<span class="cm">*/</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex_utf8</span><span class="p">(</span><span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="cm">/*!use:re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = uint8_t;</span>
+<span class="cm"> re2c:flags:8 = 1;</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex_utf32</span><span class="p">(</span><span class="k">const</span> <span class="kt">uint32_t</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">uint32_t</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span>
+ <span class="cm">/*!use:re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = uint32_t;</span>
+<span class="cm"> re2c:flags:8 = 0;</span>
+<span class="cm"> re2c:flags:u = 1;</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="k">static</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="n">s8</span><span class="p">[]</span> <span class="o">=</span> <span class="c1">// UTF-8</span>
+ <span class="p">{</span> <span class="mh">0xe2</span><span class="p">,</span> <span class="mh">0x88</span><span class="p">,</span> <span class="mh">0x80</span><span class="p">,</span> <span class="mh">0x78</span><span class="p">,</span> <span class="mh">0x20</span><span class="p">,</span> <span class="mh">0xe2</span><span class="p">,</span> <span class="mh">0x88</span><span class="p">,</span> <span class="mh">0x83</span><span class="p">,</span> <span class="mh">0x79</span>
+ <span class="p">,</span> <span class="mh">0x3a</span><span class="p">,</span> <span class="mh">0x20</span><span class="p">,</span> <span class="mh">0x70</span><span class="p">,</span> <span class="mh">0x28</span><span class="p">,</span> <span class="mh">0x78</span><span class="p">,</span> <span class="mh">0x2c</span><span class="p">,</span> <span class="mh">0x20</span><span class="p">,</span> <span class="mh">0x79</span><span class="p">,</span> <span class="mh">0x29</span> <span class="p">};</span>
+
+ <span class="k">static</span> <span class="k">const</span> <span class="kt">uint32_t</span> <span class="n">s32</span><span class="p">[]</span> <span class="o">=</span> <span class="c1">// UTF32</span>
+ <span class="p">{</span> <span class="mh">0x00002200</span><span class="p">,</span> <span class="mh">0x00000078</span><span class="p">,</span> <span class="mh">0x00000020</span><span class="p">,</span> <span class="mh">0x00002203</span>
+ <span class="p">,</span> <span class="mh">0x00000079</span><span class="p">,</span> <span class="mh">0x0000003a</span><span class="p">,</span> <span class="mh">0x00000020</span><span class="p">,</span> <span class="mh">0x00000070</span>
+ <span class="p">,</span> <span class="mh">0x00000028</span><span class="p">,</span> <span class="mh">0x00000078</span><span class="p">,</span> <span class="mh">0x0000002c</span><span class="p">,</span> <span class="mh">0x00000020</span>
+ <span class="p">,</span> <span class="mh">0x00000079</span><span class="p">,</span> <span class="mh">0x00000029</span> <span class="p">};</span>
+
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex_utf8</span><span class="p">(</span><span class="n">s8</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex_utf32</span><span class="p">(</span><span class="n">s32</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+
+</pre></div>
+</div>
+</div>
+<div class="section" id="encoding-support">
+<h2>Encoding support<a class="headerlink" href="#encoding-support" title="Permalink to this headline">¶</a></h2>
+<p><code class="docutils literal notranslate"><span class="pre">re2c</span></code> supports the following encodings: ASCII (default), EBCDIC (<code class="docutils literal notranslate"><span class="pre">-e</span></code>),
+UCS-2 (<code class="docutils literal notranslate"><span class="pre">-w</span></code>), UTF-16 (<code class="docutils literal notranslate"><span class="pre">-x</span></code>), UTF-32 (<code class="docutils literal notranslate"><span class="pre">-u</span></code>) and UTF-8 (<code class="docutils literal notranslate"><span class="pre">-8</span></code>).
+See also inplace configuration <code class="docutils literal notranslate"><span class="pre">re2c:flags</span></code>.</p>
+<p>The following concepts should be clarified when talking about encodings.
+A <em>code point</em> is an abstract number that represents a single symbol.
+A <em>code unit</em> is the smallest unit of memory, which is used in the
+encoded text (it corresponds to one character in the input stream). One
+or more code units may be needed to represent a single code point,
+depending on the encoding. In a <em>fixed-length</em> encoding, each code point
+is represented with an equal number of code units. In <em>variable-length</em>
+encodings, different code points can be represented with different number
+of code units.</p>
+<ul class="simple">
+<li>ASCII is a fixed-length encoding. Its code space includes 0x100
+code points, from 0 to 0xFF. A code point is represented with exactly one
+1-byte code unit, which has the same value as the code point. The size of
+<code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> must be 1 byte.</li>
+<li>EBCDIC is a fixed-length encoding. Its code space includes 0x100
+code points, from 0 to 0xFF. A code point is represented with exactly
+one 1-byte code unit, which has the same value as the code point. The size
+of <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> must be 1 byte.</li>
+<li>UCS-2 is a fixed-length encoding. Its code space includes 0x10000
+code points, from 0 to 0xFFFF. One code point is represented with
+exactly one 2-byte code unit, which has the same value as the code
+point. The size of <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> must be 2 bytes.</li>
+<li>UTF-16 is a variable-length encoding. Its code space includes all
+Unicode code points, from 0 to 0xD7FF and from 0xE000 to 0x10FFFF. One
+code point is represented with one or two 2-byte code units. The size of
+<code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> must be 2 bytes.</li>
+<li>UTF-32 is a fixed-length encoding. Its code space includes all
+Unicode code points, from 0 to 0xD7FF and from 0xE000 to 0x10FFFF. One
+code point is represented with exactly one 4-byte code unit. The size of
+<code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> must be 4 bytes.</li>
+<li>UTF-8 is a variable-length encoding. Its code space includes all
+Unicode code points, from 0 to 0xD7FF and from 0xE000 to 0x10FFFF. One
+code point is represented with a sequence of one, two, three, or four
+1-byte code units. The size of <code class="docutils literal notranslate"><span class="pre">YYCTYPE</span></code> must be 1 byte.</li>
+</ul>
+<p>In Unicode, values from range 0xD800 to 0xDFFF (surrogates) are not
+valid Unicode code points. Any encoded sequence of code units that
+would map to Unicode code points in the range 0xD800-0xDFFF, is
+ill-formed. The user can control how <code class="docutils literal notranslate"><span class="pre">re2c</span></code> treats such ill-formed
+sequences with the <code class="docutils literal notranslate"><span class="pre">--encoding-policy</span> <span class="pre"><policy></span></code> switch.</p>
+<p>For some encodings, there are code units that never occur in a valid
+encoded stream (e.g., 0xFF byte in UTF-8). If the generated scanner must
+check for invalid input, the only correct way to do so is to use the default
+rule (<code class="docutils literal notranslate"><span class="pre">*</span></code>). Note that the full range rule (<code class="docutils literal notranslate"><span class="pre">[^]</span></code>) won’t catch invalid code units when a variable-length encoding is used
+(<code class="docutils literal notranslate"><span class="pre">[^]</span></code> means “any valid code point”, whereas the default rule (<code class="docutils literal notranslate"><span class="pre">*</span></code>) means “any possible code unit”).</p>
+</div>
+<div class="section" id="start-conditions">
+<h2>Start conditions<a class="headerlink" href="#start-conditions" title="Permalink to this headline">¶</a></h2>
+<p><em>Conditions</em> are enabled with <code class="docutils literal notranslate"><span class="pre">-c</span></code> <code class="docutils literal notranslate"><span class="pre">--conditions</span></code>.
+This option allows one to encode multiple interrelated lexers within the same re2c block.</p>
+<p>Each lexer corresponds to a single <em>condition</em>.
+It starts with a label of the form <code class="docutils literal notranslate"><span class="pre">yyc_name</span></code>,
+where <code class="docutils literal notranslate"><span class="pre">name</span></code> is <em>condition</em> name
+and <code class="docutils literal notranslate"><span class="pre">yyc</span></code> prefix can be adjusted with configuration <code class="docutils literal notranslate"><span class="pre">re2c:condprefix</span></code>.
+Different lexers are separated with a comment <code class="docutils literal notranslate"><span class="pre">/*</span> <span class="pre">***********************************</span> <span class="pre">*/</span></code>
+which can be adjusted with configuration <code class="docutils literal notranslate"><span class="pre">re2c:cond:divider</span></code>.</p>
+<p>Furthermore, each <em>condition</em> has a unique identifier of the form <code class="docutils literal notranslate"><span class="pre">yycname</span></code>,
+where <code class="docutils literal notranslate"><span class="pre">name</span></code> is condition name
+and <code class="docutils literal notranslate"><span class="pre">yyc</span></code> prefix can be adjusted with configuration <code class="docutils literal notranslate"><span class="pre">re2c:condenumprefix</span></code>.
+Identifiers have the type <code class="docutils literal notranslate"><span class="pre">YYCONDTYPE</span></code> and should be generated with <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> directive or <code class="docutils literal notranslate"><span class="pre">-t</span></code> <code class="docutils literal notranslate"><span class="pre">--type-header</span></code> option.
+Users shouldn’t define these identifiers manually, as the order of <em>conditions</em> is not specified.</p>
+<p>Before all <em>conditions</em> re2c generates entry code that checks the current <em>condition</em> identifier
+and transfers control flow to the start label of the active <em>condition</em>.
+After matching some rule of this <em>condition</em>,
+lexer may either transfer control flow back to the entry code (after executing the associated action and optionally setting another <em>condition</em> with <code class="docutils literal notranslate"><span class="pre">=></span></code>),
+or use <code class="docutils literal notranslate"><span class="pre">:=></span></code> shortcut and transition directly to the start label of another <em>condition</em> (skipping the action and the entry code).
+Configuration <code class="docutils literal notranslate"><span class="pre">re2c:cond:goto</span></code> allows one to change the default behavior.</p>
+<p>Syntactically each rule must be preceded with a list of comma-separated <em>condition</em> names or a wildcard <code class="docutils literal notranslate"><span class="pre">*</span></code>
+enclosed in angle brackets <code class="docutils literal notranslate"><span class="pre"><</span></code> and <code class="docutils literal notranslate"><span class="pre">></span></code>.
+Wildcard means “any condition” and is semantically equivalent to listing all condition names.
+Here <code class="docutils literal notranslate"><span class="pre">regexp</span></code> is a regular expression, <code class="docutils literal notranslate"><span class="pre">default</span></code> refers to the <em>default rule</em> <code class="docutils literal notranslate"><span class="pre">*</span></code>,
+and <code class="docutils literal notranslate"><span class="pre">action</span></code> is a block of C/C++ code.</p>
+<ul class="simple">
+<li><code class="docutils literal notranslate"><span class="pre"><conditions-or-wildcard></span>  <span class="pre">regexp-or-default</span>                 <span class="pre">action</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre"><conditions-or-wildcard></span>  <span class="pre">regexp-or-default</span>  <span class="pre">=></span>  <span class="pre">condition</span>  <span class="pre">action</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre"><conditions-or-wildcard></span>  <span class="pre">regexp-or-default</span>  <span class="pre">:=></span> <span class="pre">condition</span></code></li>
+</ul>
+<p>Rules with an exclamation mark <code class="docutils literal notranslate"><span class="pre">!</span></code> in front of condition list have a special meaning:
+they have no regular expression,
+and the associated action is merged as an entry code to actions of normal rules.
+This might be a convenient place to peform a routine task that is common to all rules.</p>
+<ul class="simple">
+<li><code class="docutils literal notranslate"><span class="pre"><!conditions-or-wildcard></span>  <span class="pre">action</span></code></li>
+</ul>
+<p>Another special form of rules with an empty condition list <code class="docutils literal notranslate"><span class="pre"><></span></code> and no regular expression
+allows one to specify an “entry condition” that can be used to execute code before entering the lexer.
+It is semantically equivalent to a condition with number zero, name <code class="docutils literal notranslate"><span class="pre">0</span></code> and an empty regular expression.</p>
+<ul class="simple">
+<li><code class="docutils literal notranslate"><span class="pre"><></span>                 <span class="pre">action</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre"><></span>  <span class="pre">=></span>  <span class="pre">condition</span>  <span class="pre">action</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre"><></span>  <span class="pre">:=></span> <span class="pre">condition</span></code></li>
+</ul>
+</div>
+<div class="section" id="skeleton-programs">
+<h2>Skeleton programs<a class="headerlink" href="#skeleton-programs" title="Permalink to this headline">¶</a></h2>
+<p>With the <code class="docutils literal notranslate"><span class="pre">-S,</span> <span class="pre">--skeleton</span></code> option, re2c ignores all non-re2c code and generates
+a self-contained C program that can be further compiled and executed. The
+program consists of lexer code and input data. For each constructed DFA (block
+or condition) re2c generates a standalone lexer and two files: an <code class="docutils literal notranslate"><span class="pre">.input</span></code>
+file with strings derived from the DFA and a <code class="docutils literal notranslate"><span class="pre">.keys</span></code> file with expected match
+results. The program runs each lexer on the corresponding <code class="docutils literal notranslate"><span class="pre">.input</span></code> file and
+compares results with the expectations.
+Skeleton programs are very useful for a number of reasons:</p>
+<ul class="simple">
+<li>They can check correctness of various re2c optimizations (the data is
+generated early in the process, before any DFA transformations have taken
+place).</li>
+<li>Generating a set of input data with good coverage may be useful for both
+testing and benchmarking.</li>
+<li>Generating self-contained executable programs allows one to get minimized test
+cases (the original code may be large or have a lot of dependencies).</li>
+</ul>
+<p>The difficulty with generating input data is that for all but the most trivial
+cases the number of possible input strings is too large (even if the string
+length is limited). Re2c solves this difficulty by generating sufficiently
+many strings to cover almost all DFA transitions. It uses the following
+algorithm. First, it constructs a skeleton of the DFA. For encodings with 1-byte
+code unit size (such as ASCII, UTF-8 and EBCDIC) skeleton is just an exact copy
+of the original DFA. For encodings with multibyte code units skeleton is a copy
+of DFA with certain transitions omitted: namely, re2c takes at most 256 code
+units for each disjoint continuous range that corresponds to a DFA transition.
+The chosen values are evenly distributed and include range bounds. Instead of
+trying to cover all possible paths in the skeleton (which is infeasible) re2c
+generates sufficiently many paths to cover all skeleton transitions, and thus
+trigger the corresponding conditional jumps in the lexer.
+The algorithm implementation is limited by ~1Gb of transitions and consumes
+constant amount of memory (re2c writes data to file as soon as it is generated).</p>
+<p>Here is an example of a very simple program
+<a class="reference download internal" href="../_downloads/example.re.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.re]</span></code></a>
+that tries to match two-digit hexadecimal numbers:</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> [0-9a-fA-F]{2} {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</div>
+<p>We can see the generated DFA using <code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-D</span> <span class="pre">example.re</span> <span class="pre">|</span> <span class="pre">dot</span> <span class="pre">-Grankdir=LR</span> <span class="pre">-Tpng</span> <span class="pre">-o</span> <span class="pre">example.png`</span></code>:</p>
+<a class="reference internal image-reference" href="../_images/example.png"><img alt="../_images/example.png" src="../_images/example.png" style="width: 60%;" /></a>
+<p>Given this program, <code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-S</span> <span class="pre">-o</span> <span class="pre">example.c</span> <span class="pre">example.re`</span></code> generates three files:
+<code class="docutils literal notranslate"><span class="pre">example.c</span></code> (main program), <code class="docutils literal notranslate"><span class="pre">example.c.line4.input</span></code> (input data) and <code class="docutils literal notranslate"><span class="pre">example.c.line4.keys</span></code> (expected match results).
+First, let’s look at the generated strings
+<a class="reference download internal" href="../_downloads/example.c.line4.input" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.c.line4.input]</span></code></a>:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ hexdump -v -e '"%08_ax " 24/1 "%02x "' -e '" |" 24/1 "%_p" "|\n"' example.c.line4.input
+00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 |........................|
+00000018 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f |........ !"#$%&'()*+,-./|
+00000030 3a 3b 3c 3d 3e 3f 40 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 |:;<=>?@GHIJKLMNOPQRSTUVW|
+[ ... ]
+</pre></div>
+</div>
+<p>Byte sequences correspond to the paths in DFA.
+All strings are glued together, so it’s hard to tell where is the end of one string and the beginning of another.
+For that re2c generates keys <a class="reference download internal" href="../_downloads/example.c.line4.keys" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.c.line4.keys]</span></code></a>:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$hexdump -v -e '"%08_ax " 36/1 "%02x " "\n"' example.c.line4.keys
+00000000 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+00000024 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+00000048 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+[ ... ]
+</pre></div>
+</div>
+<p>A key is a triplet: string length, the length of matching prefix and the number of matching rule.
+(If tags are used, there is an additional key per each tag variable).
+Keys are packed into an array.
+In our case each key fits into 1 byte, but in case of a larger DFA they might take 2 or 4 bytes.
+The generated program <a class="reference download internal" href="../_downloads/example.c.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.c]</span></code></a>
+contains two auxilary functions: <code class="docutils literal notranslate"><span class="pre">read_file</span></code> and <code class="docutils literal notranslate"><span class="pre">action_line4</span></code>.
+<code class="docutils literal notranslate"><span class="pre">read_file</span></code> is used to map <code class="docutils literal notranslate"><span class="pre">.input</span></code> and <code class="docutils literal notranslate"><span class="pre">.keys</span></code> files into memory (this function is shared between all lexers).
+<code class="docutils literal notranslate"><span class="pre">action_line4</span></code> is a replacement for actions: it compares actual lexing results with the expected results.
+This function is specific to each lexer.
+Lexing is done by <code class="docutils literal notranslate"><span class="pre">lex_line4</span></code>: this function contains the generated DFA.
+The skeleton program is self-contained, so we can compile and run it:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ cc -o example example.c
+$ ./example
+$ echo $?
+0
+</pre></div>
+</div>
+<p>When everything is fine (there are no errors) the program outputs nothing and
+exits with zero. For the sake of example, let’s pretend that re2c has an error
+that results in a missing <code class="docutils literal notranslate"><span class="pre">case</span></code> statement:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c -S -o example.c example.re
+$ sed -i -e <span class="s2">"s/case '7'://"</span> example.c
+$ cc -o example example.c
+$ ./example
+error: lex_line4: at position <span class="m">248</span> <span class="o">(</span>iteration <span class="m">241</span><span class="o">)</span>:
+ expected: match length <span class="m">2</span>, rule <span class="m">0</span>
+ actual: match length <span class="m">1</span>, rule <span class="m">254</span>
+</pre></div>
+</div>
+<p>Viola! Now the lexer complains about discrepancy between expected and actual
+match results.</p>
+<p>One special case of failure detected by skeleton programs is undefined control
+flow in the lexer. Use <code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code> warning to catch all such
+cases in in your code (more details <a class="reference external" href="/manual/manual.html#wundefined-control-flow">here</a>).</p>
+</div>
+<div class="section" id="visualization-and-debug">
+<h2>Visualization and debug<a class="headerlink" href="#visualization-and-debug" title="Permalink to this headline">¶</a></h2>
+<p>With the <code class="docutils literal notranslate"><span class="pre">-D,</span> <span class="pre">--emit-dot</span></code> option, re2c does not generate C/C++ code. Instead,
+it dumps the generated DFA in the
+<a class="reference external" href="https://en.wikipedia.org/wiki/DOT_%28graph_description_language%29">DOT format</a>.
+One can convert this dump to an image of the DFA using
+<a class="reference external" href="http://www.graphviz.org/">graphviz</a> or another library.
+Note that this option shows the final DFA after it has gone through a number of
+optimizations and transformations. Earlier stages can be dumped with various debug
+options, such as <code class="docutils literal notranslate"><span class="pre">--dump-nfa</span></code>, <code class="docutils literal notranslate"><span class="pre">--dump-dfa-raw</span></code> etc. (see the full
+<a class="reference external" href="/manual/manual.html#command-line-options">list of options</a>).</p>
+<p>Below is an example of generating a picture of DFA that accepts any UTF-8 code point
+(<code class="docutils literal notranslate"><span class="pre">utf8_any.re</span></code>):</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> [^] {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</div>
+<p>Generate and render:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -D -8 utf8_any.re | dot -Tpng -o utf8_any.png
+</pre></div>
+</div>
+<p>Here is the picture:</p>
+<a class="reference internal image-reference" href="../_images/utf8_any.png"><img alt="../_images/utf8_any.png" src="../_images/utf8_any.png" style="width: 90%;" /></a>
+</div>
+<div class="section" id="warnings">
+<h2>Warnings<a class="headerlink" href="#warnings" title="Permalink to this headline">¶</a></h2>
+<dl class="docutils">
+<dt><code class="docutils literal notranslate"><span class="pre">-W</span></code></dt>
+<dd>Turn on all warnings.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Werror</span></code></dt>
+<dd>Turn warnings into errors. Note that this option alone
+doesn’t turn on any warnings; it only affects those warnings that have
+been turned on so far or will be turned on later.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-W<warning></span></code></dt>
+<dd>Turn on <code class="docutils literal notranslate"><span class="pre">warning</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wno-<warning></span></code></dt>
+<dd>Turn off <code class="docutils literal notranslate"><span class="pre">warning</span></code>.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Werror-<warning></span></code></dt>
+<dd>Turn on <code class="docutils literal notranslate"><span class="pre">warning</span></code> and treat it as an error (this implies <code class="docutils literal notranslate"><span class="pre">-W<warning></span></code>).</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wno-error-<warning></span></code></dt>
+<dd>Don’t treat this particular <code class="docutils literal notranslate"><span class="pre">warning</span></code> as an error. This doesn’t turn off
+the warning itself.</dd>
+</dl>
+<dl class="docutils">
+<dt><code class="docutils literal notranslate"><span class="pre">-Wcondition-order</span></code></dt>
+<dd>Warn if the generated program makes implicit
+assumptions about condition numbering. One should use either the <code class="docutils literal notranslate"><span class="pre">-t,</span> <span class="pre">--type-header</span></code> option or
+the <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> directive to generate a mapping of condition names to numbers and then use
+the autogenerated condition names.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wempty-character-class</span></code></dt>
+<dd>Warn if a regular expression contains an empty
+character class. Trying to match an empty character class makes no sense: it should always fail.
+However, for backwards compatibility reasons <code class="docutils literal notranslate"><span class="pre">re2c</span></code> allows empty character classes and
+treats them as empty strings. Use the <code class="docutils literal notranslate"><span class="pre">--empty-class</span></code> option to change the default
+behavior.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wmatch-empty-string</span></code></dt>
+<dd>Warn if a rule is nullable (matches an empty string).
+If the lexer runs in a loop and the empty match is unintentional,
+the lexer may unexpectedly hang in an infinite loop.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wswapped-range</span></code></dt>
+<dd>Warn if the lower bound of a range is greater than its upper
+bound. The default behavior is to silently swap the range bounds.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code></dt>
+<dd>Warn if some input strings cause undefined
+control flow in the lexer (the faulty patterns are reported). This is the
+most dangerous and most common mistake. It can be easily fixed by adding
+the default rule <code class="docutils literal notranslate"><span class="pre">*</span></code> which has the lowest priority, matches any code unit, and consumes
+exactly one code unit.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wunreachable-rules</span></code></dt>
+<dd>Warn about rules that are shadowed by other rules and will never match.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wuseless-escape</span></code></dt>
+<dd>Warn if a symbol is escaped when it shouldn’t be.
+By default, re2c silently ignores such escapes, but this may as well indicate a
+typo or an error in the escape sequence.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wnondeterministic-tags</span></code></dt>
+<dd>Warn if a tag has <code class="docutils literal notranslate"><span class="pre">n</span></code>-th degree of nondeterminism, where <code class="docutils literal notranslate"><span class="pre">n</span></code> is greater than 1.</dd>
+<dt><code class="docutils literal notranslate"><span class="pre">-Wsentinel-in-midrule</span></code></dt>
+<dd>Warn if the sentinel symbol occurs in the middle of a rule — this may
+cause reads past the end of buffer, crashes or memory corruption in the
+generated lexer. This warning is only applicable if the sentinel method of
+checking for the end of input is used.
+It is set to an error if <code class="docutils literal notranslate"><span class="pre">re2c:sentinel</span></code> configuration is used.</dd>
+</dl>
+<div class="section" id="wundefined-control-flow">
+<h3>[-Wundefined-control-flow]<a class="headerlink" href="#wundefined-control-flow" title="Permalink to this headline">¶</a></h3>
+<div class="toctree-wrapper compound">
+</div>
+<p>With <code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code> warning re2c checks that every path in the
+generated DFA contains at least one accepting state. When the input matches
+such a path, lexer will eventually stop and execute the corresponding semantic
+action. However, if some path has no accepting state, then lexer behavior is
+undefined: it may loop forever, or read past the end of buffer, or jump to some
+other semantic action by accident. For example, consider this simple piece of
+code (a.re) that is supposed to match letter <code class="docutils literal notranslate"><span class="pre">a</span></code>:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> "a" { return 'a'; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>The generated code looks like this:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">{</span>
+ <span class="n">YYCTYPE</span> <span class="n">yych</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">YYLIMIT</span> <span class="o"><=</span> <span class="n">YYCURSOR</span><span class="p">)</span> <span class="n">YYFILL</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'a'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy3</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy2</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy2</span><span class="p">:</span>
+<span class="nl">yy3</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="sc">'a'</span><span class="p">;</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Clearly this is not what we want: this code matches any letter, not just <code class="docutils literal notranslate"><span class="pre">a</span></code>!
+This happens because we did not specify any handler for the remaining input symbols.
+If we run re2c with <code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code>, we will see that it complains about undefined control flow and recommends using default rule <code class="docutils literal notranslate"><span class="pre">*</span></code>:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>a.re:3:2: warning: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use the default '*' rule [-Wundefined-control-flow]
+</pre></div>
+</div>
+<p>Let’s follow the advice and change the code:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * { return '*'; }</span>
+<span class="cm"> "a" { return 'a'; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Now the generated code looks much better:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">{</span>
+ <span class="n">YYCTYPE</span> <span class="n">yych</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">YYLIMIT</span> <span class="o"><=</span> <span class="n">YYCURSOR</span><span class="p">)</span> <span class="n">YYFILL</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'a'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy4</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy2</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy2</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="sc">'*'</span><span class="p">;</span> <span class="p">}</span>
+<span class="nl">yy4</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="sc">'a'</span><span class="p">;</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Note that the default rule brings no overhead: it simply binds code to the
+default label. It should always be used, unless you are absolutely sure that
+your grammar covers all possible cases.</p>
+<div class="section" id="the-old-default-rule">
+<h4>The old default rule<a class="headerlink" href="#the-old-default-rule" title="Permalink to this headline">¶</a></h4>
+<p>When the world was young and re2c didn’t have the default <code class="docutils literal notranslate"><span class="pre">*</span></code> rule (that is,
+before re2c-0.13.7) everyone used <code class="docutils literal notranslate"><span class="pre">[^]</span></code> as the default rule, as in this
+example (any.re):</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> // ... normal rules ...</span>
+<span class="cm"> [^] { return "any"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p><code class="docutils literal notranslate"><span class="pre">[^]</span></code> is just an ordinary rule: it matches any character and has normal
+priority (so it should be the last rule). If other rules didn’t match, <code class="docutils literal notranslate"><span class="pre">[^]</span></code>
+will match and consume one character.</p>
+<p>But exactly what is a <em>character</em>? First, an abstract number that is assigned
+some sacred meaning within the current encoding — a <em>code point</em>. Second, a
+minimal piece of information (say, combination of bits) that can represent a
+unit of encoded text — a <em>code unit</em>. Rules are defined in terms of code points.
+Input is measured in code units. In fixed-width encodings (such as ASCII,
+EBCDIC, UCS-2, UTF-32, etc.), there is a one-to-one correspondence between code
+points and code units. In variable-width encodings (such as UTF-8, UTF-16,
+etc.), code points map to code unit sequences of different lengths.</p>
+<p>The <code class="docutils literal notranslate"><span class="pre">[^]</span></code> rule matches any code point. In fixed-width encodings, it covers all
+code units and consumes exactly one of them. In variable-width encodings, it
+consumes variable number of code units and may not match some of them. The
+example above compiles without warnings with any fixed-width encoding (ASCII by
+default). However, with the UTF-8 encoding
+<code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-i8</span> <span class="pre">-Wundefined-control-flow</span> <span class="pre">any.re`</span></code> complains:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>any.re:4:2: warning: control flow is undefined for strings that match
+ '[\x80-\xC1\xF5-\xFF]'
+ '\xF0 [\x0-\x8F\xC0-\xFF]'
+ '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]'
+ '\xF4 [\x0-\x7F\x90-\xFF]'
+ '\xE0 [\x0-\x9F\xC0-\xFF]'
+ '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]'
+ '[\xC2-\xDF] [\x0-\x7F\xC0-\xFF]'
+ '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]'
+ ... and 7 more, use default rule '*' [-Wundefined-control-flow]
+</pre></div>
+</div>
+<p>It shows us the patterns that must never appear in valid UTF-8 encoded text. If
+the input is not valid UTF-8, lexer behavior is undefined. One would expect that
+with UTF-16 (another variable-width encoding), re2c would also report a warning,
+but it doesn’t. This is because by default, re2c treats Unicode surrogates as
+normal code points (for backwards compatibility reasons). If we tell re2c to
+exclude surrogates
+(<code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-ix</span> <span class="pre">--encoding-policy</span> <span class="pre">fail</span> <span class="pre">-Wundefined-control-flow`</span></code>), then we will
+get a warning:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>any.re:4:2: warning: control flow is undefined for strings that match
+ '[\xDC00-\xDFFF]'
+ '[\xD800-\xDBFF] [\x0-\xDBFF\xE000-\xFFFF]'
+, use default rule '*' [-Wundefined-control-flow]
+</pre></div>
+</div>
+<p>As you see, it can get quite subtle. A good advice is, always use default rule
+<code class="docutils literal notranslate"><span class="pre">*</span></code>: it matches any code unit regardless of encoding, consumes a single code
+unit no matter what and always has the lowest priority. Note that <code class="docutils literal notranslate"><span class="pre">*</span></code> is a
+built-in hack: it cannot be expressed through ordinary rules.</p>
+</div>
+</div>
+<div class="section" id="wunreachable-rules">
+<h3>[-Wunreachable-rules]<a class="headerlink" href="#wunreachable-rules" title="Permalink to this headline">¶</a></h3>
+<p>Sometimes the input grammar contains rules that will never match. This can
+happen for two reasons. First, some rules may be shadowed by other rules that
+match the same input, but have higher priority. Second, the rule itself may be
+infinitely greedy: it may consume as many input characters as it can get and
+never stop, and as a result never match. Both cases indicate a problem with
+the grammar, and <code class="docutils literal notranslate"><span class="pre">-Wunreachable-rules</span></code> detects and reports such rules.</p>
+<p>Let’s see an example of the first kind: shadowed rules (shadowed.re).</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6
+7
+8</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> "" { return ""; }</span>
+<span class="cm"> * { return "*"; }</span>
+<span class="cm"> "a" | "b" { return "a | b"; }</span>
+<span class="cm"> "a" { return "a"; }</span>
+<span class="cm"> [\x00-\xFF] { return "[0 - 0xFF]"; }</span>
+<span class="cm"> [^] { return "[^]"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>In this example the empty rule <code class="docutils literal notranslate"><span class="pre">""</span></code> never matches, because any single code
+unit is matched by other rules, which take precedence due to the longerst match.
+Rule <code class="docutils literal notranslate"><span class="pre">"a"</span></code> is shadowed by rule <code class="docutils literal notranslate"><span class="pre">"a"</span> <span class="pre">|</span> <span class="pre">"b"</span></code>, which also matches <code class="docutils literal notranslate"><span class="pre">a</span></code>, but
+takes precedence because it comes first. Similarly, rule <code class="docutils literal notranslate"><span class="pre">[^]</span></code> is shadowed by
+rule <code class="docutils literal notranslate"><span class="pre">[\x00-\xFF]</span></code>. Default rule <code class="docutils literal notranslate"><span class="pre">*</span></code> is also shadowed, but it’s an exception
+that is not reported (default case should always be handled). Shadowed rules
+normally do not appear in the generated code: re2c removes them during its dead
+code elimination pass.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wunreachable-rules shadowed.re -o shadowed.c
+shadowed.re:2:16: warning: unreachable rule (shadowed by rules at lines 4, 6) [-Wunreachable-rules]
+shadowed.re:5:16: warning: unreachable rule (shadowed by rule at line 4) [-Wunreachable-rules]
+shadowed.re:7:16: warning: unreachable rule (shadowed by rules at lines 4, 6) [-Wunreachable-rules]
+</pre></div>
+</div>
+<p>Now let’s see an example of second kind: infinitely greedy rule (greedy.re).</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> [^]* { return "greeedy"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>This rule will continue eating input characters until <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> fails, or until
+it reads past the end of buffer and causes memory access violation.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wunreachable-rules greedy.re -o greedy.c
+greedy.re:2:9: warning: unreachable rule [-Wunreachable-rules]
+</pre></div>
+</div>
+</div>
+<div class="section" id="wcondition-order">
+<h3>[-Wcondition-order]<a class="headerlink" href="#wcondition-order" title="Permalink to this headline">¶</a></h3>
+<p>Some older re2c programs that use <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">--conditions</span></code> option rely on a fixed
+condition order instead of using <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> directive or the
+<code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> option. This is incorrect and dangerous, as demonstrated by
+the following example <a class="reference download internal" href="../_downloads/fixorder.re.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[fixorder.re]</span></code></a>. In this example
+the lexer has two conditions: <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>. It starts in condition <code class="docutils literal notranslate"><span class="pre">a</span></code>,
+which expects a sequence of letters <code class="docutils literal notranslate"><span class="pre">a</span></code> followed by a comma. The comma causes
+transition to condition <code class="docutils literal notranslate"><span class="pre">b</span></code>, which expects a sequence of letters <code class="docutils literal notranslate"><span class="pre">b</span></code>
+followed by an exclamation mark. Anything other input is an error. Nothing
+special, except that condition numbers are hardcoded manually (the mapping of
+conditions to numbers is toggled by <code class="docutils literal notranslate"><span class="pre">REVERSED_CONDITION_ORDER</span></code> define).</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="cp">#ifdef REVERSED_CONDITION_ORDER</span>
+<span class="cp"># define yyca 1</span>
+<span class="cp"># define yycb 0</span>
+<span class="cp">#else</span>
+<span class="cp"># define yyca 0</span>
+<span class="cp"># define yycb 1</span>
+<span class="cp">#endif</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">YYCURSOR</span> <span class="o">=</span> <span class="s">"aaaa,bbb!"</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">c</span> <span class="o">=</span> <span class="n">yyca</span><span class="p">;</span>
+ <span class="k">for</span> <span class="p">(;;)</span> <span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:define:YYSETCONDITION = "c = @@;";</span>
+<span class="cm"> re2c:define:YYSETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:define:YYGETCONDITION = c;</span>
+<span class="cm"> re2c:define:YYGETCONDITION:naked = 1;</span>
+
+<span class="cm"> <*> * { printf ("error\n"); break; }</span>
+
+<span class="cm"> <a> "a" { printf ("a"); continue; }</span>
+<span class="cm"> <a> "," => b { printf (","); continue; }</span>
+
+<span class="cm"> <b> "!" { printf ("!\n"); break; }</span>
+<span class="cm"> <b> "b" { printf ("b"); continue; }</span>
+<span class="cm"> */</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Let’s compile and run it.
+Everything works fine: we get <code class="docutils literal notranslate"><span class="pre">aaaa,bbb!</span></code> in both cases.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -c -o fixorder.c -Wcondition-order fixorder.re
+$
+$ c++ -o fixorder fixorder.c && ./fixorder
+aaaa,bbb!
+$
+$ c++ -o fixorder fixorder.c -DREVERSED_CONDITION_ORDER && ./fixorder
+aaaa,bbb!
+</pre></div>
+</div>
+<p>However, if we use the <code class="docutils literal notranslate"><span class="pre">-s</span></code> re2c option, the lexer becomes sensitive to condition order:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -cs -o fixorder.c -Wcondition-order fixorder.re
+fixorder.re:31:6: warning: looks like you use hardcoded numbers instead of autogenerated condition names:
+better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order]
+$
+$ c++ -o fixorder fixorder.c && ./fixorder
+aaaa,bbb!
+$
+$ c++ -o fixorder fixorder.c -DREVERSED_CONDITION_ORDER && ./fixorder
+error
+</pre></div>
+</div>
+<p>And we get a warning from re2c. The same behavior remains if we use <code class="docutils literal notranslate"><span class="pre">-g</span></code> or
+<code class="docutils literal notranslate"><span class="pre">-b</span></code> option. Why is that? A look at the generated code explains everything.
+By default the initial dispatch on conditions is a <code class="docutils literal notranslate"><span class="pre">switch</span></code> statement:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="k">switch</span> <span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="p">{</span>
+<span class="k">case</span> <span class="nl">yyca</span><span class="p">:</span> <span class="k">goto</span> <span class="n">yyc_a</span><span class="p">;</span>
+<span class="k">case</span> <span class="nl">yycb</span><span class="p">:</span> <span class="k">goto</span> <span class="n">yyc_b</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Dispatch uses explicit condition names and works no matter what numbers are assigned to them.
+However, with the <code class="docutils literal notranslate"><span class="pre">-s</span></code> option, re2c generates an <code class="docutils literal notranslate"><span class="pre">if</span></code> statement instead of a <code class="docutils literal notranslate"><span class="pre">switch</span></code>:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">c</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">goto</span> <span class="n">yyc_a</span><span class="p">;</span>
+<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="k">goto</span> <span class="n">yyc_b</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>And with the <code class="docutils literal notranslate"><span class="pre">-g</span></code> option, it uses a jump table (computed <code class="docutils literal notranslate"><span class="pre">goto</span></code>):</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="kt">void</span> <span class="o">*</span><span class="n">yyctable</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span>
+ <span class="o">&&</span><span class="n">yyc_a</span><span class="p">,</span>
+ <span class="o">&&</span><span class="n">yyc_b</span><span class="p">,</span>
+<span class="p">};</span>
+<span class="k">goto</span> <span class="o">*</span><span class="n">yyctable</span><span class="p">[</span><span class="n">c</span><span class="p">];</span>
+</pre></div>
+</div>
+<p>The last two cases are sensitive to condition order. The fix is easy: as the
+warning suggests, use the <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> directive or the
+<code class="docutils literal notranslate"><span class="pre">-t,</span> <span class="pre">--type-header</span></code> option.</p>
+</div>
+<div class="section" id="wuseless-escape">
+<h3>[-Wuseless-escape]<a class="headerlink" href="#wuseless-escape" title="Permalink to this headline">¶</a></h3>
+<p>Sometimes people escape characters that don’t need to be escaped — either
+because they (mistakenly) think that the character is special and must be
+escaped in the given context, or because they think that this escape sequence
+means something (when it actually doesn’t), or just by pure accident. With
+<code class="docutils literal notranslate"><span class="pre">-Wuseless-escape</span></code> option re2c warns about ignored escapes. Consider this
+example (escapes.re):</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> "\a\A\"\'\[\]\-\x5d\377" {}</span>
+<span class="cm"> '\a\A\"\'\[\]\-\x5d\377' {}</span>
+<span class="cm"> [\a\A\"\'\[\]\-\x5d\377] {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Re2c reports a bunch of warnings:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wuseless-escape escapes.re -o escapes.c
+escapes.re:3:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+escapes.re:3:11: warning: escape has no effect: '\'' [-Wuseless-escape]
+escapes.re:3:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+escapes.re:3:15: warning: escape has no effect: '\]' [-Wuseless-escape]
+escapes.re:3:17: warning: escape has no effect: '\-' [-Wuseless-escape]
+escapes.re:4:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+escapes.re:4:9: warning: escape has no effect: '\"' [-Wuseless-escape]
+escapes.re:4:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+escapes.re:4:15: warning: escape has no effect: '\]' [-Wuseless-escape]
+escapes.re:4:17: warning: escape has no effect: '\-' [-Wuseless-escape]
+escapes.re:5:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+escapes.re:5:9: warning: escape has no effect: '\"' [-Wuseless-escape]
+escapes.re:5:11: warning: escape has no effect: '\'' [-Wuseless-escape]
+escapes.re:5:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+</pre></div>
+</div>
+<p>This is because the <code class="docutils literal notranslate"><span class="pre">\A</span></code> and <code class="docutils literal notranslate"><span class="pre">\[</span></code> escapes are meaningless in all rules,
+<code class="docutils literal notranslate"><span class="pre">\-</span></code> makes sense only in a character class,
+and each type of closing quotes (<code class="docutils literal notranslate"><span class="pre">"</span></code>, <code class="docutils literal notranslate"><span class="pre">'</span></code> and <code class="docutils literal notranslate"><span class="pre">]</span></code>) should only be escaped inside of a string delimited with the same quotes.
+Useless escapes are ignored: the escaped symbol is treated as not escaped (<code class="docutils literal notranslate"><span class="pre">\A</span></code> becomes <code class="docutils literal notranslate"><span class="pre">A</span></code>, etc.).
+The above example should be fixed as follows:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> "\aA\"'[]-\x5d\377" {}</span>
+<span class="cm"> '\aA"\'[]-\x5d\377' {}</span>
+<span class="cm"> [\aA"'[\]\-\x5d\377] {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>More generally, re2c recognizes escapes in the following lexemes:</p>
+<ul class="simple">
+<li>double-quoted strings <code class="docutils literal notranslate"><span class="pre">"</span> <span class="pre">...</span> <span class="pre">"</span></code></li>
+<li>single-quoted strings <code class="docutils literal notranslate"><span class="pre">'</span> <span class="pre">...</span> <span class="pre">'</span></code></li>
+<li>character classes <code class="docutils literal notranslate"><span class="pre">[</span> <span class="pre">...</span> <span class="pre">]</span></code> and <code class="docutils literal notranslate"><span class="pre">[^</span> <span class="pre">...</span> <span class="pre">]</span></code></li>
+</ul>
+<p>The following escapes are recognized:</p>
+<ul class="simple">
+<li>Closing quotes (<code class="docutils literal notranslate"><span class="pre">\"</span></code> for double-quoted strings, <code class="docutils literal notranslate"><span class="pre">\'</span></code> for single-quoted strings, and <code class="docutils literal notranslate"><span class="pre">\]</span></code> for character classes).</li>
+<li>Dash <code class="docutils literal notranslate"><span class="pre">\-</span></code> in character classes.</li>
+<li>Octal escapes: <code class="docutils literal notranslate"><span class="pre">\ooo</span></code>, where <code class="docutils literal notranslate"><span class="pre">o</span></code> is in range <code class="docutils literal notranslate"><span class="pre">[0</span> <span class="pre">-</span> <span class="pre">7]</span></code>
+(the largest octal escape is <code class="docutils literal notranslate"><span class="pre">\377</span></code>, which equals <code class="docutils literal notranslate"><span class="pre">0xFF</span></code>).</li>
+<li>Hexadecimal escapes: <code class="docutils literal notranslate"><span class="pre">\xhh</span></code>, <code class="docutils literal notranslate"><span class="pre">\Xhhhh</span></code>, <code class="docutils literal notranslate"><span class="pre">\uhhhh</span></code>, and <code class="docutils literal notranslate"><span class="pre">\Uhhhhhhhh</span></code>,
+where <code class="docutils literal notranslate"><span class="pre">h</span></code> is in range <code class="docutils literal notranslate"><span class="pre">[0</span> <span class="pre">-</span> <span class="pre">9]</span></code>, <code class="docutils literal notranslate"><span class="pre">[a</span> <span class="pre">-</span> <span class="pre">f]</span></code>, or <code class="docutils literal notranslate"><span class="pre">[A</span> <span class="pre">-</span> <span class="pre">F]</span></code>.</li>
+<li>Miscellaneous escapes: <code class="docutils literal notranslate"><span class="pre">\a</span></code>, <code class="docutils literal notranslate"><span class="pre">\b</span></code>, <code class="docutils literal notranslate"><span class="pre">\f</span></code>, <code class="docutils literal notranslate"><span class="pre">\n</span></code>, <code class="docutils literal notranslate"><span class="pre">\r</span></code>, <code class="docutils literal notranslate"><span class="pre">\t</span></code>, <code class="docutils literal notranslate"><span class="pre">\v</span></code>, <code class="docutils literal notranslate"><span class="pre">\\</span></code>.</li>
+</ul>
+<p>Ill-formed octal and hexadecimal escapes are treated as errors.
+An escape followed by a newline is also an error: multiline strings and character classes are not allowed.
+Any other ill-formed escapes are ignored.</p>
+</div>
+<div class="section" id="wswapped-range">
+<h3>[-Wswapped-range]<a class="headerlink" href="#wswapped-range" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal notranslate"><span class="pre">-Wswapped-range</span></code> warning is reported in cases when a character class contains
+a range which lower bound is greater than the upper bound. For some strange
+reason older versions of re2c did not consider this an error and silently
+swapped range bounds. Consider the following example (swapped.re):</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * { return "*"; }</span>
+<span class="cm"> [a-Z] { return "is it what you wanted?"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Re2c interprets this code as <code class="docutils literal notranslate"><span class="pre">[Z-a]</span></code>, but generates a warning:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wswapped-range swapped.re -o swapped.c
+swapped.re:3:5: warning: range lower bound (0x61) is greater than upper bound (0x5A), swapping [-Wswapped-range]
+</pre></div>
+</div>
+<p>Use <code class="docutils literal notranslate"><span class="pre">[-Werror-swapped-range]</span></code> to make it an error.</p>
+</div>
+<div class="section" id="wempty-character-class">
+<h3>[-Wempty-character-class]<a class="headerlink" href="#wempty-character-class" title="Permalink to this headline">¶</a></h3>
+<p>This warning is complementary to the
+<code class="docutils literal notranslate"><span class="pre">--empty-class</span> <span class="pre"><match-empty</span> <span class="pre">|</span> <span class="pre">match-none</span> <span class="pre">|</span> <span class="pre">error></span></code> option.
+For bakward compatibility reasons the default is <code class="docutils literal notranslate"><span class="pre">match-empty</span></code>: empty
+character class <code class="docutils literal notranslate"><span class="pre">[]</span></code> matches empty string (that is, it always matches without
+consuming any input). This behaviour doesn’t make much sense, therefore re2c
+provides a warning <code class="docutils literal notranslate"><span class="pre">-Wempty-character-class</span></code>.
+Note that empty character class can be constructed in many ways, for example as
+a result of range negation or the difference operator. The code below (empty.re)
+demonstrates some of the possibilities:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6
+7</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> [] { return 0; }</span>
+<span class="cm"> [^\x00-\xFF] { return 1; }</span>
+<span class="cm"> [^] \ [^] { return 2; }</span>
+<span class="cm"> [abc] \ ("a" | "b" | "c") { return 3; }</span>
+<span class="cm"> "a" \ [a-z] { return 4; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Re2c gives the following warnings:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wempty-character-class empty.re -o empty.c
+empty.re:2:4: warning: empty character class [-Wempty-character-class]
+empty.re:3:4: warning: empty character class [-Wempty-character-class]
+empty.re:4:4: warning: empty character class [-Wempty-character-class]
+empty.re:5:4: warning: empty character class [-Wempty-character-class]
+empty.re:6:4: warning: empty character class [-Wempty-character-class]
+</pre></div>
+</div>
+</div>
+<div class="section" id="wmatch-empty-string">
+<h3>[-Wmatch-empty-string]<a class="headerlink" href="#wmatch-empty-string" title="Permalink to this headline">¶</a></h3>
+<p><code class="docutils literal notranslate"><span class="pre">[-Wmatch-empty-string]</span></code> warns when a rule is nullable (matches an empty
+string). It was intended to prevent infinite looping in cases like the
+<a class="reference download internal" href="../_downloads/hang.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[hang.re]</span></code></a>
+example below. The program loops over its arguments (the outer <code class="docutils literal notranslate"><span class="pre">for</span></code> loop)
+and tries to lex each argument (the inner <code class="docutils literal notranslate"><span class="pre">for</span></code> loop). The lexer stops when
+all input has been consumed and it sees the terminating <code class="docutils literal notranslate"><span class="pre">NULL</span></code>. Arguments must
+consist of lowercase letters only.</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">argc</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">];;)</span> <span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> "\x00" { break; }</span>
+<span class="cm"> [a-z]* { continue; }</span>
+<span class="cm"> */</span>
+ <span class="p">}</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"argv[%d]: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>On well-formed input the program runs as expected. However, if one of the
+arguments contains a symbol diffrerent from lowercase letter, the program hangs
+forever:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wmatch-empty-string hang.re -o hang.c
+hang.re:11:19: warning: rule matches empty string [-Wmatch-empty-string]
+$ c++ -o hang hang.c
+$
+$ ./hang only lowercase letters
+argv[1]: only
+argv[2]: lowercase
+argv[3]: letters
+$
+$ ./hang right ?
+argv[1]: right
+^C
+</pre></div>
+</div>
+<p>Note that if we add default rule <code class="docutils literal notranslate"><span class="pre">*</span></code>, the lexer won’t hang anymore: it will
+match the default rule instead of the nullable rule. The fix is easy: make the
+rule non-nullable (say, <code class="docutils literal notranslate"><span class="pre">[a-z]+</span></code>) and add default rule <code class="docutils literal notranslate"><span class="pre">*</span></code>.</p>
+<p>In some cases matching an empty string makes perfect sense: for example, it
+might be used as a non-consuming default rule, or it might be used to lex an
+optional lexeme (if the corresponding rule doesn’t match, the lexer jumps to
+another block and resumes lexing at the same input position). All these cases
+are valid, so if <code class="docutils literal notranslate"><span class="pre">[-Wmatch-empty-string]</span></code> becomes annoying, it can be silenced
+with <code class="docutils literal notranslate"><span class="pre">[-Wno-match-empty-string]</span></code>.</p>
+</div>
+<div class="section" id="wsentinel-in-midrule">
+<h3>[-Wsentinel-in-midrule]<a class="headerlink" href="#wsentinel-in-midrule" title="Permalink to this headline">¶</a></h3>
+<p>When using sentinel method of checking for the end of input, it is easy to
+forget that the sentinel symbol must not be allowed in the middle of the rule.
+For example, the following code tries to match single-quoted strings. It allows
+any character except the single quote to occur in the string, including
+terminating <code class="docutils literal notranslate"><span class="pre">NULL</span></code>. As a result, the generated lexer works as expected on
+well-formed input like <code class="docutils literal notranslate"><span class="pre">'aaa'\0</span></code>, but things go wrong on ill-formed input like
+<code class="docutils literal notranslate"><span class="pre">'aaa\0</span></code> (where the closing single quote is missing). Lexer reaches the
+terminating <code class="docutils literal notranslate"><span class="pre">NULL</span></code> and assumes it is a part of the single-quoted string, so
+it continues reading bytes from memory. Eventually the lexer terminates due to
+memory access violation, or worse — it accidentally hits a single quote and
+assumes this to be the end of the string.</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+
+<span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> ['] [^']* ['] { return 0; }</span>
+<span class="cm"> * { return 1; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'good'"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'bad"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>On this code re2c reports a warning. It cannot be certain that <code class="docutils literal notranslate"><span class="pre">NULL</span></code> is the sentinel
+symbol, but this is by far the most common case.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wsentinel-in-midrule example.re -oexample.c
+example.re:9:18: warning: sentinel symbol 0 occurs in the middle of the rule
+ (note: if a different sentinel symbol is used, specify it with 're2c:sentinel' configuration) [-Wsentinel-in-midrule]
+</pre></div>
+</div>
+<p>However, re2c suggests us to define the sentinel symbol using <code class="docutils literal notranslate"><span class="pre">re2c:sentinel</span></code>
+configuration. Let’s do it.</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+
+<span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:sentinel = 0;</span>
+<span class="cm"> ['] [^']* ['] { return 0; }</span>
+<span class="cm"> * { return 1; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'good'"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'bad"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>The warning has turned into an error, as re2c is now certain that the code
+contains an error.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wsentinel-in-midrule example.re -oexample.c
+example.re:10:18: error: sentinel symbol 0 occurs in the middle of the rule [-Werror-sentinel-in-midrule]
+</pre></div>
+</div>
+<p>The code can be fixed by excluding <code class="docutils literal notranslate"><span class="pre">NULL</span></code> from the set of symbols allowed in
+the middle of the string: <code class="docutils literal notranslate"><span class="pre">[']</span> <span class="pre">[^'\x00]*</span> <span class="pre">[']</span></code>. If it is necessary to allow
+all symbols, a more powerful EOF handling method should be used.</p>
+</div>
+</div>
+<div class="section" id="more-examples">
+<h2>More examples<a class="headerlink" href="#more-examples" title="Permalink to this headline">¶</a></h2>
+<div class="toctree-wrapper compound">
+<ul>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_04.html">Parsing integers with multiple interrelated blocks</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_05.html">Parsing integers with start conditions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_09.html">Parsing /etc/passwd with tags</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_14.html">Parsing options and arguments with tags</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_13.html">Parsing records and structs with tags</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_07.html">C++98 lexer</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_10.html">Parsing URI (RFC-3986)</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_11.html">Parsing HTTP message headers (RFC-7230)</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_06.html">Parsing Braille patterns with multiple encodings</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_15.html">Finding strings in binaries with generic API</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_16.html">Faking sentinel characted with generic API</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../examples/example_17.html">Reading from std::ifstream with generic API</a></li>
+</ul>
+</div>
+<p>All examples are written in C-90 and in C++98, so they should be portable.
+Feel free to <a class="reference external" href="mailto:re2c-general%40lists.sourceforge.net">report bugs</a>.</p>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title><no title> — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <p>Here is an example of a very simple program
+<a class="reference download internal" href="../../_downloads/example.re.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.re]</span></code></a>
+that tries to match two-digit hexadecimal numbers:</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> [0-9a-fA-F]{2} {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</div>
+<p>We can see the generated DFA using <code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-D</span> <span class="pre">example.re</span> <span class="pre">|</span> <span class="pre">dot</span> <span class="pre">-Grankdir=LR</span> <span class="pre">-Tpng</span> <span class="pre">-o</span> <span class="pre">example.png`</span></code>:</p>
+<a class="reference internal image-reference" href="../../_images/example.png"><img alt="../../_images/example.png" src="../../_images/example.png" style="width: 60%;" /></a>
+<p>Given this program, <code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-S</span> <span class="pre">-o</span> <span class="pre">example.c</span> <span class="pre">example.re`</span></code> generates three files:
+<code class="docutils literal notranslate"><span class="pre">example.c</span></code> (main program), <code class="docutils literal notranslate"><span class="pre">example.c.line4.input</span></code> (input data) and <code class="docutils literal notranslate"><span class="pre">example.c.line4.keys</span></code> (expected match results).
+First, let’s look at the generated strings
+<a class="reference download internal" href="../../_downloads/example.c.line4.input" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.c.line4.input]</span></code></a>:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ hexdump -v -e '"%08_ax " 24/1 "%02x "' -e '" |" 24/1 "%_p" "|\n"' example.c.line4.input
+00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 |........................|
+00000018 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f |........ !"#$%&'()*+,-./|
+00000030 3a 3b 3c 3d 3e 3f 40 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 |:;<=>?@GHIJKLMNOPQRSTUVW|
+[ ... ]
+</pre></div>
+</div>
+<p>Byte sequences correspond to the paths in DFA.
+All strings are glued together, so it’s hard to tell where is the end of one string and the beginning of another.
+For that re2c generates keys <a class="reference download internal" href="../../_downloads/example.c.line4.keys" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.c.line4.keys]</span></code></a>:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$hexdump -v -e '"%08_ax " 36/1 "%02x " "\n"' example.c.line4.keys
+00000000 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+00000024 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+00000048 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe 01 01 fe
+[ ... ]
+</pre></div>
+</div>
+<p>A key is a triplet: string length, the length of matching prefix and the number of matching rule.
+(If tags are used, there is an additional key per each tag variable).
+Keys are packed into an array.
+In our case each key fits into 1 byte, but in case of a larger DFA they might take 2 or 4 bytes.
+The generated program <a class="reference download internal" href="../../_downloads/example.c.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[example.c]</span></code></a>
+contains two auxilary functions: <code class="docutils literal notranslate"><span class="pre">read_file</span></code> and <code class="docutils literal notranslate"><span class="pre">action_line4</span></code>.
+<code class="docutils literal notranslate"><span class="pre">read_file</span></code> is used to map <code class="docutils literal notranslate"><span class="pre">.input</span></code> and <code class="docutils literal notranslate"><span class="pre">.keys</span></code> files into memory (this function is shared between all lexers).
+<code class="docutils literal notranslate"><span class="pre">action_line4</span></code> is a replacement for actions: it compares actual lexing results with the expected results.
+This function is specific to each lexer.
+Lexing is done by <code class="docutils literal notranslate"><span class="pre">lex_line4</span></code>: this function contains the generated DFA.
+The skeleton program is self-contained, so we can compile and run it:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ cc -o example example.c
+$ ./example
+$ echo $?
+0
+</pre></div>
+</div>
+<p>When everything is fine (there are no errors) the program outputs nothing and
+exits with zero. For the sake of example, let’s pretend that re2c has an error
+that results in a missing <code class="docutils literal notranslate"><span class="pre">case</span></code> statement:</p>
+<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ re2c -S -o example.c example.re
+$ sed -i -e <span class="s2">"s/case '7'://"</span> example.c
+$ cc -o example example.c
+$ ./example
+error: lex_line4: at position <span class="m">248</span> <span class="o">(</span>iteration <span class="m">241</span><span class="o">)</span>:
+ expected: match length <span class="m">2</span>, rule <span class="m">0</span>
+ actual: match length <span class="m">1</span>, rule <span class="m">254</span>
+</pre></div>
+</div>
+<p>Viola! Now the lexer complains about discrepancy between expected and actual
+match results.</p>
+<p>One special case of failure detected by skeleton programs is undefined control
+flow in the lexer. Use <code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code> warning to catch all such
+cases in in your code (more details <a class="reference external" href="/manual/manual.html#wundefined-control-flow">here</a>).</p>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>A basic example — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="a-basic-example">
+<h1>A basic example<a class="headerlink" href="#a-basic-example" title="Permalink to this headline">¶</a></h1>
+<p>Here is an example program <a class="reference download internal" href="../../_downloads/syntax.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[syntax.re]</span></code></a>
+that shows various aspects of re2c syntax:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="cm">/*!re2c re2c:flags:i = 1; */</span> <span class="c1">// re2c block with configuration that turns off #line directives</span>
+ <span class="c1">//</span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h> // C/C++ code</span><span class="cp"></span>
+ <span class="c1">//</span>
+<span class="cm">/*!max:re2c*/</span> <span class="c1">// directive that defines YYMAXFILL (unused)</span>
+<span class="cm">/*!re2c // start of re2c block</span>
+<span class="cm"> digit = [0-9]; // named definition of 'digit'</span>
+<span class="cm"> number = digit+; // named definition of 'number'</span>
+<span class="cm">*/</span> <span class="c1">// end of re2c block</span>
+ <span class="c1">//</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span> <span class="c1">// YYCURSOR is defined as a function parameter</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span> <span class="c1">// YYMARKER is defined as a local variable</span>
+ <span class="cm">/*!re2c // start of re2c block</span>
+<span class="cm"> re2c:define:YYCTYPE = char; // configuration that defines YYCTYPE</span>
+<span class="cm"> re2c:yyfill:enable = 0; // configuration that turns off YYFILL</span>
+<span class="cm"> //</span>
+<span class="cm"> * { return 1; } // default rule with its semantic action</span>
+<span class="cm"> //</span>
+<span class="cm"> number { // a normal rule with its semantic action</span>
+<span class="cm"> printf("number\n"); // ... semantic action (continued)</span>
+<span class="cm"> return 0; // ... semantic action (continued)</span>
+<span class="cm"> } // end of semantic action</span>
+<span class="cm"> //</span>
+<span class="cm"> */</span> <span class="c1">// end of re2c block</span>
+<span class="p">}</span> <span class="c1">//</span>
+ <span class="c1">//</span>
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="c1">//</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">"1024"</span><span class="p">);</span> <span class="c1">// C/C++ code</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">";]"</span><span class="p">);</span> <span class="c1">//</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">//</span>
+<span class="p">}</span> <span class="c1">//</span>
+</pre></div>
+</div>
+<p>Run re2c as <code class="docutils literal notranslate"><span class="pre">re2c</span> <span class="pre">-W</span> <span class="pre">syntax.re</span> <span class="pre">-o</span> <span class="pre">syntax.c</span></code> (option <code class="docutils literal notranslate"><span class="pre">-W</span></code> enables warnings).
+The generated code <a class="reference download internal" href="../../_downloads/syntax.c.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[syntax.c]</span></code></a>
+looks like this:</p>
+<div class="highlight-c notranslate"><div class="highlight"><pre><span></span> <span class="c1">// re2c block with configuration that turns off #line directives</span>
+ <span class="c1">//</span>
+<span class="cp">#include</span> <span class="cpf"><stdio.h> // C/C++ code</span><span class="cp"></span>
+ <span class="c1">//</span>
+<span class="cp">#define YYMAXFILL 1 </span><span class="c1">// directive that defines YYMAXFILL (unused)</span>
+ <span class="c1">// end of re2c block</span>
+ <span class="c1">//</span>
+<span class="k">static</span> <span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span> <span class="c1">// YYCURSOR is defined as a function parameter</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYMARKER</span><span class="p">;</span> <span class="c1">// YYMARKER is defined as a local variable</span>
+
+<span class="p">{</span>
+ <span class="kt">char</span> <span class="n">yych</span><span class="p">;</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'0'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'1'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'2'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'3'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'4'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'5'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'6'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'7'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'8'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'9'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy4</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy2</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy2</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="mi">1</span><span class="p">;</span> <span class="p">}</span>
+<span class="nl">yy4</span><span class="p">:</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'0'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'1'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'2'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'3'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'4'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'5'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'6'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'7'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'8'</span><span class="o">:</span>
+ <span class="k">case</span> <span class="sc">'9'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy4</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy6</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy6</span><span class="p">:</span>
+ <span class="p">{</span> <span class="c1">// a normal rule with its semantic action</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"number</span><span class="se">\n</span><span class="s">"</span><span class="p">);</span> <span class="c1">// ... semantic action (continued)</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">// ... semantic action (continued)</span>
+ <span class="p">}</span>
+<span class="p">}</span>
+ <span class="c1">// end of re2c block</span>
+<span class="p">}</span> <span class="c1">//</span>
+ <span class="c1">//</span>
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="c1">//</span>
+<span class="p">{</span> <span class="c1">//</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">"1024"</span><span class="p">);</span> <span class="c1">// C/C++ code</span>
+ <span class="n">lex</span><span class="p">(</span><span class="s">";]"</span><span class="p">);</span> <span class="c1">//</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span> <span class="c1">//</span>
+<span class="p">}</span> <span class="c1">//</span>
+</pre></div>
+</div>
+<p>The lines without comments correspond to the code generated by re2c. Not all
+comments are present in the output — only those which are in C/C++ code, and
+not inside of re2c blocks.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wcondition-order] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wcondition-order">
+<h1>[-Wcondition-order]<a class="headerlink" href="#wcondition-order" title="Permalink to this headline">¶</a></h1>
+<p>Some older re2c programs that use <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">--conditions</span></code> option rely on a fixed
+condition order instead of using <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> directive or the
+<code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> option. This is incorrect and dangerous, as demonstrated by
+the following example <a class="reference download internal" href="../../../_downloads/fixorder.re.txt" download=""><code class="xref download docutils literal notranslate"><span class="pre">[fixorder.re]</span></code></a>. In this example
+the lexer has two conditions: <code class="docutils literal notranslate"><span class="pre">a</span></code> and <code class="docutils literal notranslate"><span class="pre">b</span></code>. It starts in condition <code class="docutils literal notranslate"><span class="pre">a</span></code>,
+which expects a sequence of letters <code class="docutils literal notranslate"><span class="pre">a</span></code> followed by a comma. The comma causes
+transition to condition <code class="docutils literal notranslate"><span class="pre">b</span></code>, which expects a sequence of letters <code class="docutils literal notranslate"><span class="pre">b</span></code>
+followed by an exclamation mark. Anything other input is an error. Nothing
+special, except that condition numbers are hardcoded manually (the mapping of
+conditions to numbers is toggled by <code class="docutils literal notranslate"><span class="pre">REVERSED_CONDITION_ORDER</span></code> define).</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="cp">#ifdef REVERSED_CONDITION_ORDER</span>
+<span class="cp"># define yyca 1</span>
+<span class="cp"># define yycb 0</span>
+<span class="cp">#else</span>
+<span class="cp"># define yyca 0</span>
+<span class="cp"># define yycb 1</span>
+<span class="cp">#endif</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="k">const</span> <span class="kt">char</span> <span class="o">*</span> <span class="n">YYCURSOR</span> <span class="o">=</span> <span class="s">"aaaa,bbb!"</span><span class="p">;</span>
+ <span class="kt">int</span> <span class="n">c</span> <span class="o">=</span> <span class="n">yyca</span><span class="p">;</span>
+ <span class="k">for</span> <span class="p">(;;)</span> <span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:define:YYSETCONDITION = "c = @@;";</span>
+<span class="cm"> re2c:define:YYSETCONDITION:naked = 1;</span>
+<span class="cm"> re2c:define:YYGETCONDITION = c;</span>
+<span class="cm"> re2c:define:YYGETCONDITION:naked = 1;</span>
+
+<span class="cm"> <*> * { printf ("error\n"); break; }</span>
+
+<span class="cm"> <a> "a" { printf ("a"); continue; }</span>
+<span class="cm"> <a> "," => b { printf (","); continue; }</span>
+
+<span class="cm"> <b> "!" { printf ("!\n"); break; }</span>
+<span class="cm"> <b> "b" { printf ("b"); continue; }</span>
+<span class="cm"> */</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Let’s compile and run it.
+Everything works fine: we get <code class="docutils literal notranslate"><span class="pre">aaaa,bbb!</span></code> in both cases.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -c -o fixorder.c -Wcondition-order fixorder.re
+$
+$ c++ -o fixorder fixorder.c && ./fixorder
+aaaa,bbb!
+$
+$ c++ -o fixorder fixorder.c -DREVERSED_CONDITION_ORDER && ./fixorder
+aaaa,bbb!
+</pre></div>
+</div>
+<p>However, if we use the <code class="docutils literal notranslate"><span class="pre">-s</span></code> re2c option, the lexer becomes sensitive to condition order:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -cs -o fixorder.c -Wcondition-order fixorder.re
+fixorder.re:31:6: warning: looks like you use hardcoded numbers instead of autogenerated condition names:
+better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order]
+$
+$ c++ -o fixorder fixorder.c && ./fixorder
+aaaa,bbb!
+$
+$ c++ -o fixorder fixorder.c -DREVERSED_CONDITION_ORDER && ./fixorder
+error
+</pre></div>
+</div>
+<p>And we get a warning from re2c. The same behavior remains if we use <code class="docutils literal notranslate"><span class="pre">-g</span></code> or
+<code class="docutils literal notranslate"><span class="pre">-b</span></code> option. Why is that? A look at the generated code explains everything.
+By default the initial dispatch on conditions is a <code class="docutils literal notranslate"><span class="pre">switch</span></code> statement:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="k">switch</span> <span class="p">(</span><span class="n">c</span><span class="p">)</span> <span class="p">{</span>
+<span class="k">case</span> <span class="nl">yyca</span><span class="p">:</span> <span class="k">goto</span> <span class="n">yyc_a</span><span class="p">;</span>
+<span class="k">case</span> <span class="nl">yycb</span><span class="p">:</span> <span class="k">goto</span> <span class="n">yyc_b</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>Dispatch uses explicit condition names and works no matter what numbers are assigned to them.
+However, with the <code class="docutils literal notranslate"><span class="pre">-s</span></code> option, re2c generates an <code class="docutils literal notranslate"><span class="pre">if</span></code> statement instead of a <code class="docutils literal notranslate"><span class="pre">switch</span></code>:</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">c</span> <span class="o"><</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">goto</span> <span class="n">yyc_a</span><span class="p">;</span>
+<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+ <span class="k">goto</span> <span class="n">yyc_b</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</div>
+<p>And with the <code class="docutils literal notranslate"><span class="pre">-g</span></code> option, it uses a jump table (computed <code class="docutils literal notranslate"><span class="pre">goto</span></code>):</p>
+<div class="highlight-cpp notranslate"><div class="highlight"><pre><span></span><span class="k">static</span> <span class="kt">void</span> <span class="o">*</span><span class="n">yyctable</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="p">{</span>
+ <span class="o">&&</span><span class="n">yyc_a</span><span class="p">,</span>
+ <span class="o">&&</span><span class="n">yyc_b</span><span class="p">,</span>
+<span class="p">};</span>
+<span class="k">goto</span> <span class="o">*</span><span class="n">yyctable</span><span class="p">[</span><span class="n">c</span><span class="p">];</span>
+</pre></div>
+</div>
+<p>The last two cases are sensitive to condition order. The fix is easy: as the
+warning suggests, use the <code class="docutils literal notranslate"><span class="pre">/*!types:re2c*/</span></code> directive or the
+<code class="docutils literal notranslate"><span class="pre">-t,</span> <span class="pre">--type-header</span></code> option.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wempty-character-class] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wempty-character-class">
+<h1>[-Wempty-character-class]<a class="headerlink" href="#wempty-character-class" title="Permalink to this headline">¶</a></h1>
+<p>This warning is complementary to the
+<code class="docutils literal notranslate"><span class="pre">--empty-class</span> <span class="pre"><match-empty</span> <span class="pre">|</span> <span class="pre">match-none</span> <span class="pre">|</span> <span class="pre">error></span></code> option.
+For bakward compatibility reasons the default is <code class="docutils literal notranslate"><span class="pre">match-empty</span></code>: empty
+character class <code class="docutils literal notranslate"><span class="pre">[]</span></code> matches empty string (that is, it always matches without
+consuming any input). This behaviour doesn’t make much sense, therefore re2c
+provides a warning <code class="docutils literal notranslate"><span class="pre">-Wempty-character-class</span></code>.
+Note that empty character class can be constructed in many ways, for example as
+a result of range negation or the difference operator. The code below (empty.re)
+demonstrates some of the possibilities:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6
+7</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> [] { return 0; }</span>
+<span class="cm"> [^\x00-\xFF] { return 1; }</span>
+<span class="cm"> [^] \ [^] { return 2; }</span>
+<span class="cm"> [abc] \ ("a" | "b" | "c") { return 3; }</span>
+<span class="cm"> "a" \ [a-z] { return 4; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Re2c gives the following warnings:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wempty-character-class empty.re -o empty.c
+empty.re:2:4: warning: empty character class [-Wempty-character-class]
+empty.re:3:4: warning: empty character class [-Wempty-character-class]
+empty.re:4:4: warning: empty character class [-Wempty-character-class]
+empty.re:5:4: warning: empty character class [-Wempty-character-class]
+empty.re:6:4: warning: empty character class [-Wempty-character-class]
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wmatch-empty-string] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wmatch-empty-string">
+<h1>[-Wmatch-empty-string]<a class="headerlink" href="#wmatch-empty-string" title="Permalink to this headline">¶</a></h1>
+<p><code class="docutils literal notranslate"><span class="pre">[-Wmatch-empty-string]</span></code> warns when a rule is nullable (matches an empty
+string). It was intended to prevent infinite looping in cases like the
+<a class="reference download internal" href="../../../_downloads/hang.re" download=""><code class="xref download docutils literal notranslate"><span class="pre">[hang.re]</span></code></a>
+example below. The program loops over its arguments (the outer <code class="docutils literal notranslate"><span class="pre">for</span></code> loop)
+and tries to lex each argument (the inner <code class="docutils literal notranslate"><span class="pre">for</span></code> loop). The lexer stops when
+all input has been consumed and it sees the terminating <code class="docutils literal notranslate"><span class="pre">NULL</span></code>. Arguments must
+consist of lowercase letters only.</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><stdio.h></span><span class="cp"></span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">**</span><span class="n">argv</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="n">i</span> <span class="o"><</span> <span class="n">argc</span><span class="p">;</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">for</span> <span class="p">(</span><span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span> <span class="o">=</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">];;)</span> <span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> "\x00" { break; }</span>
+<span class="cm"> [a-z]* { continue; }</span>
+<span class="cm"> */</span>
+ <span class="p">}</span>
+ <span class="n">printf</span><span class="p">(</span><span class="s">"argv[%d]: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">argv</span><span class="p">[</span><span class="n">i</span><span class="p">]);</span>
+ <span class="p">}</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>On well-formed input the program runs as expected. However, if one of the
+arguments contains a symbol diffrerent from lowercase letter, the program hangs
+forever:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wmatch-empty-string hang.re -o hang.c
+hang.re:11:19: warning: rule matches empty string [-Wmatch-empty-string]
+$ c++ -o hang hang.c
+$
+$ ./hang only lowercase letters
+argv[1]: only
+argv[2]: lowercase
+argv[3]: letters
+$
+$ ./hang right ?
+argv[1]: right
+^C
+</pre></div>
+</div>
+<p>Note that if we add default rule <code class="docutils literal notranslate"><span class="pre">*</span></code>, the lexer won’t hang anymore: it will
+match the default rule instead of the nullable rule. The fix is easy: make the
+rule non-nullable (say, <code class="docutils literal notranslate"><span class="pre">[a-z]+</span></code>) and add default rule <code class="docutils literal notranslate"><span class="pre">*</span></code>.</p>
+<p>In some cases matching an empty string makes perfect sense: for example, it
+might be used as a non-consuming default rule, or it might be used to lex an
+optional lexeme (if the corresponding rule doesn’t match, the lexer jumps to
+another block and resumes lexing at the same input position). All these cases
+are valid, so if <code class="docutils literal notranslate"><span class="pre">[-Wmatch-empty-string]</span></code> becomes annoying, it can be silenced
+with <code class="docutils literal notranslate"><span class="pre">[-Wno-match-empty-string]</span></code>.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wsentinel-in-midrule] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wsentinel-in-midrule">
+<h1>[-Wsentinel-in-midrule]<a class="headerlink" href="#wsentinel-in-midrule" title="Permalink to this headline">¶</a></h1>
+<p>When using sentinel method of checking for the end of input, it is easy to
+forget that the sentinel symbol must not be allowed in the middle of the rule.
+For example, the following code tries to match single-quoted strings. It allows
+any character except the single quote to occur in the string, including
+terminating <code class="docutils literal notranslate"><span class="pre">NULL</span></code>. As a result, the generated lexer works as expected on
+well-formed input like <code class="docutils literal notranslate"><span class="pre">'aaa'\0</span></code>, but things go wrong on ill-formed input like
+<code class="docutils literal notranslate"><span class="pre">'aaa\0</span></code> (where the closing single quote is missing). Lexer reaches the
+terminating <code class="docutils literal notranslate"><span class="pre">NULL</span></code> and assumes it is a part of the single-quoted string, so
+it continues reading bytes from memory. Eventually the lexer terminates due to
+memory access violation, or worse — it accidentally hits a single quote and
+assumes this to be the end of the string.</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+
+<span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> ['] [^']* ['] { return 0; }</span>
+<span class="cm"> * { return 1; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'good'"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'bad"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>On this code re2c reports a warning. It cannot be certain that <code class="docutils literal notranslate"><span class="pre">NULL</span></code> is the sentinel
+symbol, but this is by far the most common case.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wsentinel-in-midrule example.re -oexample.c
+example.re:9:18: warning: sentinel symbol 0 occurs in the middle of the rule
+ (note: if a different sentinel symbol is used, specify it with 're2c:sentinel' configuration) [-Wsentinel-in-midrule]
+</pre></div>
+</div>
+<p>However, re2c suggests us to define the sentinel symbol using <code class="docutils literal notranslate"><span class="pre">re2c:sentinel</span></code>
+configuration. Let’s do it.</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#include</span> <span class="cpf"><assert.h></span><span class="cp"></span>
+
+<span class="kt">int</span> <span class="nf">lex</span><span class="p">(</span><span class="k">const</span> <span class="kt">char</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">)</span>
+<span class="p">{</span>
+ <span class="cm">/*!re2c</span>
+<span class="cm"> re2c:define:YYCTYPE = char;</span>
+<span class="cm"> re2c:yyfill:enable = 0;</span>
+<span class="cm"> re2c:sentinel = 0;</span>
+<span class="cm"> ['] [^']* ['] { return 0; }</span>
+<span class="cm"> * { return 1; }</span>
+<span class="cm"> */</span>
+<span class="p">}</span>
+
+<span class="kt">int</span> <span class="nf">main</span><span class="p">()</span>
+<span class="p">{</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'good'"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">);</span>
+ <span class="n">assert</span><span class="p">(</span><span class="n">lex</span><span class="p">(</span><span class="s">"'bad"</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">);</span>
+ <span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>The warning has turned into an error, as re2c is now certain that the code
+contains an error.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wsentinel-in-midrule example.re -oexample.c
+example.re:10:18: error: sentinel symbol 0 occurs in the middle of the rule [-Werror-sentinel-in-midrule]
+</pre></div>
+</div>
+<p>The code can be fixed by excluding <code class="docutils literal notranslate"><span class="pre">NULL</span></code> from the set of symbols allowed in
+the middle of the string: <code class="docutils literal notranslate"><span class="pre">[']</span> <span class="pre">[^'\x00]*</span> <span class="pre">[']</span></code>. If it is necessary to allow
+all symbols, a more powerful EOF handling method should be used.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 26, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wswapped-range] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wswapped-range">
+<h1>[-Wswapped-range]<a class="headerlink" href="#wswapped-range" title="Permalink to this headline">¶</a></h1>
+<p><code class="docutils literal notranslate"><span class="pre">-Wswapped-range</span></code> warning is reported in cases when a character class contains
+a range which lower bound is greater than the upper bound. For some strange
+reason older versions of re2c did not consider this an error and silently
+swapped range bounds. Consider the following example (swapped.re):</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * { return "*"; }</span>
+<span class="cm"> [a-Z] { return "is it what you wanted?"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Re2c interprets this code as <code class="docutils literal notranslate"><span class="pre">[Z-a]</span></code>, but generates a warning:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wswapped-range swapped.re -o swapped.c
+swapped.re:3:5: warning: range lower bound (0x61) is greater than upper bound (0x5A), swapping [-Wswapped-range]
+</pre></div>
+</div>
+<p>Use <code class="docutils literal notranslate"><span class="pre">[-Werror-swapped-range]</span></code> to make it an error.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wundefined-control-flow] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+ <h3>[-Wundefined-control-flow]</h3>
+ <div class="re2c-toc-local">
+ <ul>
+<li><a class="reference internal" href="#">[-Wundefined-control-flow]</a><ul>
+<li><a class="reference internal" href="#the-old-default-rule">The old default rule</a></li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wundefined-control-flow">
+<h1>[-Wundefined-control-flow]<a class="headerlink" href="#wundefined-control-flow" title="Permalink to this headline">¶</a></h1>
+<div class="toctree-wrapper compound">
+</div>
+<p>With <code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code> warning re2c checks that every path in the
+generated DFA contains at least one accepting state. When the input matches
+such a path, lexer will eventually stop and execute the corresponding semantic
+action. However, if some path has no accepting state, then lexer behavior is
+undefined: it may loop forever, or read past the end of buffer, or jump to some
+other semantic action by accident. For example, consider this simple piece of
+code (a.re) that is supposed to match letter <code class="docutils literal notranslate"><span class="pre">a</span></code>:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> "a" { return 'a'; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>The generated code looks like this:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">{</span>
+ <span class="n">YYCTYPE</span> <span class="n">yych</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">YYLIMIT</span> <span class="o"><=</span> <span class="n">YYCURSOR</span><span class="p">)</span> <span class="n">YYFILL</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'a'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy3</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy2</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy2</span><span class="p">:</span>
+<span class="nl">yy3</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="sc">'a'</span><span class="p">;</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Clearly this is not what we want: this code matches any letter, not just <code class="docutils literal notranslate"><span class="pre">a</span></code>!
+This happens because we did not specify any handler for the remaining input symbols.
+If we run re2c with <code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code>, we will see that it complains about undefined control flow and recommends using default rule <code class="docutils literal notranslate"><span class="pre">*</span></code>:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>a.re:3:2: warning: control flow is undefined for strings that match '[\x0-\x60\x62-\xFF]', use the default '*' rule [-Wundefined-control-flow]
+</pre></div>
+</div>
+<p>Let’s follow the advice and change the code:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * { return '*'; }</span>
+<span class="cm"> "a" { return 'a'; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Now the generated code looks much better:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+10
+11
+12
+13
+14
+15</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="p">{</span>
+ <span class="n">YYCTYPE</span> <span class="n">yych</span><span class="p">;</span>
+ <span class="k">if</span> <span class="p">(</span><span class="n">YYLIMIT</span> <span class="o"><=</span> <span class="n">YYCURSOR</span><span class="p">)</span> <span class="n">YYFILL</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span>
+ <span class="n">yych</span> <span class="o">=</span> <span class="o">*</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="k">switch</span> <span class="p">(</span><span class="n">yych</span><span class="p">)</span> <span class="p">{</span>
+ <span class="k">case</span> <span class="sc">'a'</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy4</span><span class="p">;</span>
+ <span class="k">default</span><span class="o">:</span> <span class="k">goto</span> <span class="n">yy2</span><span class="p">;</span>
+ <span class="p">}</span>
+<span class="nl">yy2</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="sc">'*'</span><span class="p">;</span> <span class="p">}</span>
+<span class="nl">yy4</span><span class="p">:</span>
+ <span class="o">++</span><span class="n">YYCURSOR</span><span class="p">;</span>
+ <span class="p">{</span> <span class="k">return</span> <span class="sc">'a'</span><span class="p">;</span> <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+</td></tr></table></div>
+<p>Note that the default rule brings no overhead: it simply binds code to the
+default label. It should always be used, unless you are absolutely sure that
+your grammar covers all possible cases.</p>
+<div class="section" id="the-old-default-rule">
+<h2>The old default rule<a class="headerlink" href="#the-old-default-rule" title="Permalink to this headline">¶</a></h2>
+<p>When the world was young and re2c didn’t have the default <code class="docutils literal notranslate"><span class="pre">*</span></code> rule (that is,
+before re2c-0.13.7) everyone used <code class="docutils literal notranslate"><span class="pre">[^]</span></code> as the default rule, as in this
+example (any.re):</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> // ... normal rules ...</span>
+<span class="cm"> [^] { return "any"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p><code class="docutils literal notranslate"><span class="pre">[^]</span></code> is just an ordinary rule: it matches any character and has normal
+priority (so it should be the last rule). If other rules didn’t match, <code class="docutils literal notranslate"><span class="pre">[^]</span></code>
+will match and consume one character.</p>
+<p>But exactly what is a <em>character</em>? First, an abstract number that is assigned
+some sacred meaning within the current encoding — a <em>code point</em>. Second, a
+minimal piece of information (say, combination of bits) that can represent a
+unit of encoded text — a <em>code unit</em>. Rules are defined in terms of code points.
+Input is measured in code units. In fixed-width encodings (such as ASCII,
+EBCDIC, UCS-2, UTF-32, etc.), there is a one-to-one correspondence between code
+points and code units. In variable-width encodings (such as UTF-8, UTF-16,
+etc.), code points map to code unit sequences of different lengths.</p>
+<p>The <code class="docutils literal notranslate"><span class="pre">[^]</span></code> rule matches any code point. In fixed-width encodings, it covers all
+code units and consumes exactly one of them. In variable-width encodings, it
+consumes variable number of code units and may not match some of them. The
+example above compiles without warnings with any fixed-width encoding (ASCII by
+default). However, with the UTF-8 encoding
+<code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-i8</span> <span class="pre">-Wundefined-control-flow</span> <span class="pre">any.re`</span></code> complains:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>any.re:4:2: warning: control flow is undefined for strings that match
+ '[\x80-\xC1\xF5-\xFF]'
+ '\xF0 [\x0-\x8F\xC0-\xFF]'
+ '[\xE1-\xEF] [\x0-\x7F\xC0-\xFF]'
+ '\xF4 [\x0-\x7F\x90-\xFF]'
+ '\xE0 [\x0-\x9F\xC0-\xFF]'
+ '[\xF1-\xF3] [\x0-\x7F\xC0-\xFF]'
+ '[\xC2-\xDF] [\x0-\x7F\xC0-\xFF]'
+ '\xE0 [\xA0-\xBF] [\x0-\x7F\xC0-\xFF]'
+ ... and 7 more, use default rule '*' [-Wundefined-control-flow]
+</pre></div>
+</div>
+<p>It shows us the patterns that must never appear in valid UTF-8 encoded text. If
+the input is not valid UTF-8, lexer behavior is undefined. One would expect that
+with UTF-16 (another variable-width encoding), re2c would also report a warning,
+but it doesn’t. This is because by default, re2c treats Unicode surrogates as
+normal code points (for backwards compatibility reasons). If we tell re2c to
+exclude surrogates
+(<code class="docutils literal notranslate"><span class="pre">`re2c</span> <span class="pre">-ix</span> <span class="pre">--encoding-policy</span> <span class="pre">fail</span> <span class="pre">-Wundefined-control-flow`</span></code>), then we will
+get a warning:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>any.re:4:2: warning: control flow is undefined for strings that match
+ '[\xDC00-\xDFFF]'
+ '[\xD800-\xDBFF] [\x0-\xDBFF\xE000-\xFFFF]'
+, use default rule '*' [-Wundefined-control-flow]
+</pre></div>
+</div>
+<p>As you see, it can get quite subtle. A good advice is, always use default rule
+<code class="docutils literal notranslate"><span class="pre">*</span></code>: it matches any code unit regardless of encoding, consumes a single code
+unit no matter what and always has the lowest priority. Note that <code class="docutils literal notranslate"><span class="pre">*</span></code> is a
+built-in hack: it cannot be expressed through ordinary rules.</p>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wunreachable-rules] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wunreachable-rules">
+<h1>[-Wunreachable-rules]<a class="headerlink" href="#wunreachable-rules" title="Permalink to this headline">¶</a></h1>
+<p>Sometimes the input grammar contains rules that will never match. This can
+happen for two reasons. First, some rules may be shadowed by other rules that
+match the same input, but have higher priority. Second, the rule itself may be
+infinitely greedy: it may consume as many input characters as it can get and
+never stop, and as a result never match. Both cases indicate a problem with
+the grammar, and <code class="docutils literal notranslate"><span class="pre">-Wunreachable-rules</span></code> detects and reports such rules.</p>
+<p>Let’s see an example of the first kind: shadowed rules (shadowed.re).</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6
+7
+8</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> "" { return ""; }</span>
+<span class="cm"> * { return "*"; }</span>
+<span class="cm"> "a" | "b" { return "a | b"; }</span>
+<span class="cm"> "a" { return "a"; }</span>
+<span class="cm"> [\x00-\xFF] { return "[0 - 0xFF]"; }</span>
+<span class="cm"> [^] { return "[^]"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>In this example the empty rule <code class="docutils literal notranslate"><span class="pre">""</span></code> never matches, because any single code
+unit is matched by other rules, which take precedence due to the longerst match.
+Rule <code class="docutils literal notranslate"><span class="pre">"a"</span></code> is shadowed by rule <code class="docutils literal notranslate"><span class="pre">"a"</span> <span class="pre">|</span> <span class="pre">"b"</span></code>, which also matches <code class="docutils literal notranslate"><span class="pre">a</span></code>, but
+takes precedence because it comes first. Similarly, rule <code class="docutils literal notranslate"><span class="pre">[^]</span></code> is shadowed by
+rule <code class="docutils literal notranslate"><span class="pre">[\x00-\xFF]</span></code>. Default rule <code class="docutils literal notranslate"><span class="pre">*</span></code> is also shadowed, but it’s an exception
+that is not reported (default case should always be handled). Shadowed rules
+normally do not appear in the generated code: re2c removes them during its dead
+code elimination pass.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wunreachable-rules shadowed.re -o shadowed.c
+shadowed.re:2:16: warning: unreachable rule (shadowed by rules at lines 4, 6) [-Wunreachable-rules]
+shadowed.re:5:16: warning: unreachable rule (shadowed by rule at line 4) [-Wunreachable-rules]
+shadowed.re:7:16: warning: unreachable rule (shadowed by rules at lines 4, 6) [-Wunreachable-rules]
+</pre></div>
+</div>
+<p>Now let’s see an example of second kind: infinitely greedy rule (greedy.re).</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> [^]* { return "greeedy"; }</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>This rule will continue eating input characters until <code class="docutils literal notranslate"><span class="pre">YYFILL</span></code> fails, or until
+it reads past the end of buffer and causes memory access violation.</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wunreachable-rules greedy.re -o greedy.c
+greedy.re:2:9: warning: unreachable rule [-Wunreachable-rules]
+</pre></div>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>[-Wuseless-escape] — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../../releases/changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="wuseless-escape">
+<h1>[-Wuseless-escape]<a class="headerlink" href="#wuseless-escape" title="Permalink to this headline">¶</a></h1>
+<p>Sometimes people escape characters that don’t need to be escaped — either
+because they (mistakenly) think that the character is special and must be
+escaped in the given context, or because they think that this escape sequence
+means something (when it actually doesn’t), or just by pure accident. With
+<code class="docutils literal notranslate"><span class="pre">-Wuseless-escape</span></code> option re2c warns about ignored escapes. Consider this
+example (escapes.re):</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> "\a\A\"\'\[\]\-\x5d\377" {}</span>
+<span class="cm"> '\a\A\"\'\[\]\-\x5d\377' {}</span>
+<span class="cm"> [\a\A\"\'\[\]\-\x5d\377] {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>Re2c reports a bunch of warnings:</p>
+<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ re2c -Wuseless-escape escapes.re -o escapes.c
+escapes.re:3:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+escapes.re:3:11: warning: escape has no effect: '\'' [-Wuseless-escape]
+escapes.re:3:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+escapes.re:3:15: warning: escape has no effect: '\]' [-Wuseless-escape]
+escapes.re:3:17: warning: escape has no effect: '\-' [-Wuseless-escape]
+escapes.re:4:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+escapes.re:4:9: warning: escape has no effect: '\"' [-Wuseless-escape]
+escapes.re:4:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+escapes.re:4:15: warning: escape has no effect: '\]' [-Wuseless-escape]
+escapes.re:4:17: warning: escape has no effect: '\-' [-Wuseless-escape]
+escapes.re:5:7: warning: escape has no effect: '\A' [-Wuseless-escape]
+escapes.re:5:9: warning: escape has no effect: '\"' [-Wuseless-escape]
+escapes.re:5:11: warning: escape has no effect: '\'' [-Wuseless-escape]
+escapes.re:5:13: warning: escape has no effect: '\[' [-Wuseless-escape]
+</pre></div>
+</div>
+<p>This is because the <code class="docutils literal notranslate"><span class="pre">\A</span></code> and <code class="docutils literal notranslate"><span class="pre">\[</span></code> escapes are meaningless in all rules,
+<code class="docutils literal notranslate"><span class="pre">\-</span></code> makes sense only in a character class,
+and each type of closing quotes (<code class="docutils literal notranslate"><span class="pre">"</span></code>, <code class="docutils literal notranslate"><span class="pre">'</span></code> and <code class="docutils literal notranslate"><span class="pre">]</span></code>) should only be escaped inside of a string delimited with the same quotes.
+Useless escapes are ignored: the escaped symbol is treated as not escaped (<code class="docutils literal notranslate"><span class="pre">\A</span></code> becomes <code class="docutils literal notranslate"><span class="pre">A</span></code>, etc.).
+The above example should be fixed as follows:</p>
+<div class="highlight-cpp notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
+2
+3
+4
+5
+6</pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/*!re2c</span>
+<span class="cm"> * {}</span>
+<span class="cm"> "\aA\"'[]-\x5d\377" {}</span>
+<span class="cm"> '\aA"\'[]-\x5d\377' {}</span>
+<span class="cm"> [\aA"'[\]\-\x5d\377] {}</span>
+<span class="cm">*/</span>
+</pre></div>
+</td></tr></table></div>
+<p>More generally, re2c recognizes escapes in the following lexemes:</p>
+<ul class="simple">
+<li>double-quoted strings <code class="docutils literal notranslate"><span class="pre">"</span> <span class="pre">...</span> <span class="pre">"</span></code></li>
+<li>single-quoted strings <code class="docutils literal notranslate"><span class="pre">'</span> <span class="pre">...</span> <span class="pre">'</span></code></li>
+<li>character classes <code class="docutils literal notranslate"><span class="pre">[</span> <span class="pre">...</span> <span class="pre">]</span></code> and <code class="docutils literal notranslate"><span class="pre">[^</span> <span class="pre">...</span> <span class="pre">]</span></code></li>
+</ul>
+<p>The following escapes are recognized:</p>
+<ul class="simple">
+<li>Closing quotes (<code class="docutils literal notranslate"><span class="pre">\"</span></code> for double-quoted strings, <code class="docutils literal notranslate"><span class="pre">\'</span></code> for single-quoted strings, and <code class="docutils literal notranslate"><span class="pre">\]</span></code> for character classes).</li>
+<li>Dash <code class="docutils literal notranslate"><span class="pre">\-</span></code> in character classes.</li>
+<li>Octal escapes: <code class="docutils literal notranslate"><span class="pre">\ooo</span></code>, where <code class="docutils literal notranslate"><span class="pre">o</span></code> is in range <code class="docutils literal notranslate"><span class="pre">[0</span> <span class="pre">-</span> <span class="pre">7]</span></code>
+(the largest octal escape is <code class="docutils literal notranslate"><span class="pre">\377</span></code>, which equals <code class="docutils literal notranslate"><span class="pre">0xFF</span></code>).</li>
+<li>Hexadecimal escapes: <code class="docutils literal notranslate"><span class="pre">\xhh</span></code>, <code class="docutils literal notranslate"><span class="pre">\Xhhhh</span></code>, <code class="docutils literal notranslate"><span class="pre">\uhhhh</span></code>, and <code class="docutils literal notranslate"><span class="pre">\Uhhhhhhhh</span></code>,
+where <code class="docutils literal notranslate"><span class="pre">h</span></code> is in range <code class="docutils literal notranslate"><span class="pre">[0</span> <span class="pre">-</span> <span class="pre">9]</span></code>, <code class="docutils literal notranslate"><span class="pre">[a</span> <span class="pre">-</span> <span class="pre">f]</span></code>, or <code class="docutils literal notranslate"><span class="pre">[A</span> <span class="pre">-</span> <span class="pre">F]</span></code>.</li>
+<li>Miscellaneous escapes: <code class="docutils literal notranslate"><span class="pre">\a</span></code>, <code class="docutils literal notranslate"><span class="pre">\b</span></code>, <code class="docutils literal notranslate"><span class="pre">\f</span></code>, <code class="docutils literal notranslate"><span class="pre">\n</span></code>, <code class="docutils literal notranslate"><span class="pre">\r</span></code>, <code class="docutils literal notranslate"><span class="pre">\t</span></code>, <code class="docutils literal notranslate"><span class="pre">\v</span></code>, <code class="docutils literal notranslate"><span class="pre">\\</span></code>.</li>
+</ul>
+<p>Ill-formed octal and hexadecimal escapes are treated as errors.
+An escape followed by a newline is also an error: multiline strings and character classes are not allowed.
+Any other ill-formed escapes are ignored.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Fast submatch extraction — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+ <h3>Fast submatch extraction</h3>
+ <div class="re2c-toc-local">
+ <ul>
+<li><a class="reference internal" href="#">Fast submatch extraction</a><ul>
+<li><a class="reference internal" href="#introduction">Introduction</a></li>
+<li><a class="reference internal" href="#recognition">Recognition</a></li>
+<li><a class="reference internal" href="#the-difficulty-with-dfa">The difficulty with DFA</a></li>
+<li><a class="reference internal" href="#dangerous-trailing-contexts">Dangerous trailing contexts</a></li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="fast-submatch-extraction">
+<h1>Fast submatch extraction<a class="headerlink" href="#fast-submatch-extraction" title="Permalink to this headline">¶</a></h1>
+<p><em>by Ulya Trofimovich</em></p>
+<p>This article is an informal description
+of the <a class="reference external" href="../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">novel algorithm</a>
+used in <a class="reference external" href="../release_notes/1_0.html">re2c-1.0</a>
+to implement <a class="reference external" href="../../manual/features/submatch/submatch.html">submatch extraction</a>.
+It tries to explain what is it so complex about this seemingly simple problem,
+why re2c has such a strange interface,
+and how <em>tags</em> are related to the familiar <em>capturing groups</em> used by other regular expression engines.</p>
+<div class="section" id="introduction">
+<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
+<p><em>Regular expressions</em> is a syntactic notation for describing <em>sets</em>.
+Usually it is assumed that these sets contain strings — sequences of characters over some fixed alphabet.
+This is known as the <em>language interpretation</em> of regular expressions.
+For example, <img class="math" src="../../_images/math/dd74dc5c9418a329ecbe0073e1fe05190eda9a85.png" alt="a^*b^*" style="vertical-align: 0px"/> denotes language <img class="math" src="../../_images/math/48db08e51669ad87af374b5f0fd4dacbb2de0ea6.png" alt="L" style="vertical-align: 0px"/> that contains all strings
+composed by a sequence of <img class="math" src="../../_images/math/2a3e6468d8e8436144abc2ac7a0eba94cfcf8833.png" alt="a" style="vertical-align: 0px"/> followed by a sequence of <img class="math" src="../../_images/math/9a35981bab3fb1e23a2f374e4a027a565471a18d.png" alt="b" style="vertical-align: 0px"/>.
+Special symbol <img class="math" src="../../_images/math/5c6c23b13e59ef813dcae81710428f8e21fee05f.png" alt="\epsilon" style="vertical-align: 0px"/> means “empty string”:</p>
+<div class="math">
+<p><img src="../../_images/math/31c6035d057f521b139d5008dc46cc0ac4ad0d35.png" alt="L(a^*b^*) = \{\epsilon, a, b, aa, ab, bb, ...\}"/></p>
+</div><p>Regular expressions is one possible way of describing <em>regular languages</em> —
+the class of languages generated by Type 3 grammars in the Chomsky hierarchy.
+For every regular expression there is an equivalent Type 3 grammar that generates the same language and vice versa.
+For example, the above language <img class="math" src="../../_images/math/48db08e51669ad87af374b5f0fd4dacbb2de0ea6.png" alt="L" style="vertical-align: 0px"/> can be generated by the grammar <img class="math" src="../../_images/math/86719de2b4bb24ecfb2b5fe5d28bfce049432409.png" alt="G = (V_T, V_N, R, S)" style="vertical-align: -5px"/>:</p>
+<div class="math">
+<p><img src="../../_images/math/0037694037d3a71e41413578cd234edd3d833051.png" alt="\text{alphabet of terminals:} &\quad V_T = \{ a, b \} \\
+\text{alphabet of non-terminals:} &\quad V_N = \{ A, B \} \\
+\text{production rules:} &\quad R = \{
+A \rightarrow aA | bB | a | b | \epsilon,
+B \rightarrow bB | b
+\} \\
+\text{start symbol:} &\quad S = A"/></p>
+</div><p>It is often said that regular expressions are used for <em>matching</em> strings.
+But what exactly is matching?
+In the narrow sense of the word it means <em>recognition</em>:
+deciding if the given string belongs to the language denoted by the regular expression.
+For example, <img class="math" src="../../_images/math/b343a75f21850f283e7a9052c6d4e429e86f2fdf.png" alt="aaabb \in L" style="vertical-align: -1px"/>, but <img class="math" src="../../_images/math/f4797cf166ba72d581981b92f88fef1e2eb77d04.png" alt="aba \not\in L" style="vertical-align: -4px"/>.
+In the broad sense of the word matching means <em>parsing</em>:
+besides solving the membership problem
+it is also necessary to find the <em>derivation</em> — the sequence of grammar rules that transform start symbol into the input string.
+Derivation gives more information than a simple membership test
+because it reconstructs the <em>structure</em> of the input string.
+For example, <img class="math" src="../../_images/math/bd301c72d768733527c1682f02f6ead4568d4881.png" alt="aaabb" style="vertical-align: 0px"/> is derived as follows in the grammar <img class="math" src="../../_images/math/58480c8cf19c69c3af184a56ed6985d65b9b244f.png" alt="G" style="vertical-align: 0px"/>:</p>
+<div class="math">
+<p><img src="../../_images/math/928ce57bd007871a404e32870db45b88533e1b76.png" alt="A
+\rightarrow aA
+\rightarrow aaA
+\rightarrow aaaA
+\rightarrow aaabB
+\rightarrow aaabb"/></p>
+</div><p>There is no exact analogue of “derivation” in terms of regular expressions,
+as their primary application is recognition, not parsing.
+Yet sometimes it is convenient to know which part of the input string
+corresponds to a particular part of the regular expression —
+the problem known as <em>submatch extraction</em>.
+In our example one might want to know the substrings corresponding to <img class="math" src="../../_images/math/3235fa0f6f8e4a39a6a3498583f5b7de4138e058.png" alt="a^*" style="vertical-align: 0px"/> and <img class="math" src="../../_images/math/7da27f7d74eb31b3c2cd639dad0f41bcbcb7688a.png" alt="b^*" style="vertical-align: 0px"/>;
+this is usually denoted with the help of <em>capturing parentheses</em>: <img class="math" src="../../_images/math/c75680b8275f933e71a564f1e7c4b7948de56152.png" alt="(a^*)(b^*)" style="vertical-align: -5px"/>.
+Submatch extraction is similar to parsing:
+in order to find submatch boundaries we need to know a bit of the input structure.
+However, unlike parsing, there is no need to reconstruct the full structure down to each character.</p>
+<div class="math">
+<p><img src="../../_images/math/3a6bd8b5c62ffa658aaf86378127d64d5e03c433.png" alt="\underbrace{aaa}_{a^*} \underbrace{bb}_{b^*}"/></p>
+</div><p>Recognition problem can be solved by converting the regular expression to a <em>nondeterministic finite automaton</em> (NFA)
+or an equivalent <em>deterministic finite automaton</em> (DFA).
+Parsing and submatch extraction are inherently more complex than recognition,
+and they require a more complex type of automata: <em>nondeterministic finite state transducers</em> (NFST).
+Unlike NFA, NFST are strictly more powerful than their deterministic analogues (DFST):
+it is possible to perform determinization, but the resulting automaton is of a more sophisticated type than DFST.</p>
+</div>
+<div class="section" id="recognition">
+<h2>Recognition<a class="headerlink" href="#recognition" title="Permalink to this headline">¶</a></h2>
+<img alt="../../_images/nfa_simple.png" src="../../_images/nfa_simple.png" />
+<p>aaaa</p>
+<img alt="../../_images/nfa.png" src="../../_images/nfa.png" />
+<p>aaaa</p>
+<img alt="../../_images/dfa_raw.png" src="../../_images/dfa_raw.png" />
+<p>aaaaa</p>
+<img alt="../../_images/dfa.png" src="../../_images/dfa.png" />
+<p>aaaa</p>
+<img alt="../../_images/dfa_min.png" src="../../_images/dfa_min.png" />
+<p>Recognition problem can be solved by converting the regular expression to a <em>nondeterministic finite automaton</em> (NFA)
+and simulating NFA moves on the input string.
+Simulation takes linear time, but since the automaton is nondeterministic,
+it is necessary to track many possible paths simultaneously.
+Alternatively, one can convert NFA to an equivalent <em>deterministic finite automaton</em> (DFA),
+which also runs in linear time, but is much faster then NFA — there is only one possible path to track.
+The <em>determinization</em> procedure is quite complex;
+in the worst case it may take exponential time and generate a very large DFA.
+Therefore determinization is only worthwile
+if it can be performed ahead of time (in lexer generators like re2c),
+or if the same regular expression is used multiple times.
+Some engines try to get the best of both worlds by using <em>lazy determinization</em>:
+NFA simulation with memoization of all intermediate states.</p>
+<p>In terms of NFA “derivation” means “path”,
+and parsing means finding this path — a chain of transitions from initial state to final state which spells the input string.
+This cannot be done by the means of traditional NFA,
+as the only output they produce is a yes/no answer:
+simulation either ends in a final state or not.
+In order to remember the path automaton must be able to record its moves.
+Such automata are known as <em>nondeterministic finite state transducers</em> (NFST):
+they are like ordinary NFA extended with an output tape
+and transitions that not only read symbols from the input string, but also write symbols on the output tape.
+Unlike NFA, NFST cannot be always converted to DFST: nondeterminisitc transducers are strictly more powerful.
+However, it is possible to turn NFST into a more complex type of determinisitc automata.
+Devising and constructing such automata is the main challenge of parsing and submatch extraction.</p>
+</div>
+<div class="section" id="the-difficulty-with-dfa">
+<h2>The difficulty with DFA<a class="headerlink" href="#the-difficulty-with-dfa" title="Permalink to this headline">¶</a></h2>
+</div>
+<div class="section" id="dangerous-trailing-contexts">
+<h2>Dangerous trailing contexts<a class="headerlink" href="#dangerous-trailing-contexts" title="Permalink to this headline">¶</a></h2>
+<p>The challenge of implementing submatch extraction in lexer generators like re2c is not immediately obvious.</p>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Changelog — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1 current"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Changelog</a></li>
+</ul>
+
+</div>
+ <h3>Changelog</h3>
+ <div class="re2c-toc-local">
+ <ul>
+<li><a class="reference internal" href="#">Changelog</a><ul>
+<li><a class="reference internal" href="#x">1.2x</a><ul>
+<li><a class="reference internal" href="#id1">1.2.1 (2019-08-11)</a></li>
+<li><a class="reference internal" href="#id4">1.2 (2019-08-02)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id53">1.1x</a><ul>
+<li><a class="reference internal" href="#id54">1.1.1 (2018-08-30)</a></li>
+<li><a class="reference internal" href="#id56">1.1 (2018-08-27)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id58">1.0x</a><ul>
+<li><a class="reference internal" href="#id59">1.0.3 (2017-11-08)</a></li>
+<li><a class="reference internal" href="#id61">1.0.2 (2017-08-26)</a></li>
+<li><a class="reference internal" href="#id63">1.0.1 (2017-08-11)</a></li>
+<li><a class="reference internal" href="#id65">1.0 (2017-08-11)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id95">0.16x</a><ul>
+<li><a class="reference internal" href="#id96">0.16 (2016-01-21)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id100">0.15x</a><ul>
+<li><a class="reference internal" href="#id101">0.15.3 (2015-12-02)</a></li>
+<li><a class="reference internal" href="#id105">0.15.2 (2015-11-23)</a></li>
+<li><a class="reference internal" href="#id106">0.15.1 (2015-11-22)</a></li>
+<li><a class="reference internal" href="#id107">0.15 (2015-11-22)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id117">0.14x</a><ul>
+<li><a class="reference internal" href="#id118">0.14.3 (2015-05-20)</a></li>
+<li><a class="reference internal" href="#id120">0.14.2 (2015-03-25)</a></li>
+<li><a class="reference internal" href="#id122">0.14.1 (2015-02-27)</a></li>
+<li><a class="reference internal" href="#id124">0.14 (2015-02-23)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id128">0.13x</a><ul>
+<li><a class="reference internal" href="#id129">0.13.7.5 (2014-08-22)</a></li>
+<li><a class="reference internal" href="#id130">0.13.7.4 (2014-07-29)</a></li>
+<li><a class="reference internal" href="#id131">0.13.7.3 (2014-07-27)</a></li>
+<li><a class="reference internal" href="#id132">0.13.7.2 (2014-07-27)</a></li>
+<li><a class="reference internal" href="#id133">0.13.7.1 (2014-07-26)</a></li>
+<li><a class="reference internal" href="#id134">0.13.7 (2014-07-25)</a></li>
+<li><a class="reference internal" href="#id135">0.13.6 (2013-07-04)</a></li>
+<li><a class="reference internal" href="#id136">0.13.5 (2008-05-25)</a></li>
+<li><a class="reference internal" href="#id137">0.13.4 (2008-04-05)</a></li>
+<li><a class="reference internal" href="#id138">0.13.3 (2008-03-14)</a></li>
+<li><a class="reference internal" href="#id139">0.13.2 (2008-02-14)</a></li>
+<li><a class="reference internal" href="#id140">0.13.1 (2007-08-24)</a></li>
+<li><a class="reference internal" href="#id141">0.13.0 (2007-06-24)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id142">0.12x</a><ul>
+<li><a class="reference internal" href="#id143">0.12.3 (2007-08-24)</a></li>
+<li><a class="reference internal" href="#id144">0.12.2 (2007-06-26)</a></li>
+<li><a class="reference internal" href="#id145">0.12.1 (2007-05-23)</a></li>
+<li><a class="reference internal" href="#id146">0.12.0 (2007-05-01)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id147">0.11x</a><ul>
+<li><a class="reference internal" href="#id148">0.11.3 (2007-04-01)</a></li>
+<li><a class="reference internal" href="#id149">0.11.2 (2007-03-01)</a></li>
+<li><a class="reference internal" href="#id150">0.11.1 (2007-02-20)</a></li>
+<li><a class="reference internal" href="#id151">0.11.0 (2007-01-01)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id152">0.10x</a><ul>
+<li><a class="reference internal" href="#id153">0.10.8 (2007-04-01)</a></li>
+<li><a class="reference internal" href="#id154">0.10.7 (2007-02-20)</a></li>
+<li><a class="reference internal" href="#id155">0.10.6 (2006-08-05)</a></li>
+<li><a class="reference internal" href="#id156">0.10.5 (2006-06-11)</a></li>
+<li><a class="reference internal" href="#id157">0.10.4 (2006-06-01)</a></li>
+<li><a class="reference internal" href="#id158">0.10.3 (2006-05-14)</a></li>
+<li><a class="reference internal" href="#id159">0.10.2 (2006-05-01)</a></li>
+<li><a class="reference internal" href="#id160">0.10.1 (2006-02-28)</a></li>
+<li><a class="reference internal" href="#id161">0.10.0 (2006-02-18)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#id162">0.9x</a><ul>
+<li><a class="reference internal" href="#id163">0.9.12 (2005-12-28)</a></li>
+<li><a class="reference internal" href="#id164">0.9.11 (2005-12-18)</a></li>
+<li><a class="reference internal" href="#id165">0.9.10 (2005-09-04)</a></li>
+<li><a class="reference internal" href="#id166">0.9.9 (2005-07-21)</a></li>
+<li><a class="reference internal" href="#id167">0.9.8 (2005-06-26)</a></li>
+<li><a class="reference internal" href="#id168">0.9.7 (2005-04-30)</a></li>
+<li><a class="reference internal" href="#id169">0.9.6 (2005-04-14)</a></li>
+<li><a class="reference internal" href="#id170">0.9.5 (2005-04-08)</a></li>
+<li><a class="reference internal" href="#id171">0.9.4 (2005-03-12)</a></li>
+<li><a class="reference internal" href="#id172">0.9.3 (2004-05-26)</a></li>
+<li><a class="reference internal" href="#id173">0.9.2 (2004-05-26)</a></li>
+<li><a class="reference internal" href="#id174">0.9.1 (2003-12-13)</a></li>
+</ul>
+</li>
+<li><a class="reference internal" href="#re2c-adopted-2003-12-09">re2c adopted (2003-12-09)</a></li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="changelog">
+<h1>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline">¶</a></h1>
+<div class="section" id="x">
+<h2>1.2x<a class="headerlink" href="#x" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id1">
+<h3>1.2.1 (2019-08-11)<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/253">#253</a>:
+re2c should install unicode_categories.re somewhere.</li>
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/254">#254</a>:
+Turn off re2c:eof = 0.</li>
+</ul>
+</div>
+<div class="section" id="id4">
+<h3>1.2 (2019-08-02)<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code> and configuration <code class="docutils literal notranslate"><span class="pre">re2c:eof</span></code>.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">/*!include:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code> directive and <code class="docutils literal notranslate"><span class="pre">-I</span></code> option.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:on*/</span></code> and <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:off*/</span></code> directives.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">--input-encoding</span> <span class="pre"><ascii</span> <span class="pre">|</span> <span class="pre">utf8></span></code> option.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/237">#237</a>:
+Handle non-ASCII encoded characters in regular expressions</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/250">#250</a>
+UTF8 enoding</li>
+</ul>
+</li>
+<li>Added include file with a list of definitions for Unicode character classes.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/235">#235</a>:
+Unicode character classes</li>
+</ul>
+</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">--location-format</span> <span class="pre"><gnu</span> <span class="pre">|</span> <span class="pre">msvc></span></code> option.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/195">#195</a>:
+Please consider using Gnu format for error messages</li>
+</ul>
+</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">--verbose</span></code> option that prints “success” message if re2c exits
+without errors.</li>
+<li>Added configurations for options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-o</span> <span class="pre">--output</span></code> (specify output file)</li>
+<li><code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> (specify header file)</li>
+</ul>
+</li>
+<li>Removed configurations for internal/debug options.</li>
+<li>Extended <code class="docutils literal notranslate"><span class="pre">-r</span></code> option: allow to mix multiple <code class="docutils literal notranslate"><span class="pre">/*!rules:re2c*/</span></code>,
+<code class="docutils literal notranslate"><span class="pre">/*!use:re2c*/</span></code> and <code class="docutils literal notranslate"><span class="pre">/*!re2c*/</span></code> blocks.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/55">#55</a>:
+allow standard re2c blocks in reuse mode</li>
+</ul>
+</li>
+<li>Fixed <code class="docutils literal notranslate"><span class="pre">-F</span> <span class="pre">--flex-support</span></code> option: parsing and operator precedence.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/229">#229</a>:
+re2c option -F (flex syntax) broken</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/242">#242</a>:
+Operator precedence with –flex-syntax is broken</li>
+</ul>
+</li>
+<li>Changed difference operator <code class="docutils literal notranslate"><span class="pre">/</span></code> to apply before encoding expansion of
+operands.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/236">#236</a>:
+Support range difference with variable-length encodings</li>
+</ul>
+</li>
+<li>Changed output generation of output file to be atomic.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/245">#245</a>:
+re2c output is not atomic</li>
+</ul>
+</li>
+<li>Authored research paper “Efficient POSIX Submatch Extraction on NFA”
+together with Dr Angelo Borsotti.</li>
+<li>Added experimental libre2c library (<code class="docutils literal notranslate"><span class="pre">--enable-libs</span></code> configure option) with
+the following algorithms:<ul>
+<li>TDFA with leftmost-greedy disambiguation</li>
+<li>TDFA with POSIX disambiguation (Okui-Suzuki algorithm)</li>
+<li>TNFA with leftmost-greedy disambiguation</li>
+<li>TNFA with POSIX disambiguation (Okui-Suzuki algorithm)</li>
+<li>TNFA with lazy POSIX disambiguation (Okui-Suzuki algorithm)</li>
+<li>TNFA with POSIX disambiguation (Kuklewicz algorithm)</li>
+<li>TNFA with POSIX disambiguation (Cox algorithm)</li>
+</ul>
+</li>
+<li>Added debug subsystem (<code class="docutils literal notranslate"><span class="pre">--enable-debug</span></code> configure option) and new debug
+options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-dump-cfg</span></code> (dump control flow graph of tag variables)</li>
+<li><code class="docutils literal notranslate"><span class="pre">-dump-interf</span></code> (dump interference table of tag variables)</li>
+<li><code class="docutils literal notranslate"><span class="pre">-dump-closure-stats</span></code> (dump epsilon-closure statistics)</li>
+</ul>
+</li>
+<li>Added internal options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">--posix-closure</span> <span class="pre"><gor1</span> <span class="pre">|</span> <span class="pre">gtop></span></code> (switch between shortest-path algorithms
+used for the construction of POSIX closure)</li>
+</ul>
+</li>
+<li>Fixed a number of crashes found by American Fuzzy Lop fuzzer:<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/226">#226</a>,
+<a class="reference external" href="https://github.com/skvadrik/re2c/issues/227">#227</a>,
+<a class="reference external" href="https://github.com/skvadrik/re2c/issues/228">#228</a>,
+<a class="reference external" href="https://github.com/skvadrik/re2c/issues/231">#231</a>,
+<a class="reference external" href="https://github.com/skvadrik/re2c/issues/232">#232</a>,
+<a class="reference external" href="https://github.com/skvadrik/re2c/issues/233">#233</a>,
+<a class="reference external" href="https://github.com/skvadrik/re2c/issues/234">#234</a>,
+<a class="reference external" href="https://github.com/skvadrik/re2c/issues/238">#238</a></li>
+</ul>
+</li>
+<li>Fixed handling of newlines:<ul>
+<li>correctly parse multi-character newlines CR LF in <code class="docutils literal notranslate"><span class="pre">#line</span></code> directives</li>
+<li>consistently convert all newlines in the generated file to Unix-style LF</li>
+</ul>
+</li>
+<li>Changed default tarball format from .gz to .xz.<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/221">#221</a>:
+big source tarball</li>
+</ul>
+</li>
+<li>Fixed a number of other bugs and resolved issues:<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/2">#2</a>: abort</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/6">#6</a>: segfault</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/10">#10</a>:
+lessons/002_upn_calculator/calc_002 doesn’t produce a useful example program</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/44">#44</a>:
+Access violation when translating the attached file</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/49">#49</a>:
+wildcard state 000 rules makes lexer behave weard</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/98">#98</a>:
+Transparent handling of #line directives in input files</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/104">#104</a>:
+Improve const-correctness</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/105">#105</a>:
+Conversion of pointer parameters into references</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/114">#114</a>:
+Possibility of fixing bug 2535084</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/120">#120</a>:
+condition consisting of default rule only is ignored</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/167">#167</a>:
+Add word boundary support</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/168">#168</a>:
+Wikipedia’s article on re2c</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/180">#180</a>:
+Comment syntax?</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/182">#182</a>:
+yych being set by YYPEEK () and then not used</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/196">#196</a>:
+Implicit type conversion warnings</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/198">#198</a>:
+no match for ‘operator!=’ in ‘i != std::vector<_Tp, _Alloc>::rend() [with _Tp = re2c::bitmap_t, _Alloc = std::allocator<re2c::bitmap_t>]()’</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/210">#210</a>:
+How to build re2c in windows?</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/215">#215</a>:
+A memory read overrun issue in s_to_n32_unsafe.cc</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/220">#220</a>:
+src/dfa/dfa.h: simplify constructor to avoid g++-3.4 bug</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/223">#223</a>:
+Fix typo</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/224">#224</a>:
+src/dfa/closure_posix.cc: pack() tweaks</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/225">#225</a>:
+Documentation link is broken in libre2c/README</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/230">#230</a>:
+Changes for upcoming Travis’ infra migration</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/239">#239</a>:
+Push model example has wrong re2c invocation, breaks guide</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/241">#241</a>:
+Guidance on how to use re2c for full-duplex command & response protocol</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/243">#243</a>:
+A code generated for period (.) requires 4 bytes</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/246">#246</a>:
+Please add a license to this repo</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/247">#247</a>:
+Build failure on current Cygwin, probably caused by force-fed c++98 mode</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/248">#248</a>:
+distcheck still looks for README</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/251">#251</a>:
+Including what you use is find, but not without inclusion guards</li>
+</ul>
+</li>
+<li>Updated documentation and website.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id53">
+<h2>1.1x<a class="headerlink" href="#id53" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id54">
+<h3>1.1.1 (2018-08-30)<a class="headerlink" href="#id54" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/211">#211</a>:
+re2c <code class="docutils literal notranslate"><span class="pre">-V</span></code> throws <code class="docutils literal notranslate"><span class="pre">std::out_of_range</span></code> (version to vernum conversion).</li>
+</ul>
+</div>
+<div class="section" id="id56">
+<h3>1.1 (2018-08-27)<a class="headerlink" href="#id56" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Replaced Kuklewicz POSIX disambiguation algorithm with Okui algorithm.</li>
+<li>Optimized GOR1 algorithm (computation of tagged epsilon-closure).</li>
+<li>Added option <code class="docutils literal notranslate"><span class="pre">--conditions</span></code> (an alias for <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">--start-conditions</span></code>).</li>
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/201">#201</a>:
+Bugs with option: <code class="docutils literal notranslate"><span class="pre">re2c:flags:no-debug-info</span></code>.</li>
+<li>Reworked first part of TDFA paper.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id58">
+<h2>1.0x<a class="headerlink" href="#id58" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id59">
+<h3>1.0.3 (2017-11-08)<a class="headerlink" href="#id59" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/198">#198</a>:
+build error on MacOS with GCC-4.2.1</li>
+</ul>
+</div>
+<div class="section" id="id61">
+<h3>1.0.2 (2017-08-26)<a class="headerlink" href="#id61" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/194">#194</a>:
+Build with <code class="docutils literal notranslate"><span class="pre">--enable-docs</span></code></li>
+<li>Updated documentation.</li>
+</ul>
+</div>
+<div class="section" id="id63">
+<h3>1.0.1 (2017-08-11)<a class="headerlink" href="#id63" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/193">#193</a>:
+1.0 build failure on macOS: error: calling a private constructor of class
+‘re2c::Rule’</li>
+<li>Added paper “Tagged Deterministic Finite Automata with Lookahead” to the
+distribution files.</li>
+</ul>
+</div>
+<div class="section" id="id65">
+<h3>1.0 (2017-08-11)<a class="headerlink" href="#id65" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-P</span> <span class="pre">--posix-captures</span></code> (POSIX-compliant capturing groups)</li>
+<li><code class="docutils literal notranslate"><span class="pre">-T</span> <span class="pre">--tags</span></code> (standalone tags with leftmost greedy disambiguation)</li>
+<li><code class="docutils literal notranslate"><span class="pre">--no-lookahead</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--no-optimize-tags</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--eager-skip</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--dump-nfa</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--dump-dfa-raw</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--dump-dfa-det</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--dump-dfa-tagopt</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--dump-dfa-min</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--dump-adfa</span></code></li>
+</ul>
+</li>
+<li>Added new syntax:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">@<stag></span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">#<mtag></span></code></li>
+</ul>
+</li>
+<li>Added new directives:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">/*!stags:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">/*!mtags:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">/*!maxnmatch:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code></li>
+</ul>
+</li>
+<li>Added new API:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">YYSTAGN</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYSTAGP</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYMTAGN</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYMTAGP</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYRESTORETAG</span> <span class="pre">(t)</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">YYMAXNMATCH</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">yynmatch</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">yypmatch</span></code></li>
+</ul>
+</li>
+<li>Added inplace confgurations:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSTAGN</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:define:YYSTAGP</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:define:YYMTAGN</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:define:YYMTAGP</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:define:YYRESTORETAG</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:8</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:utf-8``</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:b</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:bit-vectors</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:case-insensitive</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:case-inverted</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:d</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:debug-output</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:dfa-minimization</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:eager-skip</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:e</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:ecb</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:empty-class</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:encoding-policy</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:g</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:computed-gotos</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:i</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:no-debug-info</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:input</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:lookahead</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:optimize-tags</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:P</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:posix-captures</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:s</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:nested-ifs</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:T</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:tags</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:u</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:unicode</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:w</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:wide-chars</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:flags:x</span></code> or <code class="docutils literal notranslate"><span class="pre">re2c:flags:utf-16</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:tags:expression</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">re2c:tags:prefix</span></code></li>
+</ul>
+</li>
+<li>Added warning <code class="docutils literal notranslate"><span class="pre">-Wnondeterministic-tags</span></code>.</li>
+<li>Added fuzz-testing scripts</li>
+<li>Added paper “Tagged Deterministic Finite Automata with Lookahead”.</li>
+<li>Fixed bugs:<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/121">#121</a>:
+trailing contexts are fundamentally broken</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/135">#135</a>:
+In installation <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">check</span></code> give syntax error</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/137">#137</a>:
+run_tests.sh fail when running configure script with absolute path</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/138">#138</a>:
+website improvement</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/141">#141</a>:
+Tests under Windows</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/142">#142</a>:
+segvault with null terminated input</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/145">#145</a>:
+Values for enum YYCONDTYPE are not generated when default rules with conditions are used</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/147">#147</a>:
+Please add symbol name to “can’t find symbol” error message</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/152">#152</a>:
+Line number in #line directive after enum YYCONDTYPE is 0-based</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/156">#156</a>:
+Build with Visual Studio 14 2015: symbol name conflict</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/158">#158</a>:
+Inconsistent forward declaration of struct/class vs definition</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/160">#160</a>:
+Open text files with “wb” causes issues on Windows</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/162">#162</a>:
+Reading files with “rb” causes issues in Windows</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/165">#165</a>:
+Trailing context consumed if initial expression matches it</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/176">#176</a>:
+re2c help message is too wide for most terminals</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/184">#184</a>:
+Small documentation issue</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/186">#186</a>:
+Difference operator sometimes doesn’t work with utf-8</li>
+</ul>
+</li>
+<li>Merged pull requests:<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/131">#131</a>:
+Use bash-specific <code class="docutils literal notranslate"><span class="pre">[[</span></code> builtin</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/136">#136</a>:
+Added basic support for travis-ci.org integration</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/171">#171</a>:
+Typo fix</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/172">#172</a>:
+Grammar fixes in the docs</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/173">#173</a>:
+Grammar fixes in the manpage</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/174">#174</a>:
+more documentation fixes</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/175">#175</a>:
+more manpage fixes</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/177">#177</a>:
+sync –help output w/ manpage</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/178">#178</a>:
+Moves rts used in the manpage to master</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/179">#179</a>:
+compose manpage out of rsts from gh-pages-gen</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/189">#189</a>:
+Typo fix and small grammatical change</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/191">#191</a>:
+Makefile.am: create target directory before writing into it</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id95">
+<h2>0.16x<a class="headerlink" href="#id95" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id96">
+<h3>0.16 (2016-01-21)<a class="headerlink" href="#id96" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/127">#127</a>:
+code generation error with wide chars and bitmaps (omitted <code class="docutils literal notranslate"><span class="pre">goto</span></code> statement)</li>
+<li>Added DFA minimization and option <code class="docutils literal notranslate"><span class="pre">--dfa-minimization</span> <span class="pre"><table</span> <span class="pre">|</span> <span class="pre">moore></span></code></li>
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/128">#128</a>:
+very slow DFA construction (resulting in a very large DFA)</li>
+<li>Fixed bug <a class="reference external" href="https://github.com/skvadrik/re2c/issues/132">#132</a>:
+test failure on big endian archs with 0.15.3</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id100">
+<h2>0.15x<a class="headerlink" href="#id100" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id101">
+<h3>0.15.3 (2015-12-02)<a class="headerlink" href="#id101" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bugs and applied patches:<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/122">#122</a>:
+clang does not compile re2c 0.15.x</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/124">#124</a>:
+Get rid of UINT32_MAX and friends</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/125">#125</a>:
+[OS X] git reports changes not staged for commit in newly cloned repository</li>
+</ul>
+</li>
+<li>Added option <code class="docutils literal notranslate"><span class="pre">--no-version</span></code> that allows to omit version information.</li>
+<li>Reduced memory and time consumed with <code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code>.</li>
+<li>Improved coverage of input data generated with <code class="docutils literal notranslate"><span class="pre">-S</span> <span class="pre">--skeleton</span></code>.</li>
+</ul>
+</div>
+<div class="section" id="id105">
+<h3>0.15.2 (2015-11-23)<a class="headerlink" href="#id105" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed build system: lexer depends on bison-generated header
+(Gentoo bug: <a class="reference external" href="https://bugs.gentoo.org/show_bug.cgi?id=566620">https://bugs.gentoo.org/show_bug.cgi?id=566620</a>)</li>
+</ul>
+</div>
+<div class="section" id="id106">
+<h3>0.15.1 (2015-11-22)<a class="headerlink" href="#id106" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed test failures caused by locale-sensitive ‘sort’.</li>
+</ul>
+</div>
+<div class="section" id="id107">
+<h3>0.15 (2015-11-22)<a class="headerlink" href="#id107" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Updated website <a class="reference external" href="http://re2c.org">http://re2c.org</a>:<ul>
+<li>added examples</li>
+<li>updated docs</li>
+<li>added news</li>
+<li>added web feed (Atom 1.0)</li>
+</ul>
+</li>
+<li>Added options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-S,</span> <span class="pre">--skeleton</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">--empty-class</span> <span class="pre"><match-empty</span> <span class="pre">|</span> <span class="pre">match-none</span> <span class="pre">|</span> <span class="pre">error></span></code></li>
+</ul>
+</li>
+<li>Added warnings:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-W</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Werror</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-W<warning></span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wno-<warning></span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Werror-<warning></span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wno-error-<warning></span></code></li>
+</ul>
+</li>
+<li>Added specific warnings:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-Wundefined-control-flow</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wunreachable-rules</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wcondition-order</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wuseless-escape</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wempty-character-class</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wswapped-range</span></code></li>
+<li><code class="docutils literal notranslate"><span class="pre">-Wmatch-empty-string</span></code></li>
+</ul>
+</li>
+<li>Fixed options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">--</span></code> (interpret remaining arguments as non-options)</li>
+</ul>
+</li>
+<li>Deprecated options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-1</span> <span class="pre">--single-pass</span></code> (single pass is the default now)</li>
+</ul>
+</li>
+<li>Reduced size of the generated <code class="docutils literal notranslate"><span class="pre">.dot</span></code> files.</li>
+<li>Fixed bugs:<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/27">#27</a>:
+re2c crashes reading files containing <code class="docutils literal notranslate"><span class="pre">%{</span> <span class="pre">%}</span></code> (patch by Rui)</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/51">#51</a>:
+default rule doesn’t work in reuse mode</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/52">#52</a>:
+eliminate multiple passes</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/59">#59</a>:
+bogus <code class="docutils literal notranslate"><span class="pre">yyaccept</span></code> in <code class="docutils literal notranslate"><span class="pre">-c</span></code> mode</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/60">#60</a>:
+redundant use of <code class="docutils literal notranslate"><span class="pre">YYMARKER</span></code></li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/61">#61</a>:
+empty character class <code class="docutils literal notranslate"><span class="pre">[]</span></code> matches empty string</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/115">#115</a>:
+flex-style named definitions cause ambiguity in re2c grammar</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/119">#119</a>:
+<code class="docutils literal notranslate"><span class="pre">-f</span></code> with <code class="docutils literal notranslate"><span class="pre">-b</span></code>/<code class="docutils literal notranslate"><span class="pre">-g</span></code> generates incorrect dispatch on fill labels</li>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/116">#116</a>:
+empty string with non-empty trailing context consumes code units</li>
+</ul>
+</li>
+<li>Added test options:<ul>
+<li><code class="docutils literal notranslate"><span class="pre">-j</span></code>, <code class="docutils literal notranslate"><span class="pre">-j</span> <span class="pre"><N></span></code> (run tests in <code class="docutils literal notranslate"><span class="pre">N</span></code> threads, defaults to the number of CPUs)</li>
+<li><code class="docutils literal notranslate"><span class="pre">--wine</span></code> (test windows builds using <code class="docutils literal notranslate"><span class="pre">wine</span></code>)</li>
+<li><code class="docutils literal notranslate"><span class="pre">--skeleton</span></code> (generate skeleton programs, compile and execute them)</li>
+<li><code class="docutils literal notranslate"><span class="pre">--keep-tmp-files</span></code> (don’t delete intermediate files for successful tests)</li>
+</ul>
+</li>
+<li>Updated build system:<ul>
+<li>support out of source builds</li>
+<li>support <code class="docutils literal notranslate"><span class="pre">`make</span> <span class="pre">distcheck`</span></code></li>
+<li>added <code class="docutils literal notranslate"><span class="pre">`make</span> <span class="pre">bootstrap`</span></code> (rebuild re2c after building with precompiled
+<code class="docutils literal notranslate"><span class="pre">.re</span></code> files)</li>
+<li>added <code class="docutils literal notranslate"><span class="pre">`make</span> <span class="pre">tests`</span></code> (run tests with <code class="docutils literal notranslate"><span class="pre">-j</span></code>)</li>
+<li>added <code class="docutils literal notranslate"><span class="pre">`make</span> <span class="pre">vtests`</span></code> (run tests with <code class="docutils literal notranslate"><span class="pre">--valgrind</span> <span class="pre">-j</span></code>)</li>
+<li>added <code class="docutils literal notranslate"><span class="pre">`make</span> <span class="pre">wtests`</span></code> (run tests with <code class="docutils literal notranslate"><span class="pre">--wine</span> <span class="pre">-j</span> <span class="pre">1</span></code>)</li>
+<li>added Autoconf tests for <code class="docutils literal notranslate"><span class="pre">CXXFLAGS</span></code>. By default try the following options:
+<code class="docutils literal notranslate"><span class="pre">-W</span> <span class="pre">-Wall</span> <span class="pre">-Wextra</span> <span class="pre">-Weffc++</span> <span class="pre">-pedantic</span> <span class="pre">-Wformat=2</span> <span class="pre">-Wredundant-decls</span>
+<span class="pre">-Wsuggest-attribute=format</span> <span class="pre">-Wconversion</span> <span class="pre">-Wsign-conversion</span> <span class="pre">-O2</span> <span class="pre">-Weverything</span></code>),
+respect user-defined <code class="docutils literal notranslate"><span class="pre">CXXFLAGS</span></code></li>
+<li>support Mingw builds: <code class="docutils literal notranslate"><span class="pre">`configure</span> <span class="pre">-host</span> <span class="pre">i686-w64-mingw32`</span></code></li>
+<li>structured source files</li>
+<li>removed old MSVC files</li>
+</ul>
+</li>
+<li>Moved development to github (<a class="reference external" href="https://github.com/skvadrik/re2c">https://github.com/skvadrik/re2c</a>),
+keep a mirror on sourceforge.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id117">
+<h2>0.14x<a class="headerlink" href="#id117" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id118">
+<h3>0.14.3 (2015-05-20)<a class="headerlink" href="#id118" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>applied patch <a class="reference external" href="https://github.com/skvadrik/re2c/issues/27">#27</a>:
+re2c crashes reading files containing %{ %}</li>
+<li>dropped distfiles for MSVC (they are broken anyway)</li>
+</ul>
+</div>
+<div class="section" id="id120">
+<h3>0.14.2 (2015-03-25)<a class="headerlink" href="#id120" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>fixed <a class="reference external" href="https://github.com/skvadrik/re2c/issues/57">#57</a>:
+Wrong result only if another rule is present</li>
+</ul>
+</div>
+<div class="section" id="id122">
+<h3>0.14.1 (2015-02-27)<a class="headerlink" href="#id122" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>fixed <a class="reference external" href="https://github.com/skvadrik/re2c/issues/55">#55</a>:
+re2c-0.14: re2c -V outputs null byte</li>
+</ul>
+</div>
+<div class="section" id="id124">
+<h3>0.14 (2015-02-23)<a class="headerlink" href="#id124" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added generic input API<ul>
+<li><a class="reference external" href="https://github.com/skvadrik/re2c/issues/21">#21</a>:
+Support to configure how re2c code interfaced with the symbol buffer?”</li>
+</ul>
+</li>
+<li>fixed <a class="reference external" href="https://github.com/skvadrik/re2c/issues/46">#46</a>:
+re2c generates an infinite loop, depends on existence of previous parser</li>
+<li>fixed <a class="reference external" href="https://github.com/skvadrik/re2c/issues/47">#47</a>:
+Dot output label escaped characters</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id128">
+<h2>0.13x<a class="headerlink" href="#id128" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id129">
+<h3>0.13.7.5 (2014-08-22)<a class="headerlink" href="#id129" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed <a class="reference external" href="https://bugs.gentoo.org/show_bug.cgi?id=518904">Gentoo bug with PHP lexer</a></li>
+</ul>
+</div>
+<div class="section" id="id130">
+<h3>0.13.7.4 (2014-07-29)<a class="headerlink" href="#id130" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Enabled <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">docs</span></code> only if configured with <code class="docutils literal notranslate"><span class="pre">--enable-docs</span></code></li>
+<li>Disallowed to use yacc/byacc instead of bison to build parser</li>
+<li>Removed non-portable sed feature in script that runs tests</li>
+</ul>
+</div>
+<div class="section" id="id131">
+<h3>0.13.7.3 (2014-07-27)<a class="headerlink" href="#id131" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed CXX warning</li>
+<li>Got rid of asciidoc build-time dependency</li>
+</ul>
+</div>
+<div class="section" id="id132">
+<h3>0.13.7.2 (2014-07-27)<a class="headerlink" href="#id132" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Included man page into dist, respect users CXXFLAGS.</li>
+</ul>
+</div>
+<div class="section" id="id133">
+<h3>0.13.7.1 (2014-07-26)<a class="headerlink" href="#id133" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added missing files to tarball</li>
+</ul>
+</div>
+<div class="section" id="id134">
+<h3>0.13.7 (2014-07-25)<a class="headerlink" href="#id134" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added UTF-8 support</li>
+<li>Added UTF-16 support</li>
+<li>Added default rule</li>
+<li>Added option to control ill-formed Unicode</li>
+</ul>
+</div>
+<div class="section" id="id135">
+<h3>0.13.6 (2013-07-04)<a class="headerlink" href="#id135" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed #2535084 uint problem with Sun C 5.8</li>
+<li>#3308400: allow Yacc-style <code class="docutils literal notranslate"><span class="pre">%{</span></code> code brackets <code class="docutils literal notranslate"><span class="pre">}%</span></code></li>
+<li>#2506253: allow C++ <code class="docutils literal notranslate"><span class="pre">//</span></code> comments</li>
+<li>Fixed inplace configuration in <code class="docutils literal notranslate"><span class="pre">-e</span></code> mode.</li>
+<li>Applied #2482572 Typos in error messages.</li>
+<li>Applied #2482561 Error in manual section on <code class="docutils literal notranslate"><span class="pre">-r</span></code> mode.</li>
+<li>Fixed #2478216 Wrong <code class="docutils literal notranslate"><span class="pre">start_label</span></code> in <code class="docutils literal notranslate"><span class="pre">-c</span></code> mode.</li>
+<li>Fixed #2186718 Unescaped backslash in file name of <code class="docutils literal notranslate"><span class="pre">#line</span></code> directive.</li>
+<li>Fixed #2102138 Duplicate case labels on EBCDIC.</li>
+<li>Fixed #2088583 Compile problem on AIX.</li>
+<li>Fixed #2038610 Ebcdic problem.</li>
+<li>improve dot support: make char intervals (e.g. <code class="docutils literal notranslate"><span class="pre">[A-Z]</span></code>) instead of one edge
+per char</li>
+</ul>
+</div>
+<div class="section" id="id136">
+<h3>0.13.5 (2008-05-25)<a class="headerlink" href="#id136" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed #1952896 Segfault in <code class="docutils literal notranslate"><span class="pre">re2c::Scanner::scan</span></code>.</li>
+<li>Fixed #1952842 Regression.</li>
+</ul>
+</div>
+<div class="section" id="id137">
+<h3>0.13.4 (2008-04-05)<a class="headerlink" href="#id137" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added transparent handling of <code class="docutils literal notranslate"><span class="pre">#line</span></code> directives in input files.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:check</span></code> inplace configuration.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">re2c:define:YYSETSTATE:naked</span></code> inplace configuration.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">re2c:flags:w</span></code> and <code class="docutils literal notranslate"><span class="pre">re2c:flags:u</span></code> inplace configurations.</li>
+<li>Added the ability to add rules in <code class="docutils literal notranslate"><span class="pre">use:re2c</span></code> blocks.</li>
+<li>Changed <code class="docutils literal notranslate"><span class="pre">-r</span></code> flag to accept only <code class="docutils literal notranslate"><span class="pre">rules:re2c</span></code> and <code class="docutils literal notranslate"><span class="pre">use:re2c</span></code> blocks.</li>
+</ul>
+</div>
+<div class="section" id="id138">
+<h3>0.13.3 (2008-03-14)<a class="headerlink" href="#id138" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added <code class="docutils literal notranslate"><span class="pre">-r</span></code> flag to allow reuse of scanner definitions.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">-F</span></code> flag to support flex syntax in rules.</li>
+<li>Fixed SEGV in scanner that occurs with very large blocks.</li>
+<li>Fixed issue with unused <code class="docutils literal notranslate"><span class="pre">yybm</span></code>.</li>
+<li>Partial support for flex syntax.</li>
+<li>Changed to allow <code class="docutils literal notranslate"><span class="pre">/*</span></code> comments with <code class="docutils literal notranslate"><span class="pre">-c</span></code> switch.</li>
+<li>Added flag <code class="docutils literal notranslate"><span class="pre">-D/--emit-dot</span></code>.</li>
+</ul>
+</div>
+<div class="section" id="id139">
+<h3>0.13.2 (2008-02-14)<a class="headerlink" href="#id139" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added flag <code class="docutils literal notranslate"><span class="pre">--case-inverted</span></code>.</li>
+<li>Added flag <code class="docutils literal notranslate"><span class="pre">--case-insensitive</span></code>.</li>
+<li>Added support for <code class="docutils literal notranslate"><span class="pre"><!...></span></code> to enable rule setup.</li>
+<li>Added support for <code class="docutils literal notranslate"><span class="pre">=></span></code> style rules.</li>
+<li>Added support for <code class="docutils literal notranslate"><span class="pre">:=</span></code> style rules.</li>
+<li>Added support for <code class="docutils literal notranslate"><span class="pre">:=></span></code> style rules.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">re2c:cond:divider</span></code> and <code class="docutils literal notranslate"><span class="pre">re2c:cond:goto</span></code> inplace configuration.</li>
+<li>Fixed code generation to emit space after <code class="docutils literal notranslate"><span class="pre">if</span></code>.</li>
+</ul>
+</div>
+<div class="section" id="id140">
+<h3>0.13.1 (2007-08-24)<a class="headerlink" href="#id140" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added custom build rules for Visual Studio 2005 (<code class="docutils literal notranslate"><span class="pre">re2c.rules</span></code>).
+(William Swanson)</li>
+<li>Fixed issue with some compilers.</li>
+<li>Fixed #1776177 Build on AIX.</li>
+<li>Fixed #1743180 <code class="docutils literal notranslate"><span class="pre">fwrite</span></code> with 0 length crashes on OS X.</li>
+</ul>
+</div>
+<div class="section" id="id141">
+<h3>0.13.0 (2007-06-24)<a class="headerlink" href="#id141" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added <code class="docutils literal notranslate"><span class="pre">-c</span></code> and <code class="docutils literal notranslate"><span class="pre">-t</span></code> to generate scanners with (f)lex-like condition
+support.</li>
+<li>Fixed issue with short form of switches and parameter if not first switch.</li>
+<li>Fixed #1708378 segfault <code class="docutils literal notranslate"><span class="pre">in</span> <span class="pre">actions.cc</span></code>.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id142">
+<h2>0.12x<a class="headerlink" href="#id142" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id143">
+<h3>0.12.3 (2007-08-24)<a class="headerlink" href="#id143" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed issue with some compilers.</li>
+<li>Fixed #1776177 Build on AIX.</li>
+<li>Fixed #1743180 <code class="docutils literal notranslate"><span class="pre">fwrite</span></code> with 0 length crashes on OS X.</li>
+</ul>
+</div>
+<div class="section" id="id144">
+<h3>0.12.2 (2007-06-26)<a class="headerlink" href="#id144" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed #1743180 <code class="docutils literal notranslate"><span class="pre">fwrite</span></code> with 0 length crashes on OS X.</li>
+</ul>
+</div>
+<div class="section" id="id145">
+<h3>0.12.1 (2007-05-23)<a class="headerlink" href="#id145" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed #1711240 problem with <code class="docutils literal notranslate"><span class="pre">"</span></code> and <code class="docutils literal notranslate"><span class="pre">7F</span></code> on EBCDIC plattforms.</li>
+</ul>
+</div>
+<div class="section" id="id146">
+<h3>0.12.0 (2007-05-01)<a class="headerlink" href="#id146" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Re-release of 0.11.3 as new stable branch.</li>
+<li>Fixed issue with short form of switches and parameter if not first switch.</li>
+<li>Fixed #1708378 segfault in <code class="docutils literal notranslate"><span class="pre">actions.cc</span></code>.</li>
+<li>re2c 0.12.0 has been tested with the following compilers:<ul>
+<li>gcc version 4.1.2 (Gentoo 4.1.2)</li>
+<li>gcc version 4.1.2 20070302 (prerelease) (4.1.2-1mdv2007.1)</li>
+<li>gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)</li>
+<li>gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)</li>
+<li>gcc version 4.1.0 (SUSE Linux 10)</li>
+<li>gcc version 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1)</li>
+<li>gcc version 4.0.2 20050901 (prerelease) (SUSE Linux) (32 + 64 bit)</li>
+<li>MacPPC, gcc version 4.0.1 (Apple Computer, Inc. build 5367)</li>
+<li>MacIntel, gcc version 4.0.1 (Apple Computer, Inc. build 5250)</li>
+<li>gcc version 3.4.4 [FreeBSD] 20050518 (32 + 64 bit)</li>
+<li>gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)</li>
+<li>gcc version 3.4.2 [FreeBSD]</li>
+<li>gcc version 3.3.5 20050117 (prerelease) (SUSE Linux)</li>
+<li>gcc version 3.3.3 (PPC, 32 + 64 bit)</li>
+<li>Microsoft (R) C/C++ Optimizing Compiler Version 14.00.50727.762 for x64 (64 bit)</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86 (Microsoft Visual C++ 2005)</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 (Mictosoft Visual C++ 2003)</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86 (Microsoft Visual C++ 2002)</li>
+<li>Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20070322Z Package ID: W_CC_C_9.1.037</li>
+<li>Intel(R) C++ Compiler for Intel(R) EM64T-based applications, Version 9.1 (64 bit)</li>
+<li>icpcbin (ICC) 9.1 20070215</li>
+<li>CC: Sun C++ 5.8 2005/10/13 (<code class="docutils literal notranslate"><span class="pre">CXXFLAGS='-library=stlport4'</span></code>)</li>
+<li>MIPSpro Compilers: Version 7.4.4m (32 + 64 bit)</li>
+<li>aCC: HP C/aC++ B3910B A.06.15 [Mar 28 2007] (HP-UX IA64)</li>
+</ul>
+</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id147">
+<h2>0.11x<a class="headerlink" href="#id147" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id148">
+<h3>0.11.3 (2007-04-01)<a class="headerlink" href="#id148" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added support for underscores in named definitions.</li>
+<li>Added new option <code class="docutils literal notranslate"><span class="pre">--no-generation-date</span></code>.</li>
+<li>Fixed issue with long form of switches.</li>
+</ul>
+</div>
+<div class="section" id="id149">
+<h3>0.11.2 (2007-03-01)<a class="headerlink" href="#id149" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added inplace configuration <code class="docutils literal notranslate"><span class="pre">re2c:yyfill:parameter</span></code>.</li>
+<li>Added inplace configuration <code class="docutils literal notranslate"><span class="pre">re2c:yych:conversion</span></code>.</li>
+<li>Fixed <code class="docutils literal notranslate"><span class="pre">-u</span></code> switch code generation.</li>
+<li>Added ability to avoid defines and overwrite generated variable names.</li>
+</ul>
+</div>
+<div class="section" id="id150">
+<h3>0.11.1 (2007-02-20)<a class="headerlink" href="#id150" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Applied #1647875 Add <code class="docutils literal notranslate"><span class="pre">const</span></code> to <code class="docutils literal notranslate"><span class="pre">yybm</span></code> vector.</li>
+</ul>
+</div>
+<div class="section" id="id151">
+<h3>0.11.0 (2007-01-01)<a class="headerlink" href="#id151" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added <code class="docutils literal notranslate"><span class="pre">-u</span></code> switch to support unicode.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id152">
+<h2>0.10x<a class="headerlink" href="#id152" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id153">
+<h3>0.10.8 (2007-04-01)<a class="headerlink" href="#id153" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed issue with long form of switches.</li>
+</ul>
+</div>
+<div class="section" id="id154">
+<h3>0.10.7 (2007-02-20)<a class="headerlink" href="#id154" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Applied #1647875 Add <code class="docutils literal notranslate"><span class="pre">const</span></code> to <code class="docutils literal notranslate"><span class="pre">yybm</span></code> vector.</li>
+</ul>
+</div>
+<div class="section" id="id155">
+<h3>0.10.6 (2006-08-05)<a class="headerlink" href="#id155" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed #1529351 Segv bug on unterminated code blocks.</li>
+<li>Fixed #1528269 Invalid code generation.</li>
+</ul>
+</div>
+<div class="section" id="id156">
+<h3>0.10.5 (2006-06-11)<a class="headerlink" href="#id156" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed long form of <code class="docutils literal notranslate"><span class="pre">-1</span></code> switch to <code class="docutils literal notranslate"><span class="pre">--single-pass</span></code> as noted in man page
+and help.</li>
+<li>Added MSVC 2003 project files and renamed old 2002 ones.</li>
+</ul>
+</div>
+<div class="section" id="id157">
+<h3>0.10.4 (2006-06-01)<a class="headerlink" href="#id157" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fix whitespace in generated code.</li>
+</ul>
+</div>
+<div class="section" id="id158">
+<h3>0.10.3 (2006-05-14)<a class="headerlink" href="#id158" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed issue with <code class="docutils literal notranslate"><span class="pre">-wb</span></code> and <code class="docutils literal notranslate"><span class="pre">-ws</span></code>.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">-g</span></code> switch to support gcc’s computed goto’s.</li>
+<li>Changed to use nested <code class="docutils literal notranslate"><span class="pre">if</span></code>’s instead of <code class="docutils literal notranslate"><span class="pre">switch(yyaccept)</span></code> in <code class="docutils literal notranslate"><span class="pre">-s</span></code> mode.</li>
+</ul>
+</div>
+<div class="section" id="id159">
+<h3>0.10.2 (2006-05-01)<a class="headerlink" href="#id159" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Changed to generate <code class="docutils literal notranslate"><span class="pre">YYMARKER</span></code> only when needed or in single pass mode.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">-1</span></code> switch to force single pass generation and make two pass the
+default.</li>
+<li>Fixed <code class="docutils literal notranslate"><span class="pre">-i</span></code> switch.</li>
+<li>Added configuration <code class="docutils literal notranslate"><span class="pre">yyfill:enable</span></code> to allow suppression of <code class="docutils literal notranslate"><span class="pre">YYFILL()</span></code>
+blocks.</li>
+<li>Added tutorial like lessons to re2c.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">/*!ignore:re2c</span> <span class="pre">*/</span></code> to support documenting of re2c source.</li>
+<li>Fixed issue with multiline re2c comments (<code class="docutils literal notranslate"><span class="pre">/*!max:re2c</span> <span class="pre">...</span> <span class="pre">*/</span></code> and alike).</li>
+<li>Fixed generation of <code class="docutils literal notranslate"><span class="pre">YYDEBUG()</span></code> when using <code class="docutils literal notranslate"><span class="pre">-d</span></code> switch.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">/*!getstate:re2c</span> <span class="pre">*/</span></code> which triggers generation of the
+<code class="docutils literal notranslate"><span class="pre">YYGETSTATE()</span></code> block.</li>
+<li>Added configuration <code class="docutils literal notranslate"><span class="pre">state:abort</span></code>.</li>
+<li>Changed to not generate <code class="docutils literal notranslate"><span class="pre">yyNext</span></code> unless configuration <code class="docutils literal notranslate"><span class="pre">state:nextlabel</span></code> is
+used.</li>
+<li>Changed to not generate <code class="docutils literal notranslate"><span class="pre">yyaccept</span></code> code unless needed.</li>
+<li>Changed to use <code class="docutils literal notranslate"><span class="pre">if</span></code> instead of <code class="docutils literal notranslate"><span class="pre">switch</span></code> expression when <code class="docutils literal notranslate"><span class="pre">yyaccpt</span></code> has
+only one case.</li>
+<li>Added docu, examples and tests to <code class="docutils literal notranslate"><span class="pre">.src.zip</span></code> package (0.10.1 zip was
+repackaged).</li>
+<li>Fixed #1479044 incorrect code generated when using <code class="docutils literal notranslate"><span class="pre">-b</span></code>.</li>
+<li>Fixed #1472770 re2c creates an infinite loop.</li>
+<li>Fixed #1454253 Piece of code saving a backtracking point not generated.</li>
+<li>Fixed #1463639 Missing forward declaration.</li>
+<li>Implemented #1187127 savable state support for multiple re2c blocks.</li>
+<li>re2c 0.10.2 has been tested with the following compilers:<ul>
+<li>gcc (GCC) 4.1.0 (Gentoo 4.1.0)</li>
+<li>gcc version 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1)</li>
+<li>gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)</li>
+<li>gcc (GCC) 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9)</li>
+<li>gcc version 3.4.4 [FreeBSD] 20050518</li>
+<li>gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)</li>
+<li>gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)</li>
+<li>gcc-Version 3.3.5 (Debian 1:3.3.5-13)</li>
+<li>gcc-Version 3.3.0 (mips-sgi-irix6.5/3.3.0/specs)</li>
+<li>MIPSpro Compilers: Version 7.4.4m</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for
+80x86 (Microsoft Visual C++ 2005)</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
+(Mictosoft Visual C++ 2003)</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
+(Microsoft Visual C++ 2002)</li>
+<li>Intel(R) C++ Compiler for Intel(R) EM64T-based applications, Version 9.0
+Build 20050430 Package ID: l_cc_p_9.0.021</li>
+<li>CC: Sun C++ 5.8 2005/10/13 (<code class="docutils literal notranslate"><span class="pre">CXXFLAGS='-library=stlport4'</span></code>)</li>
+<li>bison 2.1, 1.875d, 1.875b, 1.875</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="id160">
+<h3>0.10.1 (2006-02-28)<a class="headerlink" href="#id160" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added support for Solaris and native SUN compiler.</li>
+<li>Applied #1438160 expose <code class="docutils literal notranslate"><span class="pre">YYCTXMARKER</span></code>.</li>
+<li>re2c 0.10.1 has been tested with the following compilers:<ul>
+<li>gcc version 4.0.3 (4.0.3-0.20060215.2mdk for Mandriva Linux release 2006.1)</li>
+<li>gcc version 4.0.2 (4.0.2-1mdk for Mandriva Linux release 2006.1)</li>
+<li>gcc version 4.0.2 20050901 (prerelease) (SUSE Linux)</li>
+<li>gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)</li>
+<li>gcc-Version 3.3.5 (Debian 1:3.3.5-13)</li>
+<li>gcc-Version 3.3.0 (mips-sgi-irix6.5/3.3.0/specs)</li>
+<li>MIPSpro Compilers: Version 7.4.4m</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for
+80x86 (Microsoft Visual C 2005)</li>
+<li>Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
+(Microsoft Visual C 2002)</li>
+<li>Intel(R) C++ Compiler for 32-bit applications, Version 9.0 Build 20051130Z
+Package ID: W_CC_C_9.0.028</li>
+<li>CC: Sun C++ 5.8 2005/10/13 (<code class="docutils literal notranslate"><span class="pre">CXXFLAGS='-compat5</span> <span class="pre">-library=stlport4'</span></code>)</li>
+<li>bison 2.1, 1.875d, 1.875b, 1.875</li>
+</ul>
+</li>
+</ul>
+</div>
+<div class="section" id="id161">
+<h3>0.10.0 (2006-02-18)<a class="headerlink" href="#id161" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added make target <code class="docutils literal notranslate"><span class="pre">zip</span></code> to create windows source packages as zip files.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">re2c:startlabel</span></code> configuration.</li>
+<li>Fixed code generation to not generate unreachable code for initial state.</li>
+<li>Added support for c/c++ compatible <code class="docutils literal notranslate"><span class="pre">\u</span></code> and <code class="docutils literal notranslate"><span class="pre">\U</span></code> unicode notation.</li>
+<li>Added ability to control indendation.</li>
+<li>Made scanner error out in case an ambiguous <code class="docutils literal notranslate"><span class="pre">/*</span></code> is found.</li>
+<li>Fixed indendation of generated code.</li>
+<li>Added support for DOS line endings.</li>
+<li>Added experimental unicode support.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">config_w32.h</span></code> to build out of the box on windows (using msvc 2002+).</li>
+<li>Added Microsoft Visual C .NET 2005 build files.</li>
+<li>Applied #1411087 variable length trailing context.</li>
+<li>Applied #1408326 do not generate <code class="docutils literal notranslate"><span class="pre">goto</span></code> next state.</li>
+<li>Applied #1408282 <code class="docutils literal notranslate"><span class="pre">CharSet</span></code> initialization fix.</li>
+<li>Applied #1408278 <code class="docutils literal notranslate"><span class="pre">readsome</span></code> with MSVC.</li>
+<li>Applied #1307467 Unicode patch for 0.9.7.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id162">
+<h2>0.9x<a class="headerlink" href="#id162" title="Permalink to this headline">¶</a></h2>
+<div class="section" id="id163">
+<h3>0.9.12 (2005-12-28)<a class="headerlink" href="#id163" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed bug #1390174 re2c cannot accept <code class="docutils literal notranslate"><span class="pre">{0,}</span></code>.</li>
+</ul>
+</div>
+<div class="section" id="id164">
+<h3>0.9.11 (2005-12-18)<a class="headerlink" href="#id164" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed #1313083 <code class="docutils literal notranslate"><span class="pre">-e</span></code> (EBCDIC cross compile) broken.</li>
+<li>Fixed #1297658 underestimation of <code class="docutils literal notranslate"><span class="pre">n</span></code> in <code class="docutils literal notranslate"><span class="pre">YYFILL(n)</span></code>.</li>
+<li>Applied #1339483 Avoid rebuilds of re2c when running subtargets.</li>
+<li>Implemented #1335305 symbol table reimplementation, just slightly modifed.</li>
+</ul>
+</div>
+<div class="section" id="id165">
+<h3>0.9.10 (2005-09-04)<a class="headerlink" href="#id165" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Add <code class="docutils literal notranslate"><span class="pre">-i</span></code> switch to avoid generating <code class="docutils literal notranslate"><span class="pre">#line</span></code> information.</li>
+<li>Fixed bug #1251653 re2c generate some invalid <code class="docutils literal notranslate"><span class="pre">#line</span></code> on WIN32.</li>
+</ul>
+</div>
+<div class="section" id="id166">
+<h3>0.9.9 (2005-07-21)<a class="headerlink" href="#id166" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Implemented #1232777 negated char classes <code class="docutils literal notranslate"><span class="pre">[^...]</span></code> and the dot operator <code class="docutils literal notranslate"><span class="pre">.</span></code>.</li>
+<li>Added hexadecimal character definitions.</li>
+<li>Added consistency check for octal character definitions.</li>
+</ul>
+</div>
+<div class="section" id="id167">
+<h3>0.9.8 (2005-06-26)<a class="headerlink" href="#id167" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixed code generation for <code class="docutils literal notranslate"><span class="pre">-b</span></code> switch.</li>
+<li>Added Microsoft Visual C .NET build files.</li>
+</ul>
+</div>
+<div class="section" id="id168">
+<h3>0.9.7 (2005-04-30)<a class="headerlink" href="#id168" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Applied #1181535 storable state patch.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">-d</span></code> flag which outputs a debugable parser.</li>
+<li>Fixed generation of <code class="docutils literal notranslate"><span class="pre">#line</span></code> directives (according to ISO-C99).</li>
+<li>Fixed bug #1187785 Re2c fails to generate valid code.</li>
+<li>Fixed bug #1187452 unused variable <code class="docutils literal notranslate"><span class="pre">yyaccept</span></code>.</li>
+</ul>
+</div>
+<div class="section" id="id169">
+<h3>0.9.6 (2005-04-14)<a class="headerlink" href="#id169" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fix build with gcc >= 3.4.</li>
+</ul>
+</div>
+<div class="section" id="id170">
+<h3>0.9.5 (2005-04-08)<a class="headerlink" href="#id170" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added <code class="docutils literal notranslate"><span class="pre">/*!max:re2c</span> <span class="pre">*/</span></code> which emits <code class="docutils literal notranslate"><span class="pre">#define</span> <span class="pre">YYMAXFILL</span> <span class="pre"><max></span></code>
+line. This allows to define buffers of the minimum required length.
+Occurence must follow <code class="docutils literal notranslate"><span class="pre">/*re2c</span> <span class="pre">*/</span></code> and cannot preceed it.</li>
+<li>Changed re2c to two pass generation to output warning free code.</li>
+<li>Fixed bug #1163046 re2c hangs when processing valid re-file.</li>
+<li>Fixed bug #1022799 re2c scanner has buffering bug.</li>
+</ul>
+</div>
+<div class="section" id="id171">
+<h3>0.9.4 (2005-03-12)<a class="headerlink" href="#id171" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added <code class="docutils literal notranslate"><span class="pre">--vernum</span></code> support.</li>
+<li>Fixed bug #1054496 incorrect code generated with <code class="docutils literal notranslate"><span class="pre">-b</span></code> option.</li>
+<li>Fixed bug #1012748 re2c does not emit last line if <code class="docutils literal notranslate"><span class="pre">\n</span></code> missing.</li>
+<li>Fixed bug #999104 <code class="docutils literal notranslate"><span class="pre">--output=output</span></code> option does not work as documented.</li>
+<li>Fixed bug #999103 Invalid options prefixed with two dashes cause program
+crash.</li>
+</ul>
+</div>
+<div class="section" id="id172">
+<h3>0.9.3 (2004-05-26)<a class="headerlink" href="#id172" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Fixes one small possible bug in the generated output. <code class="docutils literal notranslate"><span class="pre">ych</span></code> instead of
+<code class="docutils literal notranslate"><span class="pre">yych</span></code> is output in certain circumstances.</li>
+</ul>
+</div>
+<div class="section" id="id173">
+<h3>0.9.2 (2004-05-26)<a class="headerlink" href="#id173" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Added <code class="docutils literal notranslate"><span class="pre">-o</span></code> option to specify the output file which also will set the
+<code class="docutils literal notranslate"><span class="pre">#line</span></code> directives to something useful.</li>
+<li>Print version to <code class="docutils literal notranslate"><span class="pre">cout</span></code> instead of <code class="docutils literal notranslate"><span class="pre">cerr</span></code>.</li>
+<li>Added <code class="docutils literal notranslate"><span class="pre">-h</span></code> and <code class="docutils literal notranslate"><span class="pre">--</span></code> style options.</li>
+<li>Moved development to <a class="reference external" href="http://sourceforge.net/projects/re2c">http://sourceforge.net/projects/re2c</a></li>
+<li>Fixed bug #960144 minor cosmetic problem.</li>
+<li>Fixed bug #953181 cannot compile with.</li>
+<li>Fixed bug #939277 Windows support.</li>
+<li>Fixed bug #914462 automake build patch</li>
+<li>Fixed bug #891940 braced quantifiers: <code class="docutils literal notranslate"><span class="pre">{\d+(,|,\d+)?}</span></code> style.</li>
+<li>Fixed bug #869298 Add case insensitive string literals.</li>
+<li>Fixed bug #869297 Input buffer overrun.</li>
+</ul>
+</div>
+<div class="section" id="id174">
+<h3>0.9.1 (2003-12-13)<a class="headerlink" href="#id174" title="Permalink to this headline">¶</a></h3>
+<ul class="simple">
+<li>Removed rcs comments in source files.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="re2c-adopted-2003-12-09">
+<h2>re2c adopted (2003-12-09)<a class="headerlink" href="#re2c-adopted-2003-12-09" title="Permalink to this headline">¶</a></h2>
+<ul>
+<li><p class="first">Version 0.9.1 README:</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Originally</span> <span class="n">written</span> <span class="n">by</span> <span class="n">Peter</span> <span class="n">Bumbulis</span> <span class="p">(</span><span class="n">peter</span><span class="nd">@csg</span><span class="o">.</span><span class="n">uwaterloo</span><span class="o">.</span><span class="n">ca</span><span class="p">)</span>
+<span class="n">Currently</span> <span class="n">maintained</span> <span class="n">by</span> <span class="n">Brian</span> <span class="n">Young</span> <span class="p">(</span><span class="n">bayoung</span><span class="nd">@acm</span><span class="o">.</span><span class="n">org</span><span class="p">)</span>
+
+<span class="n">The</span> <span class="n">re2c</span> <span class="n">distribution</span> <span class="n">can</span> <span class="n">be</span> <span class="n">found</span> <span class="n">at</span><span class="p">:</span>
+<span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">tildeslash</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">re2c</span><span class="o">/</span><span class="n">index</span><span class="o">.</span><span class="n">html</span>
+
+<span class="n">The</span> <span class="n">source</span> <span class="n">distribution</span> <span class="ow">is</span> <span class="n">available</span> <span class="n">from</span><span class="p">:</span>
+<span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">www</span><span class="o">.</span><span class="n">tildeslash</span><span class="o">.</span><span class="n">org</span><span class="o">/</span><span class="n">re2c</span><span class="o">/</span><span class="n">re2c</span><span class="o">-</span><span class="mf">0.9</span><span class="o">.</span><span class="mf">1.</span><span class="n">tar</span><span class="o">.</span><span class="n">gz</span>
+
+<span class="n">This</span> <span class="n">distribution</span> <span class="ow">is</span> <span class="n">a</span> <span class="n">cleaned</span> <span class="n">up</span> <span class="n">version</span> <span class="n">of</span> <span class="n">the</span> <span class="mf">0.5</span> <span class="n">release</span>
+<span class="n">maintained</span> <span class="n">by</span> <span class="n">me</span> <span class="p">(</span><span class="n">Brian</span> <span class="n">Young</span><span class="p">)</span><span class="o">.</span> <span class="n">Several</span> <span class="n">bugs</span> <span class="n">were</span> <span class="n">fixed</span> <span class="k">as</span> <span class="n">well</span>
+<span class="k">as</span> <span class="n">code</span> <span class="n">cleanup</span> <span class="k">for</span> <span class="n">warning</span> <span class="n">free</span> <span class="n">compilation</span><span class="o">.</span> <span class="n">It</span> <span class="n">has</span> <span class="n">been</span>
+<span class="n">developed</span> <span class="ow">and</span> <span class="n">tested</span> <span class="k">with</span> <span class="n">egcs</span> <span class="mf">1.0</span><span class="o">.</span><span class="mi">2</span> <span class="ow">and</span> <span class="n">gcc</span> <span class="mf">2.7</span><span class="o">.</span><span class="mf">2.3</span> <span class="n">on</span> <span class="n">Linux</span> <span class="n">x86</span><span class="o">.</span>
+<span class="n">Peter</span> <span class="n">Bumbulis</span><span class="s1">' original release can be found at:</span>
+<span class="n">ftp</span><span class="p">:</span><span class="o">//</span><span class="n">csg</span><span class="o">.</span><span class="n">uwaterloo</span><span class="o">.</span><span class="n">ca</span><span class="o">/</span><span class="n">pub</span><span class="o">/</span><span class="n">peter</span><span class="o">/</span><span class="n">re2c</span><span class="o">.</span><span class="mf">0.5</span><span class="o">.</span><span class="n">tar</span><span class="o">.</span><span class="n">gz</span>
+
+<span class="n">re2c</span> <span class="ow">is</span> <span class="n">a</span> <span class="n">great</span> <span class="n">tool</span> <span class="k">for</span> <span class="n">writing</span> <span class="n">fast</span> <span class="ow">and</span> <span class="n">flexible</span> <span class="n">lexers</span><span class="o">.</span>
+<span class="n">It</span> <span class="n">has</span> <span class="n">served</span> <span class="n">many</span> <span class="n">people</span> <span class="n">well</span> <span class="k">for</span> <span class="n">many</span> <span class="n">years</span> <span class="ow">and</span> <span class="n">it</span> <span class="n">deserves</span>
+<span class="n">to</span> <span class="n">be</span> <span class="n">maintained</span> <span class="n">more</span> <span class="n">actively</span><span class="o">.</span> <span class="n">re2c</span> <span class="ow">is</span> <span class="n">on</span> <span class="n">the</span> <span class="n">order</span> <span class="n">of</span> <span class="mi">2</span><span class="o">-</span><span class="mi">3</span>
+<span class="n">times</span> <span class="n">faster</span> <span class="n">than</span> <span class="n">a</span> <span class="n">flex</span> <span class="n">based</span> <span class="n">scanner</span><span class="p">,</span> <span class="ow">and</span> <span class="n">its</span> <span class="nb">input</span> <span class="n">model</span>
+<span class="ow">is</span> <span class="n">much</span> <span class="n">more</span> <span class="n">flexible</span><span class="o">.</span>
+
+<span class="n">Patches</span> <span class="ow">and</span> <span class="n">requests</span> <span class="k">for</span> <span class="n">features</span> <span class="n">will</span> <span class="n">be</span> <span class="n">entertained</span><span class="o">.</span> <span class="n">Areas</span>
+<span class="n">of</span> <span class="n">particular</span> <span class="n">interest</span> <span class="n">to</span> <span class="n">me</span> <span class="n">are</span> <span class="n">porting</span> <span class="p">(</span><span class="n">a</span> <span class="n">Solaris</span> <span class="ow">and</span> <span class="n">an</span> <span class="n">NT</span>
+<span class="n">version</span> <span class="n">will</span> <span class="n">be</span> <span class="n">forthcoming</span><span class="p">)</span> <span class="ow">and</span> <span class="n">wide</span> <span class="n">character</span> <span class="n">support</span><span class="o">.</span> <span class="n">Note</span>
+<span class="n">that</span> <span class="n">the</span> <span class="n">code</span> <span class="ow">is</span> <span class="n">already</span> <span class="n">quite</span> <span class="n">portable</span> <span class="ow">and</span> <span class="n">should</span> <span class="n">be</span> <span class="n">buildable</span>
+<span class="n">on</span> <span class="nb">any</span> <span class="n">platform</span> <span class="k">with</span> <span class="n">minor</span> <span class="n">makefile</span> <span class="n">changes</span><span class="o">.</span>
+</pre></div>
+</div>
+</li>
+<li><p class="first">Version 0.5 Peter’s original ANNOUNCE and README:</p>
+<div class="highlight-default notranslate"><div class="highlight"><pre><span></span>re2c is a tool for generating C-based recognizers from regular
+expressions. re2c-based scanners are efficient: for programming
+languages, given similar specifications, an re2c-based scanner
+is typically almost twice as fast as a flex-based scanner with
+little or no increase in size (possibly a decrease on cisc
+architectures). Indeed, re2c-based scanners are quite competitive
+with hand-crafted ones.
+
+Unlike flex, re2c does not generate complete scanners: the user
+must supply some interface code. While this code is not bulky
+(about 50-100 lines for a flex-like scanner; see the man page
+and examples in the distribution) careful coding is required for
+efficiency (and correctness). One advantage of this arrangement
+is that the generated code is not tied to any particular input
+model. For example, re2c generated code can be used to scan
+data from a null-byte terminated buffer as illustrated below.
+
+Given the following source:
+
+ #define NULL ((char*) 0)
+ char *scan(char *p) {
+ char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT p
+ #define YYMARKER q
+ #define YYFILL(n)
+ /*!re2c
+ [0-9]+ {return YYCURSOR;}
+ [\000-\377] {return NULL;}
+ */
+ }
+
+re2c will generate:
+
+ /* Generated by re2c on Sat Apr 16 11:40:58 1994 */
+ #line 1 "simple.re"
+ #define NULL ((char*) 0)
+ char *scan(char *p) {
+ char *q;
+ #define YYCTYPE char
+ #define YYCURSOR p
+ #define YYLIMIT p
+ #define YYMARKER q
+ #define YYFILL(n)
+ {
+ YYCTYPE yych;
+ unsigned int yyaccept;
+ goto yy0;
+ yy1: ++YYCURSOR;
+ yy0:
+ if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
+ yych = *YYCURSOR;
+ if(yych <= '/') goto yy4;
+ if(yych >= ':') goto yy4;
+ yy2: yych = *++YYCURSOR;
+ goto yy7;
+ yy3:
+ #line 10
+ {return YYCURSOR;}
+ yy4: yych = *++YYCURSOR;
+ yy5:
+ #line 11
+ {return NULL;}
+ yy6: ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ yy7: if(yych <= '/') goto yy3;
+ if(yych <= '9') goto yy6;
+ goto yy3;
+ }
+ #line 12
+
+ }
+
+Note that most compilers will perform dead-code elimination to
+remove all YYCURSOR, YYLIMIT comparisions.
+
+re2c was developed for a particular project (constructing a fast
+REXX scanner of all things!) and so while it has some rough edges,
+it should be quite usable. More information about re2c can be
+found in the (admittedly skimpy) man page; the algorithms and
+heuristics used are described in an upcoming LOPLAS article
+(included in the distribution). Probably the best way to find out
+more about re2c is to try the supplied examples. re2c is written in
+C++, and is currently being developed under Linux using gcc 2.5.8.
+
+Peter
+</pre></div>
+</div>
+</li>
+</ul>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release notes — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../_static/jquery.js"></script>
+ <script type="text/javascript" src="../_static/underscore.js"></script>
+ <script type="text/javascript" src="../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul class="current">
+<li class="toctree-l1"><a class="reference internal" href="../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../install/install.html">Build instructions</a></li>
+<li class="toctree-l1 current"><a class="current reference internal" href="#">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+ <h3>Release notes</h3>
+ <div class="re2c-toc-local">
+ <ul>
+<li><a class="reference internal" href="#">Release notes</a><ul>
+<li><a class="reference internal" href="#release-1-2-1">Release 1.2.1</a></li>
+<li><a class="reference internal" href="#release-1-2">Release 1.2</a></li>
+<li><a class="reference internal" href="#release-1-1-1">Release 1.1.1</a></li>
+<li><a class="reference internal" href="#release-1-1">Release 1.1</a></li>
+<li><a class="reference internal" href="#release-1-0-3">Release 1.0.3</a></li>
+<li><a class="reference internal" href="#release-1-0-2">Release 1.0.2</a></li>
+<li><a class="reference internal" href="#release-1-0-1">Release 1.0.1</a></li>
+<li><a class="reference internal" href="#id1">Release 1.0</a></li>
+<li><a class="reference internal" href="#release-0-16">Release 0.16</a></li>
+<li><a class="reference internal" href="#release-0-15-3">Release 0.15.3</a></li>
+<li><a class="reference internal" href="#release-0-15-2">Release 0.15.2</a></li>
+<li><a class="reference internal" href="#release-0-15-1">Release 0.15.1</a></li>
+<li><a class="reference internal" href="#release-0-15">Release 0.15</a></li>
+</ul>
+</li>
+</ul>
+
+ </div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-notes">
+<h1>Release notes<a class="headerlink" href="#release-notes" title="Permalink to this headline">¶</a></h1>
+<div class="toctree-wrapper compound">
+</div>
+<div class="section" id="release-1-2-1">
+<h2>Release 1.2.1<a class="headerlink" href="#release-1-2-1" title="Permalink to this headline">¶</a></h2>
+<p>This is a minor release that improves some of the features introduced in 1.2.
+First, it is now possible to reset <code class="docutils literal notranslate"><span class="pre">re2c:eof</span></code> configuration to the
+default value by setting it to <code class="docutils literal notranslate"><span class="pre">-1</span></code>. Second, re2c now installs standard
+include files to <code class="docutils literal notranslate"><span class="pre">$(datadir)/re2c/stdlib</span></code>, where <code class="docutils literal notranslate"><span class="pre">$(datadir)</span></code> is
+<code class="docutils literal notranslate"><span class="pre">/usr/share</span></code> by default (but can be configured otherwise). When looking for
+include files, re2c automatically tries this directory — there is no need
+to add it manually with <code class="docutils literal notranslate"><span class="pre">-I</span></code>.
+Both issues have been reported by Wesley W. Terpstra. Thank you!</p>
+<p>See the changelog <a class="reference internal" href="changelog/changelog.html#id1"><span class="std std-ref">1.2.1 (2019-08-11)</span></a> for details.</p>
+</div>
+<div class="section" id="release-1-2">
+<h2>Release 1.2<a class="headerlink" href="#release-1-2" title="Permalink to this headline">¶</a></h2>
+<p>This release adds a handful of useful features and finalizes two-year
+research effort on POSIX disambiguation.</p>
+<p>First and foremost, <a class="reference internal" href="../manual/manual.html#eof-rule"><span class="std std-ref">EOF rule</span></a> has been added to
+re2c. It is a new method of checking for the end of input, which aims at being
+both generic and simple to use. Historically re2c has a
+<a class="reference internal" href="../manual/manual.html#eof-handling"><span class="std std-ref">number of ways</span></a> to handle EOF situation. The
+simplest and the most efficient method is
+<a class="reference internal" href="../manual/manual.html#using-sentinel-symbol"><span class="std std-ref">using a sentinel symbol</span></a>, but it
+has limited applicability. The most widely used and generic method is
+<a class="reference internal" href="../manual/manual.html#bounds-checking-with-padding"><span class="std std-ref">bounds checking with padding</span></a>,
+but it is rather complex and requires input buffering.
+Finally, it is possible to define custom EOF handling methods
+by <a class="reference internal" href="../manual/manual.html#using-generic-api"><span class="std std-ref">using the generic API</span></a>. However, such
+methods are not necessarily correct and are likely to be slower than other
+methods. The new method, EOF rule, tries to combine the simplicity and
+efficiency of the sentinel symbol and the generality of bounds checking.
+Essentially, all the user is required to do is to specify an arbitrary “fake”
+sentinel using <code class="docutils literal notranslate"><span class="pre">re2c:eof</span></code> configuration (zero is usually a good choice), to
+define a special EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code>, and to make sure that the fake sentinel is
+always the last symbol in the input buffer. The lexer will then run without end
+of input checks until it hits the branch corresponding to the fake sentinel, at
+which point it will perform additional bounds checking. If indeed it is the end,
+the lexer will try to get more input. If this attempt fails, the lexer will
+either rollback to the last matched rule (or the default rule, if it has
+consumed some input but did not match), or else it will go to EOF rule.
+Depending on each particular case and the choice of sentinel, the performance of
+EOF rule may be slightly better or worse than bounds checking with padding.
+See the user manual for more details and examples.</p>
+<p>Another important new feature is the possibility to <a class="reference internal" href="../manual/manual.html#include-files"><span class="std std-ref">include other files</span></a>. Re2c provides a directive
+<code class="docutils literal notranslate"><span class="pre">/*!include:re2c</span> <span class="pre">"file.re"</span> <span class="pre">*/</span></code>, where <code class="docutils literal notranslate"><span class="pre">file.re</span></code> is the name of the included
+file.
+Re2c looks for included files in the directory of the including file and in the
+include locations, which can be specified with <code class="docutils literal notranslate"><span class="pre">-I</span></code> option. Include files
+may have further includes of their own. Re2c provides some predefined include
+files that can be found in the <code class="docutils literal notranslate"><span class="pre">include/</span></code> sub-directory of the project. These
+files contain useful definitions and form something like a standard library
+for re2c. Currently there is one available include, <code class="docutils literal notranslate"><span class="pre">unicode_categories.re</span></code>.</p>
+<p>Re2c now allows to <a class="reference internal" href="../manual/manual.html#header-files"><span class="std std-ref">generate header file</span></a>
+from the input file using option <code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> or
+<code class="docutils literal notranslate"><span class="pre">re2c:flags:t</span></code> and <code class="docutils literal notranslate"><span class="pre">re2c:flags:type-header</span></code> configurations and the newly
+added directives <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:on*/</span></code> and <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:off*/</span></code>.
+Header files may be needed in cases when re2c is used to generate definitions
+of constants, variables and structs that must be visible from other translation
+units.</p>
+<p>Re2c can now understand UTF8-encoded string literals and character classes in
+regular expressions. By default, re2c parses regular expressions like
+<code class="docutils literal notranslate"><span class="pre">"∀x</span> <span class="pre">∃y"</span></code> as a sequence of 1-byte ASCII code points
+<code class="docutils literal notranslate"><span class="pre">e2</span> <span class="pre">88</span> <span class="pre">80</span> <span class="pre">78</span> <span class="pre">20</span> <span class="pre">e2</span> <span class="pre">88</span> <span class="pre">83</span> <span class="pre">79</span></code> (hexadecimal), and the users have to escape
+Unicode symbols manually: <code class="docutils literal notranslate"><span class="pre">"\u2200x</span> <span class="pre">\u2203y"</span></code>. This is not what most users
+would expect, as demonstrated by multiple issues on the bugtracker. The new
+option <code class="docutils literal notranslate"><span class="pre">--input-encoding</span> <span class="pre"><ascii</span> <span class="pre">|</span> <span class="pre">utf8></span></code> allows to change the default
+behavior and parse <code class="docutils literal notranslate"><span class="pre">"∀x</span> <span class="pre">∃y"</span></code> as a sequence of 4-byte Unicode code points
+<code class="docutils literal notranslate"><span class="pre">2200</span> <span class="pre">78</span> <span class="pre">20</span> <span class="pre">2203</span> <span class="pre">79</span></code> (hexadecimal). Note that the new option affects only
+parsing, and not the code generation.</p>
+<p>Re2c now allows to mix <a class="reference internal" href="../manual/manual.html#reusable-blocks"><span class="std std-ref">reusable blocks</span></a>
+with normal blocks when <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">--reuse</span></code> option is used. This is very useful in
+cases when the input file contains many re2c blocks, and only some of them need
+to be reused (a good example is re2c own lexer, which has to use certain rules
+twice in order to generate ASCII and UTF8 lexer variants for
+<code class="docutils literal notranslate"><span class="pre">--input-encoding</span> <span class="pre"><ascii</span> <span class="pre">|</span> <span class="pre">utf8></span></code> option).</p>
+<p>It is now possible to specify location format in re2c-generated messages with
+<code class="docutils literal notranslate"><span class="pre">--location-format</span> <span class="pre"><gnu</span> <span class="pre">|</span> <span class="pre">msvc></span></code> option. As one might guess, possible
+arguments are GNU location format <code class="docutils literal notranslate"><span class="pre">filename:line:column:</span></code> (the default) and
+MSVC format <code class="docutils literal notranslate"><span class="pre">filename(line,column)</span></code>. This option might help IDE users.
+Another new option is <code class="docutils literal notranslate"><span class="pre">--verbose</span></code> — it prints a short “success” message in
+case re2c exits successfully.</p>
+<p>Flex compatibility mode (enabled with <code class="docutils literal notranslate"><span class="pre">-F</span> <span class="pre">--flex-support</span></code> option) has been
+improved: parsing errors and incorrect operator precedence in some rare cases
+have been fixed. Historically re2c allows to mix flex-style code with re2c-style
+code, which creates certain difficulties for the parser. Such difficulties can
+be resolved by passing parts of the parser context to the lexer.</p>
+<p>The difference operator <code class="docutils literal notranslate"><span class="pre">/</span></code> is now applied to its operands before encoding
+expansion. Re2c supports difference only for character classes, and encoding
+expansion in case of a variable-length encoding may transform even a simple
+character class into a complex graph (see
+<a class="reference external" href="../../_images/utf8_any.png">the graph</a> for <code class="docutils literal notranslate"><span class="pre">[^]</span></code> in UTF8 for example).
+Applying expansion after difference makes <code class="docutils literal notranslate"><span class="pre">/</span></code> applicable in more cases.</p>
+<p>Re2c now generates the output file atomically: it first creates a temporary file
+and writes the generated output into it, and then renames the temporary file to
+the output file.</p>
+<p>Documentation has been rearranged and updated, and the website has been
+fixed to look somewhat better on mobile devices (hopefully).</p>
+<p>From developers standpoint, re2c now has better debugging capabilities. Debug
+code has been moved in a separate subsystem and is no longer built in release
+binaries (debug builds are enabled with <code class="docutils literal notranslate"><span class="pre">--enable-debug</span></code> configure option).
+New debug options and passes have been added.</p>
+<p>This release has taken almost a year, mostly because of the time needed to
+formalize the extended algorithm for POSIX disambiguation and write a formal
+paper <a class="reference external" href="../../2019_borsotti_trofimovich_efficient_posix_submatch_extraction_on_nfa.pdf">Efficient POSIX Submatch Extraction on NFA</a>.
+The algorithms described in the paper are implemented in an experimental
+library <code class="docutils literal notranslate"><span class="pre">libre2c</span></code>. The library is intended as a playground for experiments
+and research, not a replacement for existing libraries like RE2. Having re2c
+as a library is convenient for benchmarking, testing and creating bindings to
+other languages.
+To build the library and benchmarks, configure re2c with <code class="docutils literal notranslate"><span class="pre">--enable-libs</span></code> option.</p>
+<p>Many people have contributed to this release.
+Angelo Borsotti co-authored the paper; his hard work has revealed multiple
+shortcomings and deficiencies in the algorithms used in re2c.
+Henri Salo helped with fuzz-testing re2c using the American Fuzzy Lop.
+Denis Naumov helped with Windows portability issues.
+Sergei Trofimovich fixed a number of bugs;
+he and Serghei Iakovlev helped with the Travis CI infrastructure.
+Wesley Terpstra used re2c in the open-source
+<a class="reference external" href="https://github.com/sifive/wake">wake build tool</a>.
+Many thanks to them and all the others who contributed to this release!</p>
+<p>A lot of bugs have been fixed.
+See the changelog <a class="reference internal" href="changelog/changelog.html#id4"><span class="std std-ref">1.2 (2019-08-02)</span></a> for details.</p>
+</div>
+<div class="section" id="release-1-1-1">
+<h2>Release 1.1.1<a class="headerlink" href="#release-1-1-1" title="Permalink to this headline">¶</a></h2>
+<p>This is a minor bug-fix release.
+It fixes a crash with <code class="docutils literal notranslate"><span class="pre">-V</span></code> <code class="docutils literal notranslate"><span class="pre">--vernum</span></code> option.
+The crash was reported and fixed by Mike Gilbert,
+and later rediscovered by Daniel J. Luke and Perry E. Metzger.
+Sergei Trofimovich made a unit test, as the <code class="docutils literal notranslate"><span class="pre">-V</span></code> <code class="docutils literal notranslate"><span class="pre">--vernum</span></code> option has already caused some troubles in the past.
+See the changelog <a class="reference internal" href="changelog/changelog.html#id54"><span class="std std-ref">1.1.1 (2018-08-30)</span></a> for details.
+Thanks everyone!</p>
+</div>
+<div class="section" id="release-1-1">
+<h2>Release 1.1<a class="headerlink" href="#release-1-1" title="Permalink to this headline">¶</a></h2>
+<p>This release doesn’t bring in any serious user-visible changes;
+most of the work concentrated on the internal POSIX disambiguation algorithm
+used for submatch extraction with <code class="docutils literal notranslate"><span class="pre">--posix-captures</span></code> option.
+The old algorithm, introduced in <a class="reference external" href="./1_0.html">release 1.0</a>, was based on the work of Chris Kuklewicz
+(outlined on this <a class="reference external" href="https://wiki.haskell.org/index.php?title=Regular_expressions/Bounded_space_proposal&oldid=11475">haskell wiki page</a>
+and formalized in the paper <a class="reference external" href="http://re2c.org/2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">Tagged Deterministic Finite Automata with Lookahead</a>).
+Kuklewicz algorithm was replaced with a totally different algorithm
+based on the work of Satoshi Okui and Taro Suzuki (described in the paper
+“Disambiguation in Regular Expression Matching via Position Automata with Augmented Transitions”, year 2013).
+The main effort in this release was in developing proper theoretical foundations for the new algorithm.
+As usual, there has been a couple of bug fixes.</p>
+<p>See the changelog <a class="reference internal" href="changelog/changelog.html#id56"><span class="std std-ref">1.1 (2018-08-27)</span></a> for details.</p>
+</div>
+<div class="section" id="release-1-0-3">
+<h2>Release 1.0.3<a class="headerlink" href="#release-1-0-3" title="Permalink to this headline">¶</a></h2>
+<p>Yet another minor bug-fix release.
+It fixes a build failure on Mac OS X (thanks to Ryan Shmidt for the bug report).
+See the changelog <a class="reference internal" href="changelog/changelog.html#id59"><span class="std std-ref">1.0.3 (2017-11-08)</span></a> for details.</p>
+</div>
+<div class="section" id="release-1-0-2">
+<h2>Release 1.0.2<a class="headerlink" href="#release-1-0-2" title="Permalink to this headline">¶</a></h2>
+<p>This is another minor bug-fix release.
+It addresses some documentation issues (thanks to Ziris85 for the bug report).
+See the changelog <a class="reference internal" href="changelog/changelog.html#id61"><span class="std std-ref">1.0.2 (2017-08-26)</span></a> for details.</p>
+</div>
+<div class="section" id="release-1-0-1">
+<h2>Release 1.0.1<a class="headerlink" href="#release-1-0-1" title="Permalink to this headline">¶</a></h2>
+<p>This is a minor bug-fix release.
+It fixes a build failure on Mac OS X (thanks to ilovezf for the bug report).
+See the changelog <a class="reference internal" href="changelog/changelog.html#id63"><span class="std std-ref">1.0.1 (2017-08-11)</span></a> for details.</p>
+</div>
+<div class="section" id="id1">
+<h2>Release 1.0<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
+<p>This release is an important milestone in the history of re2c: it adds <em>submatch extraction</em>.
+It is a long-awaited feature; even as Peter Bumbulis released the first version of re2c back in 1993,
+he mentioned submatch extraction in his paper together with Donald D. Cowan
+<a class="reference external" href="../../1994_bumbulis_cowan_re2c_a_more_versatile_scanner_generator.ps">“RE2C: a more versatile scanner generator”</a>
+as a useful feature that soon should be added to re2c.
+It seemed back then that submatch extraction is relatively easy to implement;
+like many other useful extensions, it was deemed to be no more than syntactic sugar on top of canonical regular expressions.</p>
+<p>As it turned out, this is not so:
+the problem of <em>parsing</em> with regular expressions is inherently more complex than <em>recognition</em>,
+and submatch extraction cannot be implemented using traditional DFA-based approach.
+Many authors studied this subject and developed algorithms suitable for their particular settings and problem domains.
+Some of them used NFA-based approach,
+others suggested algorithms based on multiple DFA or multiple passes over a single DFA.
+For re2c most of these algorithms are too heavyweight:
+they require complication of the underlying computational model and incur overhead even in simple cases.</p>
+<p>However, one algorithm is outstanding in this respect:
+it is the algorithm invented by Ville Laurikari in 2000 and described in his paper
+<a class="reference external" href="http://laurikari.net/ville/spire2000-tnfa.pdf">“NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions”</a>.
+Laurikari algorithm is based on a single DFA extended with a fixed number of <em>registers</em>; it makes one pass over the input string,
+works in linear time and the required space does not depend on the input length.
+But what is most important, the added complexity depends on submatch detalization:
+on submatch-free regular expressions Laurikari automaton reduces to a simple DFA.</p>
+<p>When the work on submatch extraction feature started in early 2016,
+at first it seemed that Laurikari algorithm was still overly complicated.
+Re2c needed an algorithm that would support only <em>partial</em> submatch extraction,
+but the supported cases would be handled very efficiently.
+A lot of effort was spent on studying papers,
+and finally this lead to the development of a new algorithm.
+It soon became clear that the self-invented algorithm was in fact a special case of Laurikari algorithm,
+with one significant performance improvement: the use of lookahead symbol.
+Surprisingly, the original Laurikari algorithm has a strange deficiency:
+when recording submatches, the automata totally ignore the lookahead symbol
+and perform a lot of redundant operations that could be easily avoided.
+It was only logical to fix Laurikari algorithm.
+The new improved algorithm is described in the paper
+<a class="reference external" href="../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">“Tagged Deterministic Finite Automata with Lookahead”</a></p>
+<p>Submatch extraction in re2c comes in two flavors:
+POSIX-compliant capturing groups (with true POSIX semantics)
+and standalone <em>tags</em> that use leftmost greedy disambiguation.
+Both features require a number of new API primitives and configurations;
+and they are barely documented yet (though I managed to add a section in the manual).
+The paper cited above has some interesting benchmark results;
+articles and examples will follow in the nearest future.
+As usually, you may expect a number of small bug-fix releases in the 1.0.x series.</p>
+<p>The following people contributed to this release:</p>
+<ul class="simple">
+<li>Petr Skocik tidied up re2c documentation: fixed ubiquitous spelling errors
+and established synchronization system between the online documentation,
+manpage and help message displayed by re2c with <code class="docutils literal notranslate"><span class="pre">--help</span></code> option.</li>
+<li>Sergei Trofimovich wrote a <em>fuzzer</em> that generates random regular expressions
+and checks them on input data generated with re2c <code class="docutils literal notranslate"><span class="pre">--skeleton</span></code> option.
+This fuzzer is most helpful; it has already found tens of bugs in the early implementation of submatch extraction.
+Sergei also helped me with testing re2c on numerous platforms and computer architectures.</li>
+<li>Abs62,
+asmwarrior,
+Ben Smith,
+CRCinAU,
+Derick Rethans,
+Dimitri John Ledkov,
+Eldar Zakirov,
+jcfp,
+Jean-Claude Wippler,
+Jeff Trull,
+Jérôme Dumesnil,
+Jesse Buesking,
+Julian Andres Klode,
+Paulo Custodio,
+Perry E. Metzger,
+philippschaefer,
+Ross Burton,
+Rui Maciel,
+Ryan Mast,
+Samuel006,
+sirzooro,
+Tim Kelly
+— all these people contributed bug reports, patches and feedback. Thank you!</li>
+<li>Many thanks to the early user of the new features João Paredes for his patience and encouraging comments on the subject.</li>
+</ul>
+<p>See the changelog <a class="reference internal" href="changelog/changelog.html#id65"><span class="std std-ref">1.0 (2017-08-11)</span></a> for details.</p>
+</div>
+<div class="section" id="release-0-16">
+<h2>Release 0.16<a class="headerlink" href="#release-0-16" title="Permalink to this headline">¶</a></h2>
+<p>This release adds a very important step in the process of code generation:
+minimization of the underlying DFA (deterministic finite automaton).
+Simply speaking, this means that re2c now generates less code
+(while the generated code behaves exactly the same).</p>
+<p>DFA minimization is a very well-known technique
+and one might expect that any self-respecting lexer generator would definitely use it.
+So how could it be that re2c didn’t?
+In fact, re2c did use a couple of self-invented tricks to compress the generated code
+(one interesting technique is the construction of a <em>tunnel</em> automaton).
+Some of these tricks were quite buggy (see <a class="reference external" href="https://bugs.gentoo.org/show_bug.cgi?id=518904">this bug report</a> for example).
+Now that re2c does canonical DFA minimization, all this stuff is obsolete and has been dropped.</p>
+<p>A lot of attention has been paid to the correctness of the DFA minimization.
+Usually, re2c uses a very simple criterion to validate changes:
+the generated code for all the tests in testsuite must remain the same.
+However, in the case of DFA minimization the generated code changes dramatically.
+It is impossible to verify the changes manually.</p>
+<p>One possible verification tool is the <a class="reference internal" href="../manual/manual.html#skeleton-programs"><span class="std std-ref">skeleton</span></a> feature.
+Because skeleton is constructed prior to DFA minimization, it cannot be affected by any errors in its implementation.</p>
+<p>Another way to verify DFA minimization is by implementing two different algorithms
+and comparing the results. The minimization procedure has a very useful property:
+the miminal DFA is unique (with respect to state relabeling).
+We used the Moore and the so-called <em>table filling</em> algorithms:
+The Moore algorithm is fast, while table filling is very simple to implement.
+The <code class="docutils literal notranslate"><span class="pre">--dfa-minimization</span> <span class="pre"><moore</span> <span class="pre">|</span> <span class="pre">table></span></code> option that allows choosing
+the particular algorithm (defaults to <code class="docutils literal notranslate"><span class="pre">moore</span></code>), but it’s only useful for debugging
+DFA minimization.</p>
+<p>A good side effect of messing with re2c internals is a significant speedup
+of code generation (see <a class="reference external" href="https://github.com/skvadrik/re2c/issues/128">this issue</a> for example).
+The test suite now runs twice as fast (at least).</p>
+<p>See the changelog <a class="reference internal" href="changelog/changelog.html#id96"><span class="std std-ref">0.16 (2016-01-21)</span></a> for details.</p>
+</div>
+<div class="section" id="release-0-15-3">
+<h2>Release 0.15.3<a class="headerlink" href="#release-0-15-3" title="Permalink to this headline">¶</a></h2>
+<p>This release fixes multiple build-time and run-time failures on OS X, FreeBSD, and Windows.
+Most of the problems were reported and fixed by Oleksii Taran (on OS X)
+and Sergei Trofimovich (on FreeBSD and Windows).
+Thank you for your help!</p>
+<p><a class="reference internal" href="../manual/manual.html#skeleton-programs"><span class="std std-ref">Skeleton</span></a> coverage has been improved.</p>
+<p>See the changelog <a class="reference internal" href="changelog/changelog.html#id101"><span class="std std-ref">0.15.3 (2015-12-02)</span></a> for details.</p>
+</div>
+<div class="section" id="release-0-15-2">
+<h2>Release 0.15.2<a class="headerlink" href="#release-0-15-2" title="Permalink to this headline">¶</a></h2>
+<p>This release fixes a bug in the build system:
+it adds a missing dependency of the lexer on the bison-generated header
+(<a class="reference external" href="https://bugs.gentoo.org/show_bug.cgi?id=566620">reported</a> on Gentoo bugtracker).
+See the changelog <a class="reference internal" href="changelog/changelog.html#id105"><span class="std std-ref">0.15.2 (2015-11-23)</span></a> for details.</p>
+</div>
+<div class="section" id="release-0-15-1">
+<h2>Release 0.15.1<a class="headerlink" href="#release-0-15-1" title="Permalink to this headline">¶</a></h2>
+<p>This release fixes an error in the testing script
+(thanks to Sergei Trofimovich who reported the bug and suggested a quick fix).
+See the changelog <a class="reference internal" href="changelog/changelog.html#id106"><span class="std std-ref">0.15.1 (2015-11-22)</span></a> for details.</p>
+</div>
+<div class="section" id="release-0-15">
+<h2>Release 0.15<a class="headerlink" href="#release-0-15" title="Permalink to this headline">¶</a></h2>
+<p>This release started out in the spring of 2015 as a relatively simple code cleanup.</p>
+<p>It focused on the following problem: re2c used to repeat the whole generation process multiple times.
+Some parts of the generated program depend on the overall input statistics;
+they cannot be generated until the whole input has been processed.
+The usual strategy is to make stubs for all such things and fix them later.
+Instead, re2c used to process the whole input, gather statistics,
+discard the generated output, and regenerate it from scratch.
+Moreover, each generation pass further duplicated certain calculations (for similar reasons).
+As a result, the code generation phase was repeated four times.</p>
+<p>The problem here was not inefficiency: re2c is fast enough to allow the 4x overhead.
+The real problem was the complexity of the code: the developer has to think of multiple execution layers all the time.
+Some parts of code are only executed on certain layers and affect each other.
+Simple reasoning gets really hard.</p>
+<p>So the main purpose of this release was to simplify the code and make it easier to fix bugs and add new features.
+Very soon it became clear that some of the changes in code generation are hard to verify by hand.
+For example, even a minor rebalancing of <code class="docutils literal notranslate"><span class="pre">if</span></code> and <code class="docutils literal notranslate"><span class="pre">switch</span></code> statements
+may change the generated code significantly.
+It was clear that re2c needed an automatic verification tool,
+which lead to the idea of generating <a class="reference internal" href="../manual/manual.html#skeleton-programs"><span class="std std-ref">skeleton programs</span></a>.</p>
+<p>Meanwhile some work was done on adding <a class="reference internal" href="../manual/manual.html#warnings"><span class="std std-ref">warnings</span></a>,
+updating the build system and fixing various bugs.
+A heart-warming consequence of the code simplification is that re2c now uses re2c more extensively:
+not only the main program, but also the command-line options, inplace configurations,
+and all kinds of escaped strings are parsed with re2c.
+Website has also been updated (feel free to suggest improvements).</p>
+<p>See the changelog <a class="reference internal" href="changelog/changelog.html#id107"><span class="std std-ref">0.15 (2015-11-22)</span></a> for details.</p>
+</div>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 0.15 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-0-15">
+<h1>Release 0.15<a class="headerlink" href="#release-0-15" title="Permalink to this headline">¶</a></h1>
+<p>This release started out in the spring of 2015 as a relatively simple code cleanup.</p>
+<p>It focused on the following problem: re2c used to repeat the whole generation process multiple times.
+Some parts of the generated program depend on the overall input statistics;
+they cannot be generated until the whole input has been processed.
+The usual strategy is to make stubs for all such things and fix them later.
+Instead, re2c used to process the whole input, gather statistics,
+discard the generated output, and regenerate it from scratch.
+Moreover, each generation pass further duplicated certain calculations (for similar reasons).
+As a result, the code generation phase was repeated four times.</p>
+<p>The problem here was not inefficiency: re2c is fast enough to allow the 4x overhead.
+The real problem was the complexity of the code: the developer has to think of multiple execution layers all the time.
+Some parts of code are only executed on certain layers and affect each other.
+Simple reasoning gets really hard.</p>
+<p>So the main purpose of this release was to simplify the code and make it easier to fix bugs and add new features.
+Very soon it became clear that some of the changes in code generation are hard to verify by hand.
+For example, even a minor rebalancing of <code class="docutils literal notranslate"><span class="pre">if</span></code> and <code class="docutils literal notranslate"><span class="pre">switch</span></code> statements
+may change the generated code significantly.
+It was clear that re2c needed an automatic verification tool,
+which lead to the idea of generating <a class="reference internal" href="../../manual/manual.html#skeleton-programs"><span class="std std-ref">skeleton programs</span></a>.</p>
+<p>Meanwhile some work was done on adding <a class="reference internal" href="../../manual/manual.html#warnings"><span class="std std-ref">warnings</span></a>,
+updating the build system and fixing various bugs.
+A heart-warming consequence of the code simplification is that re2c now uses re2c more extensively:
+not only the main program, but also the command-line options, inplace configurations,
+and all kinds of escaped strings are parsed with re2c.
+Website has also been updated (feel free to suggest improvements).</p>
+<p>See the changelog <a class="reference internal" href="../changelog/changelog.html#id107"><span class="std std-ref">0.15 (2015-11-22)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 0.15.1 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-0-15-1">
+<h1>Release 0.15.1<a class="headerlink" href="#release-0-15-1" title="Permalink to this headline">¶</a></h1>
+<p>This release fixes an error in the testing script
+(thanks to Sergei Trofimovich who reported the bug and suggested a quick fix).
+See the changelog <a class="reference internal" href="../changelog/changelog.html#id106"><span class="std std-ref">0.15.1 (2015-11-22)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 0.15.2 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-0-15-2">
+<h1>Release 0.15.2<a class="headerlink" href="#release-0-15-2" title="Permalink to this headline">¶</a></h1>
+<p>This release fixes a bug in the build system:
+it adds a missing dependency of the lexer on the bison-generated header
+(<a class="reference external" href="https://bugs.gentoo.org/show_bug.cgi?id=566620">reported</a> on Gentoo bugtracker).
+See the changelog <a class="reference internal" href="../changelog/changelog.html#id105"><span class="std std-ref">0.15.2 (2015-11-23)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 0.15.3 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-0-15-3">
+<h1>Release 0.15.3<a class="headerlink" href="#release-0-15-3" title="Permalink to this headline">¶</a></h1>
+<p>This release fixes multiple build-time and run-time failures on OS X, FreeBSD, and Windows.
+Most of the problems were reported and fixed by Oleksii Taran (on OS X)
+and Sergei Trofimovich (on FreeBSD and Windows).
+Thank you for your help!</p>
+<p><a class="reference internal" href="../../manual/manual.html#skeleton-programs"><span class="std std-ref">Skeleton</span></a> coverage has been improved.</p>
+<p>See the changelog <a class="reference internal" href="../changelog/changelog.html#id101"><span class="std std-ref">0.15.3 (2015-12-02)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 0.16 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-0-16">
+<h1>Release 0.16<a class="headerlink" href="#release-0-16" title="Permalink to this headline">¶</a></h1>
+<p>This release adds a very important step in the process of code generation:
+minimization of the underlying DFA (deterministic finite automaton).
+Simply speaking, this means that re2c now generates less code
+(while the generated code behaves exactly the same).</p>
+<p>DFA minimization is a very well-known technique
+and one might expect that any self-respecting lexer generator would definitely use it.
+So how could it be that re2c didn’t?
+In fact, re2c did use a couple of self-invented tricks to compress the generated code
+(one interesting technique is the construction of a <em>tunnel</em> automaton).
+Some of these tricks were quite buggy (see <a class="reference external" href="https://bugs.gentoo.org/show_bug.cgi?id=518904">this bug report</a> for example).
+Now that re2c does canonical DFA minimization, all this stuff is obsolete and has been dropped.</p>
+<p>A lot of attention has been paid to the correctness of the DFA minimization.
+Usually, re2c uses a very simple criterion to validate changes:
+the generated code for all the tests in testsuite must remain the same.
+However, in the case of DFA minimization the generated code changes dramatically.
+It is impossible to verify the changes manually.</p>
+<p>One possible verification tool is the <a class="reference internal" href="../../manual/manual.html#skeleton-programs"><span class="std std-ref">skeleton</span></a> feature.
+Because skeleton is constructed prior to DFA minimization, it cannot be affected by any errors in its implementation.</p>
+<p>Another way to verify DFA minimization is by implementing two different algorithms
+and comparing the results. The minimization procedure has a very useful property:
+the miminal DFA is unique (with respect to state relabeling).
+We used the Moore and the so-called <em>table filling</em> algorithms:
+The Moore algorithm is fast, while table filling is very simple to implement.
+The <code class="docutils literal notranslate"><span class="pre">--dfa-minimization</span> <span class="pre"><moore</span> <span class="pre">|</span> <span class="pre">table></span></code> option that allows choosing
+the particular algorithm (defaults to <code class="docutils literal notranslate"><span class="pre">moore</span></code>), but it’s only useful for debugging
+DFA minimization.</p>
+<p>A good side effect of messing with re2c internals is a significant speedup
+of code generation (see <a class="reference external" href="https://github.com/skvadrik/re2c/issues/128">this issue</a> for example).
+The test suite now runs twice as fast (at least).</p>
+<p>See the changelog <a class="reference internal" href="../changelog/changelog.html#id96"><span class="std std-ref">0.16 (2016-01-21)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.0 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-0">
+<h1>Release 1.0<a class="headerlink" href="#release-1-0" title="Permalink to this headline">¶</a></h1>
+<p>This release is an important milestone in the history of re2c: it adds <em>submatch extraction</em>.
+It is a long-awaited feature; even as Peter Bumbulis released the first version of re2c back in 1993,
+he mentioned submatch extraction in his paper together with Donald D. Cowan
+<a class="reference external" href="../../1994_bumbulis_cowan_re2c_a_more_versatile_scanner_generator.ps">“RE2C: a more versatile scanner generator”</a>
+as a useful feature that soon should be added to re2c.
+It seemed back then that submatch extraction is relatively easy to implement;
+like many other useful extensions, it was deemed to be no more than syntactic sugar on top of canonical regular expressions.</p>
+<p>As it turned out, this is not so:
+the problem of <em>parsing</em> with regular expressions is inherently more complex than <em>recognition</em>,
+and submatch extraction cannot be implemented using traditional DFA-based approach.
+Many authors studied this subject and developed algorithms suitable for their particular settings and problem domains.
+Some of them used NFA-based approach,
+others suggested algorithms based on multiple DFA or multiple passes over a single DFA.
+For re2c most of these algorithms are too heavyweight:
+they require complication of the underlying computational model and incur overhead even in simple cases.</p>
+<p>However, one algorithm is outstanding in this respect:
+it is the algorithm invented by Ville Laurikari in 2000 and described in his paper
+<a class="reference external" href="http://laurikari.net/ville/spire2000-tnfa.pdf">“NFAs with Tagged Transitions, their Conversion to Deterministic Automata and Application to Regular Expressions”</a>.
+Laurikari algorithm is based on a single DFA extended with a fixed number of <em>registers</em>; it makes one pass over the input string,
+works in linear time and the required space does not depend on the input length.
+But what is most important, the added complexity depends on submatch detalization:
+on submatch-free regular expressions Laurikari automaton reduces to a simple DFA.</p>
+<p>When the work on submatch extraction feature started in early 2016,
+at first it seemed that Laurikari algorithm was still overly complicated.
+Re2c needed an algorithm that would support only <em>partial</em> submatch extraction,
+but the supported cases would be handled very efficiently.
+A lot of effort was spent on studying papers,
+and finally this lead to the development of a new algorithm.
+It soon became clear that the self-invented algorithm was in fact a special case of Laurikari algorithm,
+with one significant performance improvement: the use of lookahead symbol.
+Surprisingly, the original Laurikari algorithm has a strange deficiency:
+when recording submatches, the automata totally ignore the lookahead symbol
+and perform a lot of redundant operations that could be easily avoided.
+It was only logical to fix Laurikari algorithm.
+The new improved algorithm is described in the paper
+<a class="reference external" href="../../2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">“Tagged Deterministic Finite Automata with Lookahead”</a></p>
+<p>Submatch extraction in re2c comes in two flavors:
+POSIX-compliant capturing groups (with true POSIX semantics)
+and standalone <em>tags</em> that use leftmost greedy disambiguation.
+Both features require a number of new API primitives and configurations;
+and they are barely documented yet (though I managed to add a section in the manual).
+The paper cited above has some interesting benchmark results;
+articles and examples will follow in the nearest future.
+As usually, you may expect a number of small bug-fix releases in the 1.0.x series.</p>
+<p>The following people contributed to this release:</p>
+<ul class="simple">
+<li>Petr Skocik tidied up re2c documentation: fixed ubiquitous spelling errors
+and established synchronization system between the online documentation,
+manpage and help message displayed by re2c with <code class="docutils literal notranslate"><span class="pre">--help</span></code> option.</li>
+<li>Sergei Trofimovich wrote a <em>fuzzer</em> that generates random regular expressions
+and checks them on input data generated with re2c <code class="docutils literal notranslate"><span class="pre">--skeleton</span></code> option.
+This fuzzer is most helpful; it has already found tens of bugs in the early implementation of submatch extraction.
+Sergei also helped me with testing re2c on numerous platforms and computer architectures.</li>
+<li>Abs62,
+asmwarrior,
+Ben Smith,
+CRCinAU,
+Derick Rethans,
+Dimitri John Ledkov,
+Eldar Zakirov,
+jcfp,
+Jean-Claude Wippler,
+Jeff Trull,
+Jérôme Dumesnil,
+Jesse Buesking,
+Julian Andres Klode,
+Paulo Custodio,
+Perry E. Metzger,
+philippschaefer,
+Ross Burton,
+Rui Maciel,
+Ryan Mast,
+Samuel006,
+sirzooro,
+Tim Kelly
+— all these people contributed bug reports, patches and feedback. Thank you!</li>
+<li>Many thanks to the early user of the new features João Paredes for his patience and encouraging comments on the subject.</li>
+</ul>
+<p>See the changelog <a class="reference internal" href="../changelog/changelog.html#id65"><span class="std std-ref">1.0 (2017-08-11)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.0.1 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-0-1">
+<h1>Release 1.0.1<a class="headerlink" href="#release-1-0-1" title="Permalink to this headline">¶</a></h1>
+<p>This is a minor bug-fix release.
+It fixes a build failure on Mac OS X (thanks to ilovezf for the bug report).
+See the changelog <a class="reference internal" href="../changelog/changelog.html#id63"><span class="std std-ref">1.0.1 (2017-08-11)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.0.2 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-0-2">
+<h1>Release 1.0.2<a class="headerlink" href="#release-1-0-2" title="Permalink to this headline">¶</a></h1>
+<p>This is another minor bug-fix release.
+It addresses some documentation issues (thanks to Ziris85 for the bug report).
+See the changelog <a class="reference internal" href="../changelog/changelog.html#id61"><span class="std std-ref">1.0.2 (2017-08-26)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.0.3 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-0-3">
+<h1>Release 1.0.3<a class="headerlink" href="#release-1-0-3" title="Permalink to this headline">¶</a></h1>
+<p>Yet another minor bug-fix release.
+It fixes a build failure on Mac OS X (thanks to Ryan Shmidt for the bug report).
+See the changelog <a class="reference internal" href="../changelog/changelog.html#id59"><span class="std std-ref">1.0.3 (2017-11-08)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.1 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-1">
+<h1>Release 1.1<a class="headerlink" href="#release-1-1" title="Permalink to this headline">¶</a></h1>
+<p>This release doesn’t bring in any serious user-visible changes;
+most of the work concentrated on the internal POSIX disambiguation algorithm
+used for submatch extraction with <code class="docutils literal notranslate"><span class="pre">--posix-captures</span></code> option.
+The old algorithm, introduced in <a class="reference external" href="./1_0.html">release 1.0</a>, was based on the work of Chris Kuklewicz
+(outlined on this <a class="reference external" href="https://wiki.haskell.org/index.php?title=Regular_expressions/Bounded_space_proposal&oldid=11475">haskell wiki page</a>
+and formalized in the paper <a class="reference external" href="http://re2c.org/2017_trofimovich_tagged_deterministic_finite_automata_with_lookahead.pdf">Tagged Deterministic Finite Automata with Lookahead</a>).
+Kuklewicz algorithm was replaced with a totally different algorithm
+based on the work of Satoshi Okui and Taro Suzuki (described in the paper
+“Disambiguation in Regular Expression Matching via Position Automata with Augmented Transitions”, year 2013).
+The main effort in this release was in developing proper theoretical foundations for the new algorithm.
+As usual, there has been a couple of bug fixes.</p>
+<p>See the changelog <a class="reference internal" href="../changelog/changelog.html#id56"><span class="std std-ref">1.1 (2018-08-27)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.1.1 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-1-1">
+<h1>Release 1.1.1<a class="headerlink" href="#release-1-1-1" title="Permalink to this headline">¶</a></h1>
+<p>This is a minor bug-fix release.
+It fixes a crash with <code class="docutils literal notranslate"><span class="pre">-V</span></code> <code class="docutils literal notranslate"><span class="pre">--vernum</span></code> option.
+The crash was reported and fixed by Mike Gilbert,
+and later rediscovered by Daniel J. Luke and Perry E. Metzger.
+Sergei Trofimovich made a unit test, as the <code class="docutils literal notranslate"><span class="pre">-V</span></code> <code class="docutils literal notranslate"><span class="pre">--vernum</span></code> option has already caused some troubles in the past.
+See the changelog <a class="reference internal" href="../changelog/changelog.html#id54"><span class="std std-ref">1.1.1 (2018-08-30)</span></a> for details.
+Thanks everyone!</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.2 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-2">
+<h1>Release 1.2<a class="headerlink" href="#release-1-2" title="Permalink to this headline">¶</a></h1>
+<p>This release adds a handful of useful features and finalizes two-year
+research effort on POSIX disambiguation.</p>
+<p>First and foremost, <a class="reference internal" href="../../manual/manual.html#eof-rule"><span class="std std-ref">EOF rule</span></a> has been added to
+re2c. It is a new method of checking for the end of input, which aims at being
+both generic and simple to use. Historically re2c has a
+<a class="reference internal" href="../../manual/manual.html#eof-handling"><span class="std std-ref">number of ways</span></a> to handle EOF situation. The
+simplest and the most efficient method is
+<a class="reference internal" href="../../manual/manual.html#using-sentinel-symbol"><span class="std std-ref">using a sentinel symbol</span></a>, but it
+has limited applicability. The most widely used and generic method is
+<a class="reference internal" href="../../manual/manual.html#bounds-checking-with-padding"><span class="std std-ref">bounds checking with padding</span></a>,
+but it is rather complex and requires input buffering.
+Finally, it is possible to define custom EOF handling methods
+by <a class="reference internal" href="../../manual/manual.html#using-generic-api"><span class="std std-ref">using the generic API</span></a>. However, such
+methods are not necessarily correct and are likely to be slower than other
+methods. The new method, EOF rule, tries to combine the simplicity and
+efficiency of the sentinel symbol and the generality of bounds checking.
+Essentially, all the user is required to do is to specify an arbitrary “fake”
+sentinel using <code class="docutils literal notranslate"><span class="pre">re2c:eof</span></code> configuration (zero is usually a good choice), to
+define a special EOF rule <code class="docutils literal notranslate"><span class="pre">$</span></code>, and to make sure that the fake sentinel is
+always the last symbol in the input buffer. The lexer will then run without end
+of input checks until it hits the branch corresponding to the fake sentinel, at
+which point it will perform additional bounds checking. If indeed it is the end,
+the lexer will try to get more input. If this attempt fails, the lexer will
+either rollback to the last matched rule (or the default rule, if it has
+consumed some input but did not match), or else it will go to EOF rule.
+Depending on each particular case and the choice of sentinel, the performance of
+EOF rule may be slightly better or worse than bounds checking with padding.
+See the user manual for more details and examples.</p>
+<p>Another important new feature is the possibility to <a class="reference internal" href="../../manual/manual.html#include-files"><span class="std std-ref">include other files</span></a>. Re2c provides a directive
+<code class="docutils literal notranslate"><span class="pre">/*!include:re2c</span> <span class="pre">"file.re"</span> <span class="pre">*/</span></code>, where <code class="docutils literal notranslate"><span class="pre">file.re</span></code> is the name of the included
+file.
+Re2c looks for included files in the directory of the including file and in the
+include locations, which can be specified with <code class="docutils literal notranslate"><span class="pre">-I</span></code> option. Include files
+may have further includes of their own. Re2c provides some predefined include
+files that can be found in the <code class="docutils literal notranslate"><span class="pre">include/</span></code> sub-directory of the project. These
+files contain useful definitions and form something like a standard library
+for re2c. Currently there is one available include, <code class="docutils literal notranslate"><span class="pre">unicode_categories.re</span></code>.</p>
+<p>Re2c now allows to <a class="reference internal" href="../../manual/manual.html#header-files"><span class="std std-ref">generate header file</span></a>
+from the input file using option <code class="docutils literal notranslate"><span class="pre">-t</span> <span class="pre">--type-header</span></code> or
+<code class="docutils literal notranslate"><span class="pre">re2c:flags:t</span></code> and <code class="docutils literal notranslate"><span class="pre">re2c:flags:type-header</span></code> configurations and the newly
+added directives <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:on*/</span></code> and <code class="docutils literal notranslate"><span class="pre">/*!header:re2c:off*/</span></code>.
+Header files may be needed in cases when re2c is used to generate definitions
+of constants, variables and structs that must be visible from other translation
+units.</p>
+<p>Re2c can now understand UTF8-encoded string literals and character classes in
+regular expressions. By default, re2c parses regular expressions like
+<code class="docutils literal notranslate"><span class="pre">"∀x</span> <span class="pre">∃y"</span></code> as a sequence of 1-byte ASCII code points
+<code class="docutils literal notranslate"><span class="pre">e2</span> <span class="pre">88</span> <span class="pre">80</span> <span class="pre">78</span> <span class="pre">20</span> <span class="pre">e2</span> <span class="pre">88</span> <span class="pre">83</span> <span class="pre">79</span></code> (hexadecimal), and the users have to escape
+Unicode symbols manually: <code class="docutils literal notranslate"><span class="pre">"\u2200x</span> <span class="pre">\u2203y"</span></code>. This is not what most users
+would expect, as demonstrated by multiple issues on the bugtracker. The new
+option <code class="docutils literal notranslate"><span class="pre">--input-encoding</span> <span class="pre"><ascii</span> <span class="pre">|</span> <span class="pre">utf8></span></code> allows to change the default
+behavior and parse <code class="docutils literal notranslate"><span class="pre">"∀x</span> <span class="pre">∃y"</span></code> as a sequence of 4-byte Unicode code points
+<code class="docutils literal notranslate"><span class="pre">2200</span> <span class="pre">78</span> <span class="pre">20</span> <span class="pre">2203</span> <span class="pre">79</span></code> (hexadecimal). Note that the new option affects only
+parsing, and not the code generation.</p>
+<p>Re2c now allows to mix <a class="reference internal" href="../../manual/manual.html#reusable-blocks"><span class="std std-ref">reusable blocks</span></a>
+with normal blocks when <code class="docutils literal notranslate"><span class="pre">-r</span> <span class="pre">--reuse</span></code> option is used. This is very useful in
+cases when the input file contains many re2c blocks, and only some of them need
+to be reused (a good example is re2c own lexer, which has to use certain rules
+twice in order to generate ASCII and UTF8 lexer variants for
+<code class="docutils literal notranslate"><span class="pre">--input-encoding</span> <span class="pre"><ascii</span> <span class="pre">|</span> <span class="pre">utf8></span></code> option).</p>
+<p>It is now possible to specify location format in re2c-generated messages with
+<code class="docutils literal notranslate"><span class="pre">--location-format</span> <span class="pre"><gnu</span> <span class="pre">|</span> <span class="pre">msvc></span></code> option. As one might guess, possible
+arguments are GNU location format <code class="docutils literal notranslate"><span class="pre">filename:line:column:</span></code> (the default) and
+MSVC format <code class="docutils literal notranslate"><span class="pre">filename(line,column)</span></code>. This option might help IDE users.
+Another new option is <code class="docutils literal notranslate"><span class="pre">--verbose</span></code> — it prints a short “success” message in
+case re2c exits successfully.</p>
+<p>Flex compatibility mode (enabled with <code class="docutils literal notranslate"><span class="pre">-F</span> <span class="pre">--flex-support</span></code> option) has been
+improved: parsing errors and incorrect operator precedence in some rare cases
+have been fixed. Historically re2c allows to mix flex-style code with re2c-style
+code, which creates certain difficulties for the parser. Such difficulties can
+be resolved by passing parts of the parser context to the lexer.</p>
+<p>The difference operator <code class="docutils literal notranslate"><span class="pre">/</span></code> is now applied to its operands before encoding
+expansion. Re2c supports difference only for character classes, and encoding
+expansion in case of a variable-length encoding may transform even a simple
+character class into a complex graph (see
+<a class="reference external" href="../../_images/utf8_any.png">the graph</a> for <code class="docutils literal notranslate"><span class="pre">[^]</span></code> in UTF8 for example).
+Applying expansion after difference makes <code class="docutils literal notranslate"><span class="pre">/</span></code> applicable in more cases.</p>
+<p>Re2c now generates the output file atomically: it first creates a temporary file
+and writes the generated output into it, and then renames the temporary file to
+the output file.</p>
+<p>Documentation has been rearranged and updated, and the website has been
+fixed to look somewhat better on mobile devices (hopefully).</p>
+<p>From developers standpoint, re2c now has better debugging capabilities. Debug
+code has been moved in a separate subsystem and is no longer built in release
+binaries (debug builds are enabled with <code class="docutils literal notranslate"><span class="pre">--enable-debug</span></code> configure option).
+New debug options and passes have been added.</p>
+<p>This release has taken almost a year, mostly because of the time needed to
+formalize the extended algorithm for POSIX disambiguation and write a formal
+paper <a class="reference external" href="../../2019_borsotti_trofimovich_efficient_posix_submatch_extraction_on_nfa.pdf">Efficient POSIX Submatch Extraction on NFA</a>.
+The algorithms described in the paper are implemented in an experimental
+library <code class="docutils literal notranslate"><span class="pre">libre2c</span></code>. The library is intended as a playground for experiments
+and research, not a replacement for existing libraries like RE2. Having re2c
+as a library is convenient for benchmarking, testing and creating bindings to
+other languages.
+To build the library and benchmarks, configure re2c with <code class="docutils literal notranslate"><span class="pre">--enable-libs</span></code> option.</p>
+<p>Many people have contributed to this release.
+Angelo Borsotti co-authored the paper; his hard work has revealed multiple
+shortcomings and deficiencies in the algorithms used in re2c.
+Henri Salo helped with fuzz-testing re2c using the American Fuzzy Lop.
+Denis Naumov helped with Windows portability issues.
+Sergei Trofimovich fixed a number of bugs;
+he and Serghei Iakovlev helped with the Travis CI infrastructure.
+Wesley Terpstra used re2c in the open-source
+<a class="reference external" href="https://github.com/sifive/wake">wake build tool</a>.
+Many thanks to them and all the others who contributed to this release!</p>
+<p>A lot of bugs have been fixed.
+See the changelog <a class="reference internal" href="../changelog/changelog.html#id4"><span class="std std-ref">1.2 (2019-08-02)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Release 1.2.1 — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="../../_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
+ <script type="text/javascript" src="../../_static/jquery.js"></script>
+ <script type="text/javascript" src="../../_static/underscore.js"></script>
+ <script type="text/javascript" src="../../_static/doctools.js"></script>
+ <link rel="shortcut icon" href="../../_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="../../feed/atom.xml" title="Atom 1.0" />
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper"><div class="re2c-logo">
+ re2c
+</div>
+
+<h3><a href="../../index.html">Home</a></h3>
+<div class="re2c-toc-global">
+ <ul>
+<li class="toctree-l1"><a class="reference internal" href="../../manual/manual.html">User manual</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../../install/install.html">Build instructions</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../release_notes.html">Release notes</a></li>
+<li class="toctree-l1"><a class="reference internal" href="../changelog/changelog.html">Changelog</a></li>
+</ul>
+
+</div>
+
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <div class="section" id="release-1-2-1">
+<h1>Release 1.2.1<a class="headerlink" href="#release-1-2-1" title="Permalink to this headline">¶</a></h1>
+<p>This is a minor release that improves some of the features introduced in 1.2.
+First, it is now possible to reset <code class="docutils literal notranslate"><span class="pre">re2c:eof</span></code> configuration to the
+default value by setting it to <code class="docutils literal notranslate"><span class="pre">-1</span></code>. Second, re2c now installs standard
+include files to <code class="docutils literal notranslate"><span class="pre">$(datadir)/re2c/stdlib</span></code>, where <code class="docutils literal notranslate"><span class="pre">$(datadir)</span></code> is
+<code class="docutils literal notranslate"><span class="pre">/usr/share</span></code> by default (but can be configured otherwise). When looking for
+include files, re2c automatically tries this directory — there is no need
+to add it manually with <code class="docutils literal notranslate"><span class="pre">-I</span></code>.
+Both issues have been reported by Wesley W. Terpstra. Thank you!</p>
+<p>See the changelog <a class="reference internal" href="../changelog/changelog.html#id1"><span class="std std-ref">1.2.1 (2019-08-11)</span></a> for details.</p>
+</div>
+
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Aug 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Search — re2c 1.2 documentation</title>
+ <link rel="stylesheet" href="_static/theme-re2c.css" type="text/css" />
+ <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
+ <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
+ <script type="text/javascript" src="_static/jquery.js"></script>
+ <script type="text/javascript" src="_static/underscore.js"></script>
+ <script type="text/javascript" src="_static/doctools.js"></script>
+ <script type="text/javascript" src="_static/searchtools.js"></script>
+ <link rel="shortcut icon" href="_static/favicon.ico"/>
+ <link rel="alternate" type="application/atom+xml" href="feed/atom.xml" title="Atom 1.0" />
+
+
+ <script type="text/javascript">
+ jQuery(function() { Search.loadIndex("searchindex.js"); });
+ </script>
+
+ <script type="text/javascript" id="searchindexloader"></script>
+
+
+ </head><body>
+ <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
+ <div class="sphinxsidebarwrapper">
+ </div>
+ </div>
+
+ <div class="document">
+ <div class="documentwrapper">
+ <div class="bodywrapper">
+ <div class="body" role="main">
+
+ <h1 id="search-documentation">Search</h1>
+ <div id="fallback" class="admonition warning">
+ <script type="text/javascript">$('#fallback').hide();</script>
+ <p>
+ Please activate JavaScript to enable the search
+ functionality.
+ </p>
+ </div>
+ <p>
+ From here you can search these documents. Enter your search
+ words into the box below and click "search". Note that the search
+ function will automatically search for all of the words. Pages
+ containing fewer words won't appear in the result list.
+ </p>
+ <form action="" method="get">
+ <input type="text" name="q" value="" />
+ <input type="submit" value="search" />
+ <span id="search-progress" style="padding-left: 10px"></span>
+ </form>
+
+ <div id="search-results">
+
+ </div>
+
+ </div>
+ </div>
+ </div>
+ <div class="clearer"></div>
+ </div>
+ <div class="footer" role="contentinfo">
+ Last updated on Oct 11, 2019.
+ </div>
+ </body>
+</html>
\ No newline at end of file
--- /dev/null
+Search.setIndex({docnames:["examples/example_04","examples/example_05","examples/example_06","examples/example_07","examples/example_09","examples/example_10","examples/example_11","examples/example_13","examples/example_14","examples/example_15","examples/example_16","examples/example_17","examples/examples","index","install/install","manual/dot/example","manual/manual","manual/skeleton/skeleton_example","manual/syntax/example","manual/warnings/condition_order/wcondition_order","manual/warnings/empty_character_class/wempty_character_class","manual/warnings/match_empty_string/wmatch_empty_string","manual/warnings/sentinel_in_midrule/wsentinel_in_midrule","manual/warnings/swapped_range/wswapped_range","manual/warnings/undefined_control_flow/wundefined_control_flow","manual/warnings/unreachable_rules/wunreachable_rules","manual/warnings/useless_escape/wuseless_escape","releases/articles/submatch_challenge","releases/changelog/changelog","releases/release_notes","releases/release_notes/0_15","releases/release_notes/0_15_1","releases/release_notes/0_15_2","releases/release_notes/0_15_3","releases/release_notes/0_16","releases/release_notes/1_0","releases/release_notes/1_0_1","releases/release_notes/1_0_2","releases/release_notes/1_0_3","releases/release_notes/1_1","releases/release_notes/1_1_1","releases/release_notes/1_2","releases/release_notes/1_2_1"],envversion:53,filenames:["examples/example_04.rst","examples/example_05.rst","examples/example_06.rst","examples/example_07.rst","examples/example_09.rst","examples/example_10.rst","examples/example_11.rst","examples/example_13.rst","examples/example_14.rst","examples/example_15.rst","examples/example_16.rst","examples/example_17.rst","examples/examples.rst","index.rst","install/install.rst","manual/dot/example.rst","manual/manual.rst","manual/skeleton/skeleton_example.rst","manual/syntax/example.rst","manual/warnings/condition_order/wcondition_order.rst","manual/warnings/empty_character_class/wempty_character_class.rst","manual/warnings/match_empty_string/wmatch_empty_string.rst","manual/warnings/sentinel_in_midrule/wsentinel_in_midrule.rst","manual/warnings/swapped_range/wswapped_range.rst","manual/warnings/undefined_control_flow/wundefined_control_flow.rst","manual/warnings/unreachable_rules/wunreachable_rules.rst","manual/warnings/useless_escape/wuseless_escape.rst","releases/articles/submatch_challenge.rst","releases/changelog/changelog.rst","releases/release_notes.rst","releases/release_notes/0_15.rst","releases/release_notes/0_15_1.rst","releases/release_notes/0_15_2.rst","releases/release_notes/0_15_3.rst","releases/release_notes/0_16.rst","releases/release_notes/1_0.rst","releases/release_notes/1_0_1.rst","releases/release_notes/1_0_2.rst","releases/release_notes/1_0_3.rst","releases/release_notes/1_1.rst","releases/release_notes/1_1_1.rst","releases/release_notes/1_2.rst","releases/release_notes/1_2_1.rst"],objects:{},objnames:{},objtypes:{},terms:{"002_upn_calcul":28,"02x":[16,17],"06_braill":2,"07_cxx98":3,"08_ax":[16,17],"0b0":[0,1],"0b110101010":[0,1],"0ha":16,"0x00":[0,1],"0x00000020":16,"0x00000028":16,"0x00000029":16,"0x0000002c":16,"0x0000003a":16,"0x00000070":16,"0x00000078":16,"0x00000079":16,"0x00002200":16,"0x00002203":16,"0x01020304":16,"0x100":16,"0x10000":16,"0x10ffff":16,"0x1ffffffffffffffff":[0,1],"0x20":16,"0x28":16,"0x2800":2,"0x28ff":2,"0x29":16,"0x2c":16,"0x30u":3,"0x3a":16,"0x41u":3,"0x5a":[16,23],"0x61":[16,23],"0x61u":3,"0x70":16,"0x78":16,"0x79":16,"0x7f000001":16,"0x80":16,"0x83":16,"0x88":16,"0xabcdef":[0,1],"0xd7ff":16,"0xd800":16,"0xdfff":16,"0xe000":16,"0xe2":16,"0xff":[16,25,26],"0xfffd":16,"0xffff":16,"0xffffffff":16,"0xffffffffffffffff":[0,1],"19th":8,"1gb":16,"1mdk":28,"1mdv2007":28,"20051130z":28,"20070322z":28,"2mdk":28,"80x86":28,"85a3":5,"875b":28,"875d":28,"8a2e":5,"abstract":[16,24],"boolean":[3,16],"break":[3,5,6,16,19,21,28],"byte":[16,17,22,28,29,41],"case":[3,5,6,9,10,16,17,18,19,21,22,23,24,25,27,28,29,34,35,41],"catch":[3,16,17],"char":[0,1,2,3,4,5,6,7,8,9,10,11,16,18,19,21,22,28],"class":[3,11,23,26,27,28,29,41],"const":[0,1,2,3,4,5,6,7,8,9,10,16,18,19,22,28],"default":[1,3,5,6,9,10,14,18,19,20,21,25,28,29,34,41,42],"enum":[3,16,28],"export":3,"final":[1,16,27,29,35,41],"float":3,"function":[0,1,16,17,18],"goto":[0,1,2,3,4,5,6,7,8,9,11,16,18,19,24,28],"import":[3,16,29,34,35,41],"int":[0,1,2,3,4,5,6,7,8,9,10,11,16,18,19,21,22,28],"j\u00e9r\u00f4me":[29,35],"jo\u00e3o":[29,35],"long":[0,1,3,5,6,16,28,29,35],"new":[2,3,10,13,16,28,29,30,35,39,41],"null":[2,6,7,9,10,16,21,22,28],"public":[3,13],"return":[0,1,2,3,4,5,6,7,8,9,10,11,16,18,19,20,21,22,23,24,25,28],"short":[2,3,16,28,29,41],"static":[0,1,2,3,4,5,6,7,8,9,10,11,16,18,19],"switch":[2,3,5,6,16,18,19,24,28,29,30],"throw":[3,28],"true":[0,1,2,3,8,16,29,35],"try":[3,16,27,28,29,41],"var":4,"void":[2,3,5,6,7,8,9,11,16,19],"while":[3,9,11,16,28,29,34],Added:28,And:[2,16,19],But:[16,24,27,29,35],DOS:28,FOR:3,For:[14,16,17,20,22,23,24,27,28,29,30,35],IDE:[16,29,41],Its:16,Not:[16,18],One:[16,17,24,28,29,34],Such:[27,29,41],The:[1,2,3,9,10,11,13,14,17,18,19,20,21,22,26,28,29,30,34,35,39,40,41],There:[14,16,27],These:[16,29,41],UCS:[2,16,24],USING:3,Use:[16,17,23,28],Used:16,With:[16,24,26],__alltest:14,__bss_start:9,__build_:14,__compar_fn_t:9,__cxx11:9,__data_start:9,__dso_handl:9,__gmon_start__:9,__gnu_cxx3divexx:9,__gnu_cxx:9,__gnu_eh_frame_hdr:9,__init_array_end:9,__init_array_start:9,__libc_csu_fini:9,__libc_csu_init:9,__libc_start_main:9,__off64_t:9,__off_t:9,__pad1:9,__pad2:9,__pad3:9,__pad4:9,__pad5:9,__tmc_end__:9,_alloc:28,_tp:28,aaa:[16,22],aaaa:[16,19,27],aaaaa:27,abc:[16,20],abil:[11,28],abl:27,abnorm:16,abort:[16,28],about:[2,16,17,24,26,27,28],abov:[16,24,26,27,29,35],abs62:[29,35],absolut:[16,24,28],absolute_uri:6,acc:28,accept:[6,15,16,24,28],access:[16,22,25,28],accessor:16,accid:[16,24,26],accident:[16,22],accord:28,accordingli:16,acknowledg:13,acm:[13,28],act:2,action:[1,16,17,18,24,28],action_line4:[16,17],activ:[16,28],actual:[10,16,17,26],acycl:16,add:[3,16,19,21,28,29,30,32,34,35,41,42],adddgt:[0,1,3],added:[28,29,35,41],adding:[16,29,30],addit:[3,16,17,29,41],addition:16,address:[16,29,37],addresssanit:14,adfa:[16,28],adjust:16,admittedli:28,advanc:[3,9,16],advantag:[11,28],advic:[16,24],affect:[0,16,29,30,34,41],after:[16,28,29,41],again:3,against:[14,16],agent:6,aha:16,ahead:27,aim:[13,29,41],aix:28,algorithm:[13,16,27,28,29,34,35,39,41],alia:[16,28],alik:28,aliv:6,all:[0,1,2,3,9,10,11,12,13,14,16,17,18,21,22,24,26,27,28,29,30,34,35,41],alloc:[16,28],allow:[1,2,9,11,13,16,22,26,28,29,30,34,41],almost:[13,16,28,29,41],alon:16,alpha:[5,6,7,16],alphabet:27,alreadi:[3,10,16,28,29,35,40],also:[3,10,14,16,24,25,26,27,28,29,30,35],altern:[16,27],alwai:[13,16,20,24,25,27,29,41],ambigu:[2,16,28],american:[28,29,41],among:16,amount:16,analogu:27,analysi:16,and_eq:3,andr:[29,35],angelo:[13,28,29,41],angl:16,ani:[13,15,16,20,22,24,25,26,28,29,34,39],annoi:[16,21],announc:28,anoth:[1,2,9,16,17,21,24,28,29,34,37,38,41],answer:[13,27],anymor:[16,21],anyth:[16,19],anywai:[9,28],anywher:16,apach:6,api:[9,10,12,28,29,35,41],apolog:13,appear:[2,10,16,24,25],append:16,appl:28,appli:[13,28,29,41],applic:[6,16,27,28,29,35,41],appoint:16,appreci:13,approach:[3,9,13,16,29,35],appropri:[2,16],apr:28,arbitrari:[9,10,16,29,41],arch:[7,28],architectur:[28,29,35],area:28,arg:8,argc:[0,1,3,4,5,6,7,8,9,10,11,16,21],argument:[12,16,21,28,29,41],argv:[0,1,3,4,5,6,7,8,9,10,11,16,21],aris:16,arrai:[16,17],arrang:28,articl:[27,28,29,35],artifact:14,arxiv:13,ascii:[16,24,28,29,41],asciidoc:28,asm:3,asmwarrior:[29,35],aspect:[13,14,16,18],assert:[16,22],assign:[16,19,24],associ:[0,16],assum:[13,16,22,27],assumpt:16,atom:[28,29,41],attach:28,attempt:[29,41],attent:[29,34],attribut:[7,28],augment:[29,39],author:[5,6,28,29,35,41],auto:3,autoconf:28,autogener:[16,19],automak:28,automat:[16,29,30,42],automata:[5,6,13,16,27,28,29,35,39],automaton:[9,11,27,29,34,35],autoreconf:14,autotool:14,auxilari:[16,17],auxiliari:3,avail:[13,16,28,29,41],avoid:[9,11,14,16,28,29,35],await:[29,35],b3910b:28,back:[16,29,35],backslash:28,backtrack:28,backup:[13,16],backward:[11,13,16,24],bad:[8,16,22],bad_arg:8,bakward:[16,20],bare:[16,29,35],base:[0,1,3,9,10,14,16,28,29,35,39],bash:[4,14,28],basic:28,bayoung:[13,28],bbb:[16,19],becam:[29,30,35],becaus:[16,24,25,26,27,29,34,41],becom:[16,19,21,26],been:[3,10,13,16,21,28,29,30,33,34,39,41,42],befor:[9,16,24,28,29,41],begin:[8,16,17],behav:[16,28,29,34],behavior:[16,19,24,29,41],behaviour:[16,20],being:[13,16,28,29,41],beings:2,belaru:7,belong:27,below:[7,8,9,11,15,16,20,21,28],ben:[29,35],benchmark:[5,6,16,29,35,41],besid:[3,27],best:[14,16,27,28],better:[3,16,19,24,29,41],between:[0,1,2,16,17,24,28,29,35],beyond:16,big:[3,28],bin:[0,1,4],binari:[11,12,13,16,29,41],bind:[13,16,24,29,41],binsym:9,bison:[14,28,29,32],bit:[16,24,27,28],bitand:3,bitmap:28,bitmap_t:28,bitor:3,bkmg:8,block:[1,2,12,18,21,28,29,41],boerger:13,bogu:28,bool:[0,1,2,3,8,16],bootstrap:[14,28],born:2,borsotti:[13,28,29,41],both:[3,6,7,13,16,19,25,27,29,35,41,42],bound:[3,23,29,41],boundari:[27,28],box:28,brace:[7,16,28],bracket:[16,28],braill:[12,16],branch:[16,28,29,41],brian:[13,28],bring:[16,24,29,39],brl:13,broad:27,broken:28,brotherhood:2,buesk:[29,35],buf:[3,5,6,16],buffer:[3,4,7,9,10,11,24,25,28,29,41],bug:[12,16,28,29,30,31,32,34,35,36,37,38,39,40,41],buggi:[29,34],bugtrack:[13,29,32,41],build:[28,29,30,32,33,36,38,41],build_dir:14,buildabl:28,built:[14,16,24,29,41],builtin:28,bulki:28,bumbuli:[13,28,29,35],bunch:[3,14,16,26],burton:[13,29,35],byacc:28,bynet:7,bypass:1,c99:28,c_str:8,cad:13,calc_002:28,calcul:[29,30],call:[3,16,28,29,34],caller:16,can:[0,1,2,3,9,10,13,14,16,17,20,21,22,24,25,27,28,29,41,42],cannot:[3,9,10,16,22,24,27,28,29,30,34,35],canon:[29,34,35],cap:2,capabl:[2,29,41],capit:2,captur:[16,27,28,29,35,39],care:28,carefulli:13,categori:16,caus:[16,19,25,28,29,40],cautiou:16,cerr:28,certain:[13,16,22,28,29,30,41],cfg:[16,28],cgi:28,cgoto:16,cha:3,chain:27,challeng:27,chang:[14,16,24,28,29,30,34,39,41],changelog:[29,30,31,32,33,34,35,36,37,38,39,40,41,42],channel:[7,13],char_t:2,charact:[3,9,10,11,12,22,23,24,25,26,27,28,29,41],charg:13,charset:[6,28],chech:[10,11],check:[3,9,10,11,14,22,24,28,29,35,41],choic:[29,41],choich:10,chomski:27,choos:[29,34],chosen:[9,16],chri:[29,39],chunk:16,circumst:28,cisc:28,cite:[29,35],clang:28,clarifi:16,claud:[29,35],clean:28,cleanup:[28,29,30],clear:[7,16,29,30,35],clearli:[16,24],clone:28,close:[7,16,22,26],closur:[16,28],closure_posix:28,cmd:4,code:[1,2,3,13,14,15,16,17,18,19,20,22,23,24,25,28,29,30,34,41],collect:8,column:[16,29,41],com:[6,13,28],combin:[16,24,29,41],come:[16,25,29,35],comma:[16,19],command:[2,4,8,16,28,29,30],comment:[16,18,28,29,35],commit:28,common:[16,22],commun:16,compar:[2,14,16,17,29,34],comparis:28,comparison:16,compat5:28,compat:[13,16,20,24,28,29,41],competit:28,compil:[0,1,2,3,4,5,6,7,8,9,10,11,14,16,17,19,24,28],compl:3,complain:[16,17,24],complementari:[16,20],complet:[13,28],complex:[0,2,16,27,29,30,35,41],compliant:[5,6,16,28,29,35],complic:[29,35],compon:[9,11,16],compos:[16,27,28],compress:[16,29,34],comput:[16,19,28,29,35],concaten:16,concentr:[29,39],concept:16,cond:[16,28],condenumprefix:16,condiiton:16,condit:[2,12,13,19,28],condprefix:16,confgur:28,config_w32:28,configur:[0,2,9,13,14,18,22,28,29,30,35,41,42],conflict:28,conform:3,connect:[1,6,9,11,16],conscienc:2,consequ:[13,14,29,30],consid:[16,23,24,26,28],consider:16,consist:[4,7,16,21,28],const_cast:3,const_iter:8,constant:[3,16,29,41],construct:[16,20,27,28,29,34],constructor:28,consum:[16,20,21,24,25,28,29,41],contain:[7,9,10,13,16,17,21,22,23,24,25,27,28,29,41],content:[6,16],context:[16,26,28,29,41],continu:[3,16,18,19,21,22,25],contract:2,contrast:3,contribut:[13,29,35,41],contributor:13,control:[17,28],conv:11,conveni:[16,27,29,41],convent:16,convers:[16,28,29,35],convert:[2,3,11,16,27,28],copi:[10,16],corner:16,correct:[16,28,29,34,41],correctli:28,correspond:[16,17,18,21,24,27,29,41],corrupt:16,cosmet:28,could:[29,34,35],count:[5,6,16],counterpart:13,countri:7,coupl:[2,3,14,29,34,39],cout:28,cover:[16,24],coverag:[16,28,29,33],cowan:[13,29,35],cox:28,coyot:6,cpu:28,cr8:2,craft:28,crash:[16,28,29,40],crcinau:[29,35],creat:[28,29,41],criterion:[29,34],crlf:6,cross:28,csg:[13,28],ctrl:16,ctype:2,cur:[3,5,6,9,10,16],curli:[7,16],current:[1,14,16,24,28,29,41],cursor:16,custodio:[13,29,35],custom:[9,10,11,16,28,29,41],cut:16,cxx98:3,cxx:28,cxxflag:[14,28],cygm:28,cygwin:[14,28],d08:8,dan:13,danger:[16,19],daniel:[29,40],dash:[16,26,28],dat:[5,6,7],data:[5,13,16,17,28,29,35],datadir:[29,42],date:[6,8,16,28],db8:5,dead:[16,25,28],deal:9,debian:28,debug:[13,14,28,29,34,41],dec:[0,1,3],dec_octet:[5,6],decid:[13,27],decim:[3,8,16],decl:28,declar:[16,28],decod:2,decor:16,decreas:28,dedic:16,deem:[3,29,35],defici:[29,35,41],defin:[0,1,2,3,4,5,6,7,8,9,10,11,16,18,19,21,22,24,28,29,41],definit:[0,2,13,16,18,28,29,34,41],degre:16,delet:[2,3,28],deliber:0,delimit:[16,26],demonstr:[0,1,16,19,20,29,41],deni:[29,41],denot:[16,27],depend:[16,28,29,30,32,35,41],deprec:[16,28],derick:[13,29,35],deriv:[16,27],describ:[3,7,13,16,27,28,29,35,39,41],descript:27,dese:[],deserv:28,desrb:16,det:[16,28],detail:[16,17,29,30,31,32,33,34,35,36,37,38,39,40,41,42],detal:[29,35],detect:[16,17,25],determin:[16,27],determinisitc:27,determinist:[5,6,13,16,27,28,29,34,35,39],dev:7,devel:13,develop:[13,14,28,29,30,35,39,41],devic:[29,41],devis:27,dfa:[1,15,16,17,24,28,29,34,35],dfst:27,did:[16,23,24,29,34,41],didn:[16,24,29,34],differ:[1,2,16,20,22,24,28,29,34,39,41],difficulti:[16,29,41],diffrer:[16,21],digit:[2,5,6,16,17,18],digniti:2,dimitri:[29,35],direct:[11,18,19,28,29,41],directli:[1,2,11,13,16],directori:[14,16,28,29,41,42],disabl:[9,10,11,16],disallow:[16,28],disambigu:[16,28,29,35,39,41],discard:[16,29,30],discrep:[16,17],disjoint:16,dispatch:[1,16,19,28],displai:[29,35],dist:[6,28],distcheck:[14,28],distfil:28,distribut:[13,14,16,28],distributor:13,divid:[16,28],dmd:28,doc:[14,28],docu:28,document:[13,14,28,29,35,37,41],doe:[13,16,28,29,34,35],doesn:[16,20,21,24,26,28,29,39],domain:[13,29,35],don:[0,3,16,19,26,28],donald:[13,29,35],done:[3,16,17,27,29,30],dot:[15,16,17,28],doubl:[3,8,9,16,26],down:27,downsid:16,dramat:[29,34],dreversed_condition_ord:[16,19],driven:13,drop:[28,29,34],due:[16,22,25],dumesnil:[29,35],dump:[14,16,28],duplex:28,duplic:[28,29,30],dure:[16,25],dynamic_cast:3,each:[0,1,2,7,8,9,11,13,16,17,21,26,27,29,30,41],eager:[16,28],eagerli:16,earli:[16,29,35],earlier:16,easi:[3,16,19,21,22,29,35],easier:[13,29,30],easiest:16,easili:[14,16,29,35],eat:[16,25],ebcdic:[16,24,28],ecb:[16,28],echo:[16,17],edg:28,effect:[16,26,29,34],effici:[9,10,13,16,28,29,35,41],effort:[3,29,35,39,41],egc:28,either:[1,2,13,16,26,27,29,41],eldar:[29,35],element:7,elimin:[16,25,28],els:[0,1,3,6,16,19,29,41],elsewher:0,em64t:28,email:13,emit:[16,28],emmanuel:13,empti:[20,25,27,28],emul:10,enabl:[0,1,2,3,4,7,8,9,10,11,14,16,18,19,21,22,28,29,41],enclos:16,encod:[1,2,12,13,24,28,29,41],encount:16,encourag:[29,35],end:[0,3,4,5,6,7,8,9,10,11,16,17,18,22,24,25,27,28,29,41],endian:28,endif:[16,19],endow:2,engin:27,english:2,enod:28,enough:[16,29,30],enter:16,entertain:28,entir:16,entri:16,enumer:[1,16],environ:[13,16],eof:[3,5,6,11,22,28,29,41,42],eol:[4,5,6,7],epsilon:[16,28],equal:[2,16,26],equival:[16,27],err:2,error:[0,1,2,3,4,5,6,7,8,10,13,14,16,17,19,20,22,23,26,28,29,31,34,35,41],escap:[28,29,30,41],essenti:[29,41],establish:[29,35],etc:[12,13,14,16,24,26],etc_passwd:4,even:[16,29,30,35,41],evenli:16,eventu:[16,22,24],everi:[10,13,16,24,27],everyon:[16,24,29,40],everyth:[16,17,19],exact:[16,27],exactli:[3,16,24,27,29,34],examp:9,exampl:[0,1,2,3,4,5,6,7,8,10,11,12,13,15,17,19,20,21,22,23,24,25,26,27,28,29,30,34,35,41],exce:[13,16],except:[1,2,3,16,19,22,25],exclam:[16,19],exclud:[16,22,24],execut:[16,24,28,29,30],exist:[28,29,41],exit:[16,17,28,29,41],exp:3,exp_sig:3,exp_sign:3,expand:16,expans:[28,29,41],expect:[2,16,17,19,21,22,24,29,34,35,41],experi:[29,41],experiment:[14,28,29,41],explain:[16,19,27],explicit:[3,16,19],explor:10,exponenti:27,expos:[0,28],express:[5,6,14,24,27,28,29,35,39,41],extend:[27,28,29,35,41],extens:[16,29,30,35],extern:[3,16],extract:[13,28,29,35,39,41],fact:[3,10,29,34,35],factor:16,fail:[11,16,24,25,28,29,41],failur:[16,17,28,29,33,36,38],fake:[9,12,16,29,41],fake_sentinel:10,fall:16,fals:[0,1,2,3,4,16],familiar:27,far:[16,22],fashion:16,fast:[13,28,29,30,34],faster:[13,16,27,28],faulti:16,fc3:28,fcl:3,fclose:[2,3,4,5,6,7,9,16],fcp:2,featur:[13,16,28,29,30,34,35,41,42],fed:28,fee:13,feed:28,feedback:[3,13,29,35],feel:[12,16,29,30],few:[2,14,16],fewer:16,ffll:3,field:[7,13,16],field_cont:6,field_nam:6,field_valu:6,field_vchar:6,file:[2,3,4,5,6,7,8,9,11,14,17,28,29,41,42],filenam:[3,16,29,41],fill:[3,5,6,16,28,29,34],find:[12,16,27,28],fine:[16,17,19],finit:[5,6,13,16,27,28,29,34,35,39],first:[8,9,10,14,16,17,24,25,28,29,35,41,42],fit:[0,16,17],fix:[13,16,19,21,22,24,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41],fixord:[16,19],flag:[2,16,18,28,29,41],flavor:[29,35],flavour:14,flex:[16,28,29,41],flexibl:[13,28],flow:[17,28],flt:3,flt_max:3,fname:[5,6],fnl:2,focus:[29,30],fold:3,follow:[2,4,7,8,16,19,20,22,23,24,26,27,28,29,30,35],foo:16,fool:16,fopen:[2,3,4,5,6,7,9,16],forc:[16,28],foremost:[29,41],forev:[16,21,24],forget:[16,22],form:[3,4,8,10,13,16,21,22,26,28,29,41],formal:[13,29,39,41],format:[2,4,5,6,7,8,16,28,29,41],forthcom:28,forward:[11,28],found:[13,16,28,29,35,41],foundat:[29,39],four:[16,29,30],fprintf:[4,5,6,7,9],frag1:5,fragment:5,frc:3,fread:[2,3,4,5,6,7,9,16],free:[2,3,4,5,6,7,9,12,13,16,28,29,30,35],free_input:[5,6],freebsd:[28,29,33],freedom:13,freeli:13,freenod:[7,13],frequent:[9,11,16],freshli:14,friend:[3,28],from:[2,3,11,12,13,14,16,19,21,22,27,28,29,30,41],front:16,fseek:[2,4,7,9],fsize:[4,7,9],fsp:2,fstream:11,ftell:[2,4,7,9],ftp:28,full:[13,16,27,28],fulli:13,fundament:28,further:[3,16,29,30,41],furthermor:16,futur:[29,35],fuzz:[14,28,29,41],fuzzer:[28,29,35],fuzzi:[28,29,41],fwrite:28,gather:[29,30],gcc:28,gdc:28,gen:28,gener:[1,3,9,10,11,12,13,15,17,18,19,22,23,24,25,26,27,28,29,30,32,34,35,41],gentoo:[7,28,29,32],get:[1,2,6,13,16,19,24,25,27,28,29,30,41],getstat:[16,28],ghijklmnopqrstuvw:[16,17],gid:4,gilbert:[13,29,40],git:28,github:[13,28],give:[13,16,20,27,28],given:[9,16,17,26,27,28],glibcxx_debug:14,global:[0,16],glu:[16,17],gmail:13,gmt:6,gnu:[14,16,28,29,41],goal:13,goldberg:16,gone:16,good:[16,22,24,29,34,41],gor1:[16,28],got:28,grade:2,grammar:[0,13,16,24,25,27,28],grammat:28,grankdir:[16,17],graph:[16,28,29,41],graphviz:16,great:28,greater:[16,23],greedi:[16,25,28,29,35],greeedi:[16,25],group:[16,27,28,29,35],grow:16,gtop:[16,28],guarante:3,guard:[3,28],guess:[29,41],guid:28,guidanc:28,h16:[5,6],h4cker1970:7,hack:[3,16,24],hand:[3,13,28,29,30,41],handl:[8,22,25,28,29,35,41],handler:[16,24],hang:[16,21,28],happen:[9,11,16,24,25],happi:13,hard:[3,16,17,29,30,41],hardcod:[16,19],harder:2,hardest:[2,3],hartmut:13,has:[1,8,10,13,14,16,17,19,21,22,24,26,27,28,29,30,33,34,35,39,40,41],haskel:[7,14,29,39],hat:28,have:[0,2,3,14,16,24,25,29,41,42],head:6,header:[12,19,28,29,32,41],header_field:6,heart:[29,30],heavyweight:[29,35],helli:13,help:[13,16,27,28,29,33,35,41],helper:14,henri:[29,41],here:[2,15,16,17,18,29,30],heurist:28,hex:[0,1,3,16],hexadecim:[3,16,17,26,28,29,41],hexdigit:[5,6],hexdump:[16,17],hier_part:5,hierarchi:27,higher:[16,25],his:[29,35,41],histor:[29,41],histori:[16,29,35],hit:[16,22,29,41],hoc:16,hold:16,home:4,hood:16,hopefulli:[29,41],host:[5,6,13,14,28],how:[4,7,8,11,16,27,28,29,34],howev:[3,9,11,16,19,21,22,24,27,29,34,35,41],hs1:6,hs2:6,hs3:6,hs4:6,htab:6,html:[5,6,28],http:[5,12,13,16,28],http_name:6,http_rfc7230:6,http_version:6,human:2,hybrid:16,i686:[14,28],ia64:28,iakovlev:[13,29,41],icc:28,iconv:2,icpcbin:28,idea:[16,29,30],ideal:16,identifi:[1,3,16],ifdef:[16,19],ifs:[16,28],ifstream:[12,16],ignor:[11,16,26,28,29,35],ill:[3,8,16,22,26,28],illog:16,illustr:28,ilovezf:[29,36],imag:16,imaginari:[7,8],immedi:[16,27],implement:[2,3,16,27,28,29,34,35,41],impli:16,implicit:[16,28],implicitli:16,imposs:[16,29,34],improv:[28,29,30,33,35,41,42],inc:28,includ:[0,1,2,3,4,5,6,7,8,9,10,11,18,19,21,22,28,29,41,42],inclus:28,inconsist:28,inconveni:16,incorpor:13,incorrect:[16,19,28,29,41],increas:28,incur:[29,35],inde:[28,29,41],indend:28,indent:16,index:[6,28],indic:[2,16,25],individu:[1,8],ineffici:[3,16,29,30],infeas:16,infinit:[16,21,25,28],info:[4,16,28],inform:[16,24,27,28],infra:28,infrastructur:[29,41],inher:[27,29,35],init:[1,16],init_input:[5,6],initi:[1,16,19,27,28],inlin:3,inner:[1,16,21],inplac:[16,28,29,30],input:[2,3,4,7,9,10,11,13,16,17,19,20,21,22,24,25,27,28,29,30,35,41],input_t:[2,3,5,6],insensit:[16,28],insert:16,insid:[16,18,26],instal:[14,28,29,42],instead:[11,13,16,19,21,28,29,30],int_max:3,integ:[0,3,12,16],integr:[16,28],intel:28,intend:[16,21,29,41],interact:16,interconnect:1,interest:[28,29,34,35],interf:[16,28],interfac:[0,13,27,28],interfer:[16,28],intermedi:[27,28],intermix:16,intern:[16,28,29,34,39],interpret:[16,23,27,28],interrel:[0,12,16],interv:28,introduc:[16,29,39,42],invalid:[16,28],invent:[13,29,34,35],invert:[16,28],invoc:[16,28],invok:[9,16],ios:11,ip_liter:[5,6],ipv4:[5,16],ipv4address:[5,6],ipv6address:[5,6],ipvfutur:[5,6],irc:[7,13],irix6:28,isn:16,iso:[6,28],issu:[13,16,28,29,34,37,41,42],iter:[16,17],its:[8,13,16,18,21,25,27,28,29,34,41],itself:[13,16,25],iucs2_t:2,iutf16_t:2,iutf32_t:2,iutf8_t:2,jcfp:[13,29,35],jean:[29,35],jeff:[29,35],jess:[29,35],john:[29,35],join:16,jon:7,joscherl:13,jul:6,julian:[29,35],jump:[1,13,16,19,21,24],just:[3,16,24,26,28],kaiser:13,keep:[6,28],kei:[5,16,17],kelli:[13,29,35],kernel:5,key2:5,keyword:[3,9],kind:[9,16,25,29,30],klode:[29,35],know:[10,16,27],known:[8,27,29,34],kuklewicz:[28,29,39],l_cc_p_9:28,label:[1,16,24,28],labelprefix:16,languag:[2,3,6,13,16,27,28,29,41],larg:[16,27,28],larger:[13,16,17],largest:[16,26],last:[6,16,19,24,28,29,41],later:[16,29,30,40],latest:13,laurikari:[29,35],layer:[29,30],lazi:[27,28],lead:[29,30,35],least:[16,24,29,34],leav:13,ledkov:[29,35],left:[3,16],leftmost:[16,28,29,35],legaci:16,len:[2,16],length:[6,10,16,17,24,28,29,35,41],less:[9,10,16,29,34],lesson:28,let:[2,16,17,19,22,24,25],letter:[2,13,16,19,21,24],lex:[0,1,3,4,5,6,7,8,9,10,16,17,18,21,22,28],lex_dec:3,lex_flt:3,lex_hex:3,lex_line4:[16,17],lex_oct:3,lex_str:3,lex_ucs2:2,lex_utf16:2,lex_utf32:[2,16],lex_utf8:[2,16],lexem:[3,16,21,26],lexer:[1,10,12,13,16,17,19,21,22,24,27,28,29,32,34,41],lexic:0,lfdp:8,lib:[14,28,29,41],librari:[14,16,28,29,41],libre2c:[14,28,29,41],libtool:14,licens:28,lightweight:13,like:[2,16,18,19,21,22,24,27,28,29,35,41],lim:[3,5,6,9,10,16],limit:[0,1,3,8,16,29,41],line4:[16,17],line:[0,2,4,7,8,11,16,18,25,28,29,30,41],linear:[27,29,35],link:28,linux:[8,13,28],list:[1,7,13,16,28],liter:[3,5,16,28,29,41],littl:28,live:16,local:[16,18,28],locat:[14,16,28,29,41],logic:[29,35],long_max:3,longer:[16,29,41],longerst:[16,25],longest:16,look:[3,16,17,18,19,24,28,29,41,42],lookahead:[5,6,13,16,28,29,35,39],loop:[4,5,6,7,8,9,11,16,21,24,28],lop:[28,29,41],lope:13,lopla:[13,28],lot:[13,16,29,34,35,41],low:1,lower:[16,23],lowercas:[16,21],lowest:[16,24],ls32:[5,6],luke:[29,40],mac:[29,36,38],maciel:[29,35],macintel:28,maco:28,macppc:28,macro:[3,16],made:[28,29,40],mai:[0,2,3,8,13,16,24,25,27,29,30,35,41],mail:13,main:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,17,18,19,21,22,27,29,30,39],maintain:[13,28],major:16,make:[3,13,14,16,20,21,23,26,28,29,30,35,41],make_pair:8,makefil:28,malloc:[4,5,6,7,9,16],man:28,manag:[29,35],mandriva:28,mani:[3,13,16,20,25,27,28,29,35,41],manipul:16,manpag:[28,29,35],mant_frac:3,mant_int:3,manual:[5,13,19,28,29,34,35,41,42],map:[2,16,17,19,24],mar:[3,5,6,9,10,11,28],mark:[16,19],marker:16,marku:13,mask:16,mast:[13,29,35],master:28,match:[13,16,17,20,21,22,24,25,27,28,29,39,41],math:16,matter:[3,16,19,24],max:[3,4,5,6,16,18,28],maxim:16,maximum:16,maxnmatch:[16,28],mcm:3,mean:[16,24,26,27,29,34],meaningless:[16,26],meanwhil:[29,30],measur:[16,24],mechan:[9,10,11,16],mechnism:11,membership:27,memcpi:[6,16],memmov:[3,5,6,16],memoiz:27,memori:[11,14,16,17,22,25,28],memset:[3,5,6,16],mention:[29,35],merg:[1,16,28],mess:[29,34],messag:[2,6,12,16,28,29,35,41],message_head:6,method:[6,9,10,11,16,22,29,41],metzger:[29,35,40],microsoft:28,mictosoft:28,middl:[10,16,22],midrul:[],might:[11,14,16,17,21,27,29,34,41],migrat:28,mike:[13,29,40],mileston:[29,35],mimin:[29,34],min:[16,28],ming:14,mingw32:28,mingw:[14,28],minim:[16,24,28,29,34],minimum:[16,28],minor:[13,16,28,29,30,36,37,38,40,42],mip:28,mipspro:28,mirror:28,miscellan:[16,26],miss:[13,16,17,22,28,29,32],mistak:16,mistakenli:[16,26],mitek:7,mitrofan:7,mix:[16,28,29,41],mkdir:14,mmmmpp:16,mobil:[29,41],mode:[2,16,28,29,41],model:[13,16,28,29,35],moder:16,modif:28,modifi:[13,14],mogenet:13,moor:[16,28,29,34],more:[3,9,10,11,13,14,17,22,24,26,27,28,29,30,35,41],moreov:[29,30],most:[13,16,22,28,29,33,35,39,41],mostli:[29,41],move:[11,16,27,28,29,41],mozilla:6,mplate:3,msvc:[16,28,29,41],mtag:[6,7,16,28],mtag_t:[6,7],mtagpool_clear:6,mtagpool_fre:6,mtagpool_init:6,mtagpool_next:6,mtagpool_t:[6,7],mtagtre:16,mtp:6,much:[2,3,13,16,20,24,27,28],multi:[16,28],multibyt:16,multilin:[16,26,28],multipl:[1,2,4,7,12,13,16,27,28,29,30,33,35,41],multiple_block:0,must:[3,16,21,22,24,26,27,28,29,34,41],mutabl:3,naiv:16,nake:[1,2,3,5,16,19,28],name:[1,5,7,16,18,19,28,29,41],namespac:3,narrow:27,nativ:28,natur:[2,16],naumov:[29,41],nearest:[29,35],necessari:[14,16,22,27],necessarili:[29,41],nee:3,need:[2,3,5,6,8,14,16,26,27,28,29,30,35,41,42],need_more_input:16,negat:[16,20,28],neither:13,nerd:13,nest:[16,28],net:[13,28],never:[16,24,25],newli:[28,29,41],newlin:[16,26,28],next:[1,6,9,16,28],nextlabel:[16,28],nfa:[13,16,27,28,29,35,41],nfst:27,nick:7,nicknam:7,ninja:13,node:16,non:[7,11,16,21,28],nondetermin:16,nondeterminisitc:27,nondeterminist:27,none:[16,20,28],nontrivi:3,noption:8,nor:13,normal:[1,2,16,18,24,25,29,41],not_eq:3,notabl:13,notat:[27,28],note:[0,1,2,3,10,11,16,20,21,22,24,28,41],noth:[16,17,19],notic:16,notion:16,novel:27,now:[16,17,22,24,25,28,29,30,34,41,42],nuffer:13,nullabl:[16,21],nullifi:11,num:16,number:[2,3,8,16,17,18,19,24,28,29,35,41],numer:[2,3,13,16,29,35],nunknown:8,nuno:13,obei:2,obs_fold:6,obs_text:6,obsolet:[29,34],obtain:[13,16],obviou:27,occasion:14,occur:[16,22,28],occurr:16,ochar:8,oct:[0,1,3,16],octal:[3,16,26,28],odfa:16,oexampl:[16,22],off:[16,18,28,29,41],offset:16,ofstream:11,often:[13,16,27],okui:[28,29,39],old:[28,29,39],older:[13,14,16,19,23],oleksii:[13,29,33],omit:[2,16,28],onc:[9,11,16],one:[1,2,3,7,8,10,16,17,21,24,27,28,29,34,35,41],ones:28,onli:[1,3,9,11,14,16,18,21,26,27,28,29,30,34,35,41],onlin:[29,35],ooo:[16,26],open:[3,7,9,13,28,29,41],oper:[3,16,20,28,29,35,41],operand:[28,29,41],opt:8,optim:[13,16,28],option:[1,2,12,14,18,19,20,21,26,28,29,30,34,35,39,40,41],options_t:8,or_eq:3,order:[27,28,29,41],ordinari:[16,24,27],org:[5,13,28],origin:[13,16,28,29,35],origin_form:6,ose:3,other:[2,3,13,14,16,19,24,25,26,27,28,29,30,35,41],otherwis:[16,29,42],our:[4,7,8,16,17,27],out:[2,11,14,16,28,29,30,35],out_of_rang:28,out_t:2,outer:[16,21],outlin:[29,39],output:[16,17,18,27,28,29,30,41],outstand:[29,35],over:[16,21,27,29,35],overal:[29,30],overflow:3,overflown:3,overhead:[3,13,16,24,29,30,35],overlap:16,overli:[29,35],overlook:16,overrid:[0,9,11,16],overrun:28,overview:13,overwrit:[10,28],own:[2,8,13,16,29,41],ows:6,pack:[16,17,28],packag:[13,28],pad:[9,10,11,29,41],page:[28,29,39],paid:[29,34],pair:8,panic:[5,6],paper:[5,6,16,28,29,35,39,41],paramet:[16,18,28],pared:[29,35],parent:16,parenthes:[16,27],pars:[0,3,4,5,6,7,8,12,13,16,27,28,29,30,35,41],parser:[3,5,6,8,14,16,28,29,41],part:[2,3,16,22,27,28,29,30,41],partial:[2,16,28,29,35],particular:[13,16,27,28,29,34,35,41],pass:[4,5,16,25,28,29,30,35,41],passwd:[12,16],password:4,past:[2,16,24,25,29,40],patch:[16,28,29,35],path:[5,8,16,17,24,27,28],path_abempti:[5,6],path_absolut:[5,6],path_empti:[5,6],path_rootless:[5,6],patienc:[29,35],pattern:[12,16,24],paulo:[13,29,35],pchar:[5,6,8],pcln:2,pcom:2,pct_encod:[5,6],pdot:2,pdsh:2,pedant:28,peek:[10,11],peform:16,peopl:[16,26,28,29,35,41],per:[7,9,11,16,17,28],perfect:[16,21],perfectli:16,perform:[9,10,16,27,28,29,35,41],period:28,perri:[29,35,40],persist:16,peter:[13,28,29,35],petr:[13,29,35],phase:[29,30],philippschaef:[29,35],php:[13,28],phrase:16,phyp:2,pick:0,pictur:[15,16],pie:28,piec:[16,24,28],place:16,placehold:16,plain:[2,16],platform:[28,29,35],plattform:28,playground:[13,29,41],pleas:[13,28],pmt:6,png:[15,16,17],point:[2,3,15,16,24,28,29,41],pointer:[16,28],polici:[16,24,28],port:[5,6,28],portabl:[12,16,28,29,41],portag:4,posiiton:16,posit:[3,16,17,21,29,39],posix:[13,16,28,29,35,39,41],possibl:[8,10,11,14,16,20,24,27,28,29,34,41,42],power:[16,22,27],ppc:28,pqst:2,practic:16,prece:28,preced:[16,25,28,29,41],precis:16,precompil:[14,28],precondit:16,pred:[6,7,16],predefin:[16,29,41],prefix:[1,14,16,17,28],prematur:16,preprocessor:3,prereleas:28,present:[16,18,28],pretend:[16,17],prevent:[16,21],previou:[16,28],primari:27,primit:[10,16,29,35],principl:9,print:[16,28,29,41],print_channel:7,print_head:6,printf:[0,1,2,3,4,5,6,7,8,9,10,16,18,19,21],prior:[16,29,34],prioriti:[1,16,24,25],privat:[3,28],probabl:[16,28],problem:[9,16,25,27,28,29,30,33,35],proce:[3,16],procedur:[27,29,34],process:[16,28,29,30,34],produc:[16,27,28],program:[3,9,11,13,17,18,19,21,28,29,30],progress:14,project:[13,14,16,28,29,41],promit:16,proper:[29,39],properti:[29,34],protect:3,protocol:[16,28],provid:[13,14,16,20,29,41],prt:2,psem:2,pub:[5,28],pull:[16,28],punctuat:[2,3],pure:[16,26],purpos:[29,30],push:[16,28],push_back:[7,8,16],put:[11,14],pxcl:2,quantifi:28,queri:[5,6],question:13,quick:[29,31],quickcheck:14,quit:[2,16,24,27,28,29,34],quot:[8,16,22,26],radzik:16,rais:16,random:[29,35],rang:[20,26,28],rare:[13,29,41],rather:[1,2,3,16,29,41],raw:[16,28],rcs:28,re2:[29,41],re2c:[0,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,24,25,26,27,29,30,34,35,41,42],re2c_path:14,reach:[10,16,22],read:[11,12,16,22,24,25,27,28],read_fil:[16,17],readi:2,readm:28,readsom:28,reagrdless:16,real:[3,10,16,29,30],realli:[29,30],rearrang:[29,41],reason:[2,16,20,23,24,25,29,30],reason_phras:6,rebalanc:[29,30],rebuild:[14,28],receiv:13,recent:16,recogn:[3,16,26,28],recognit:[29,35],recommend:[16,24],reconstruct:27,record:[12,16,27,29,35],recurs:7,red:28,redefin:9,rediscov:[29,40],reduc:[16,28,29,35],redund:[28,29,35],ree:16,refer:[16,28],reg_nam:[5,6],regardless:[16,24],regener:[29,30],regexp:16,regist:[3,29,35],regress:28,regular:[14,27,28,29,35,39,41],regularli:14,reimplement:[16,28],reinterpret_cast:3,rel:[16,29,30,35],relabel:[16,29,34],relat:[0,16,27],releas:[13,14,28],reli:[10,11,16,19],remain:[16,19,24,28,29,34],rememb:27,remov:[16,25,28],renam:[28,29,41],rend:28,render:[15,16],repackag:28,repeat:[29,30],repetit:16,replac:[16,17,28,29,39,41],repli:16,repo:28,report:[3,8,12,13,16,22,23,24,25,26,28,29,31,32,33,34,35,36,37,38,40,42],repositori:[13,14,28],repres:[2,16,24],represent:16,request:28,request_lin:6,request_target:6,requir:[3,9,10,11,16,27,28,29,35,41],requr:13,research:[13,28,29,41],reset:[16,29,42],resolv:[16,28,29,41],respect:[28,29,34,35],respond:16,respons:[11,13,28],restor:16,restrict:16,result:[11,13,16,17,20,22,25,27,28,29,30,34,35],resum:[3,16,21],rethan:[13,29,35],retu:3,reus:[2,16,28,29,41],reusabl:[29,41],reveal:[29,41],reversed_condition_ord:[16,19],rework:28,rexx:28,rfc:[12,16],rid:28,right:[2,3,16,21],roll:16,rollback:[29,41],root:[4,16],ross:[13,29,35],rough:28,roughli:16,routin:16,rp1:6,rp2:6,rst2man:14,rst:28,rsync:5,rts:28,rui:[28,29,35],rule:[1,2,5,17,18,21,22,26,27,28,29,41],run:[0,1,2,3,4,5,6,7,8,9,10,14,16,17,18,19,21,24,27,28,29,33,34,41],run_test:[14,28],ryan:[13,29,35,38],rygoravich:7,s32:16,s_to_n32_unsaf:28,sacr:[16,24],safe:16,sai:[16,21,24],said:27,sake:[2,16,17],salo:[29,41],same:[0,2,3,9,16,19,21,25,26,27,29,34],samuel006:[29,35],sat:28,satisfi:16,satoshi:[29,39],savabl:28,save:[16,28],scalar:16,scan:28,scanner:[13,16,28,29,35],scc:16,scheme:[5,6],scm:3,scope:0,scratch:[29,30],script:[14,28,29,31],search:[9,16],second:[8,9,16,24,25,29,42],section:[16,28,29,35],secur:16,sed:[16,17,28],see:[13,16,17,21,24,25,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],seek_end:[2,4,7,9],seek_set:[2,4,7,9],seekg:11,seem:[29,35],seemingli:27,seen:16,segfault:28,segment:16,segv:28,segvault:28,self:[16,17,29,34,35],semant:[16,18,24,29,35],semicolon:16,send:[13,16],sens:[16,20,21,26,27],sensit:[16,19,28],sentinel:[9,12,22,29,41],sentinel_in_midrul:[],sentinel_in_midrule2:[],sep:4,separ:[0,8,14,16,29,41],sequenc:[16,17,19,24,26,27,29,41],sequnc:16,sergei:[13,29,31,33,35,40,41],serghei:[13,29,41],seri:[13,29,35],seriou:[29,39],serv:[13,16,28],server:6,set:[1,16,22,27,28,29,35,42],setup:28,sever:[16,28],sfx:3,sgi:28,shadow:[16,25],share:[16,17,29,42],shift:16,shmidt:[29,38],shortcom:[29,41],shortcut:16,shorter:16,shortest:[16,28],should:[2,10,12,14,16,22,24,25,26,28,29,35],shouldn:16,show:[4,7,8,11,16,18,24],show_bug:28,shown:10,side:[29,34],sign:[3,16],signal:16,signatur:9,signific:[29,34,35],significantli:[16,29,30],silenc:[16,21],silent:[16,23],similar:[1,27,28,29,30],similarli:[16,25],simpl:[0,2,4,7,16,17,24,27,28,29,30,34,35,41],simpler:[3,16],simplest:[14,16,29,41],simpli:[16,24,29,34],simplic:[2,16,29,41],simplif:[29,30],simplifi:[16,28,29,30],simul:[3,27],simultan:27,sinc:[9,13,16,27],singl:[0,1,2,16,22,24,25,26,28,29,35],sirzooro:[29,35],situat:[16,29,41],size:[3,5,6,7,16,28],size_t:[2,3,4,5,6,7,9,10,16],sizeof:[2,3,6],skeleton:[14,17,28,29,30,33,34,35],skimpi:28,skip:[16,28],skocik:[13,29,35],skvadrik:[13,28],slightest:3,slightli:[16,28,29,41],slow:28,slowdown:16,slower:[16,29,41],small:[14,16,28,29,35],smaller:13,smallest:16,smith:[7,29,35],socket:16,solari:28,solv:[16,27],some:[2,3,14,16,19,20,21,23,24,25,27,28,29,30,34,35,37,40,41,42],someon:13,somestr:10,someth:[16,26,28,29,41],sometim:[16,25,26,27,28],somewhat:[16,29,41],somewher:[13,28],soon:[16,29,30,35],sophist:27,sort:28,sourc:[13,16,28,29,41],sourceforg:[13,28],space:[16,28,29,35],spamassassin:13,speak:[16,29,34],spec:28,special:[2,14,16,17,19,26,27,28,29,35,41],specif:[16,17,28],specifi:[16,22,24,28,29,41],speed:13,speedup:[29,34],spell:[27,29,35],spent:[29,35],sphinx:14,spirit:2,spring:[29,30],spuriou:14,src:[8,28],ssh:5,ssp:28,st1:6,st2:6,stabl:28,stag:[4,5,6,7,8,16,28],stage:[16,28],stand:16,standalon:[1,16,28,29,35],standard:[3,11,16,28,29,41,42],standpoint:[29,41],start:[1,3,9,12,18,19,27,28,29,30,35],start_label:28,start_lin:6,startlabel:[16,28],stat:[3,16,28],state:[1,13,24,27,28,29,34],statement:[16,17,19,28,29,30],static_cast:3,statist:[16,28,29,30],statu:[4,7,16],status_cod:6,status_lin:6,std:[7,8,12,14,16,28],stderr:[4,5,6,7,9],stdin:[11,16],stdint:16,stdio:[0,1,2,3,4,5,6,7,8,9,10,16,18,19,21],stdlib:[4,5,6,7,9,16,29,42],stdout:[14,16],step:[29,34],stick:16,still:[3,28,29,35],stl:[11,16],stlport4:28,stop:[16,21,24,25],storabl:28,store:16,str:[2,8,16],straightforward:16,strang:[16,23,27,29,35],strategi:[29,30],stream:[11,16],streampo:11,strictli:27,string:[3,5,6,8,10,12,17,20,22,24,26,27,28,29,30,35,41],strlen:[10,16],strongli:[9,11,16],struct:[2,3,5,6,8,12,16,28,29,41],structur:[7,13,27,28],stub:[29,30],studi:[29,35],studio:28,stuff:[29,34],style:[11,16,28,29,41],sub:[1,29,41],sub_delim:[5,6],subdirectori:[14,16],subexpress:16,subject:[29,35],submatch:[13,28,29,35,39,41],subscrib:13,subsequ:16,substitut:16,substr:27,subsystem:[28,29,41],subtarget:28,subtl:[16,24],success:[16,28,29,41],successful:[],successfulli:[16,29,41],sucess:[],suffic:16,suffici:16,suffix:[8,16],sugar:[1,29,35],suggest:[16,19,22,29,30,31,35],suit:[14,29,34],suitabl:[16,29,35],summar:8,sun:28,suppli:[16,28],support:[2,13,14,28,29,35,41],suppos:[16,24],suppress:[9,11,16,28],sure:[3,13,16,24,29,41],surprisingli:[29,35],surrog:[16,24],surround:16,surviv:16,suse:28,suzuki:[28,29,39],swanson:28,swap:[16,23],symbol:[2,21,22,24,26,27,28,29,35,41],sync:28,synchron:[29,35],syntact:[1,16,27,29,35],syntax:[5,6,18,28],syntax_error:16,system:[13,16,28,29,30,32,35],tabl:[13,16,19,28,29,34],tag:[4,5,6,7,8,12,13,16,17,27,28,29,35,39],tagopt:[16,28],take:[3,9,13,14,16,17,25,27],taken:[13,16,29,41],talk:16,tape:27,tar:28,taran:[13,29,33],tarbal:[13,14,28],target:28,taro:[29,39],task:[0,16],tast:3,tchar:6,tdfa:[16,28],techniqu:[16,29,34],tell:[1,16,17,24],tellg:11,templat:[0,1,2,3,13,16],temporari:[29,41],ten:[29,35],term:[16,24,27],termin:[10,16,21,22,28],terpstra:[29,41,42],test:[16,27,28,29,31,34,35,40,41],testsuit:[29,34],text:[6,16,24,28],than:[1,10,13,16,23,27,28,29,35,41],thank:[29,31,33,35,36,37,38,40,41,42],thei:[0,1,2,3,12,13,14,16,17,26,27,28,29,30,35],them:[3,8,11,13,14,16,19,24,25,28,29,30,35,41],theoret:[29,39],therefor:[16,20,27],thi:[0,1,2,3,4,5,6,7,8,9,10,11,13,14,16,17,18,19,20,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,39,40,41,42],thing:[16,22,28,29,30],think:[16,26,29,30],those:[2,16,18],though:[3,10,16,29,35],thread:28,three:[16,17],threshold:16,through:[16,24],thu:[3,6,16],tidi:[29,35],tied:28,tildeslash:28,tim:[13,29,35],time:[10,14,16,27,28,29,30,33,35,41],tmp:[4,28],tnfa:28,togeth:[16,17,28,29,35],toggl:[16,19],tok:[3,5,6,9,10,16],token:16,too:[16,28,29,35],tool:[16,28,29,30,34,41],top:[16,29,35],topolog:16,total:[29,35,39],toupper:2,toward:2,tpng:[15,16,17],track:[16,27],tracker:13,tradit:[13,27,29,35],trail:[16,28],transduc:27,transfer:16,transform:[16,27,29,41],transit:[1,16,19,27,29,35,39],translat:[1,16,28,29,41],transmit:16,transpar:28,travi:[28,29,41],treat:[16,24,26],tree:[14,16],tri:[16,17,21,22,27,29,41,42],trick:[29,34],tricki:14,trigger:[16,28],triplet:[16,17],trivial:[3,16],trofimovich:[13,27,29,31,33,35,40,41],troubl:[29,40],trull:[29,35],tunnel:[16,29,34],turn:[16,18,22,27,28,29,35],tutori:28,tw0:16,tweak:[16,28],twice:[3,16,28,29,34,41],two:[16,17,19,25,28,29,34,35,41],txt:[2,16],type:[1,2,6,16,19,26,27,28,29,41],typedef:[2,3,5,6,7,8,16],typeid:3,typenam:[2,3],typic:28,typo:[8,16,28],u2200x:[29,41],u2203i:[29,41],u2800:2,u2801:2,u2802:2,u2803:2,u2804:2,u2805:2,u2806:2,u2807:2,u2809:2,u280:2,u280a:2,u280b:2,u280d:2,u280f:2,u2811:2,u2812:2,u2813:2,u2814:2,u2815:2,u2816:2,u2817:2,u2819:2,u281:2,u281a:2,u281b:2,u281d:2,u281f:2,u2820:2,u2824:2,u2825:2,u2826:2,u2827:2,u282d:2,u2830:2,u2832:2,u2835:2,u283a:2,u283c:2,u283d:2,ubiquit:[29,35],ucs2:[2,16],uhhhh:[16,26],uhhhhhhhh:[16,26],uid:4,uint32_max:28,uint32_t:16,uint8_t:16,uint:28,uint_max:3,ulong_max:[0,1,3],ulya:[13,27],unaccept:16,unchang:13,uncondition:[],uncontract:2,undefin:[16,17,24],under:[14,16,28],underestim:28,underli:[13,16,29,34,35],underscor:[9,16,28],understand:[13,16,29,41],unescap:[3,28],unexpect:16,unexpected_eof:16,unexpectedli:16,unfold:16,unicod:[2,16,24,28,29,41],unicode_categori:[28,29,41],unintent:16,union:3,uniqu:[1,16,29,34],unit:[2,14,16,24,25,28,29,40,41],unix:[7,11,28],unknown:[8,16],unknown_t:8,unless:[16,24,28],unlik:[3,27,28],unnecessari:16,unreach:[16,25,28],unrecogn:8,unreserv:[5,6],unseen:3,unsign:[0,1,2,3,6,16,28],unsurprisingli:3,untermin:28,until:[16,25,29,30,41],unus:[16,18,28],unusu:13,upcom:28,updat:[13,14,16,28,29,30,41],upper:[16,23],uri:[12,16],uri_rfc3986:5,usabl:28,usag:3,usd:1,use:[0,1,2,3,9,10,11,13,14,16,19,24,28,29,34,35,41],used:[3,5,6,9,13,14,16,17,21,22,24,27,28,29,30,34,35,39,41],useful:[16,28,29,34,35,41],useless:[16,26],user:[4,5,6,7,13,14,28,29,35,39,41],userinfo:[5,6],uses:[1,5,6,7,9,11,14,16,19,29,30,34],using:[3,11,13,16,17,19,22,24,27,28,29,35,41],usr:[8,29,42],usual:[9,10,11,16,27,29,30,34,35,39,41],ut32:16,utf16:[2,16],utf16l:2,utf32:[2,16],utf32l:2,utf8:[2,16,28,29,41],utf8_ani:[15,16],utf:[2,6,15,16,24,28],util:10,uwaterloo:[13,28],val2:5,val:5,valgrind:[14,28],valid:[3,16,21,24,28,29,34],valu:[16,28,29,42],variabl:[16,17,18,24,28,29,41],variant:[29,41],variou:[14,16,18,29,30],vchar:6,vector:[7,8,16,28],verbatim:16,verbo:8,verbos:[8,16,28,29,41],veri:[3,13,16,17,27,28,29,30,34,35,41],verif:[29,30,34],verifi:[16,29,30,34],vernum:[16,28,29,40],versa:27,versatil:[13,29,35],version:[14,16,23,28,29,35],via:[16,29,39],vice:27,vill:[29,35],viola:[16,17],violat:[16,22,25,28],virtual:3,visibl:[16,29,39,41],visual:28,volatil:3,volunt:13,vtest:[14,28],w64:[14,28],w_cc_c_9:28,wai:[9,11,13,16,20,27,28,29,34,41],wait:16,wake:[13,29,41],wall:28,want:[14,16,23,24,27],warm:[29,30],warn:[17,18,19,20,21,22,23,24,25,26,28,29,30],warranti:13,watch:14,wchar_t:3,wcondit:28,wconvers:28,weard:28,web:28,websit:[13,14,28,29,30,41],weffc:28,welcom:13,well:[2,10,13,16,21,22,28,29,34],wempti:28,were:[28,29,33,34],werror:[16,22,23,28],weslei:[29,41,42],weveryth:28,wextra:28,wformat:28,what:[16,19,23,24,27,28,29,35,41],whatev:13,whatsoev:13,when:[3,10,16,17,21,22,23,24,26,28,29,35,41,42],whenev:16,where:[3,8,16,17,22,26,29,41,42],wherea:16,whether:16,which:[2,3,10,11,13,16,18,19,23,25,26,27,28,29,30,41],whitespac:[3,16,28],who:[29,31,41],whole:[16,29,30],why:[16,19,27],wide:[16,28,29,41],width:[16,24],wiki:[29,39],wikipedia:28,wild:13,wildcard:[16,28],william:28,win32:28,window:[11,14,28,29,33,41],wine:[14,28],wippler:[29,35],within:[1,3,16,24],without:[3,16,18,20,24,28,29,41],wmatch:28,wno:[16,21,28],wnondeterminist:[16,28],won:[16,21],word:[16,27,28],work:[16,19,22,28,29,30,35,39,41],world:[3,16,24,27],wors:[16,22,29,41],worst:27,worthwil:27,would:[3,11,13,16,24,29,34,35,41],wredund:28,write:[16,27,28,29,41],written:[3,12,13,14,16,28],wrong:[16,22,28],wrote:[29,35],wsentinel:[],wsign:28,wsp:[3,7,8],wsuggest:28,wswap:28,wtest:[14,28],wundefin:[17,28],wunreach:28,wuseless:28,www:[6,28],x00:[0,1,2,3,4,5,6,7,8,10,16,20,21,22,25],x1f:6,x20:[2,3],x25:3,x2e:3,x2f:3,x30:[5,6],x31:[5,6],x34:[5,6],x35:[5,6],x39:[5,6],x3a:3,x3c:3,x3e:3,x5c:3,x5d:[16,26],x60:[16,24],x61:3,x62:[3,16,24],x63:3,x64:28,x65:3,x66:3,x67:3,x69:3,x6c:3,x6d:3,x6e:3,x6f:3,x70:3,x72:3,x73:3,x74:3,x75:3,x78:3,x7e:6,x7f:[16,24],x80:[6,16,24],x86:28,x8f:[16,24],x90:[16,24],x9f:[16,24],xa0:[16,24],xbf:[16,24],xc0:[16,24],xc1:[16,24],xc2:[16,24],xd800:[16,24],xdbff:[16,24],xdc00:[16,24],xdf:[16,24],xdfff:[16,24],xe000:[16,24],xe0:[16,24],xe1:[16,24],xef:[16,24],xf0:[16,24],xf1:[16,24],xf3:[16,24],xf4:[16,24],xf5:[16,24],xff:[6,16,20,24,25],xffff:[16,24],xhh:[16,26],xhhhh:[16,26],xhtml:6,xml:6,xor:3,xor_eq:3,xyz:16,yacc:28,yasm:13,ych:28,ycursor:16,year:[28,29,39,41],yes:[8,27],yet:[3,27,29,35,38],ymtagp:16,you:[13,14,16,19,23,24,28,29,33,35,42],young:[13,16,24,28],your:[16,17,24,29,33],yy0:[16,28],yy1:28,yy2:[16,18,24,28],yy3:[16,24,28],yy4:[16,18,24,28],yy5:28,yy6:[16,18,28],yy7:28,yyaccept:[16,28],yyaccpt:28,yybackup:[9,10,11,16],yybackupctx:16,yybm:[16,28],yyc:[1,16],yyc_:1,yyc_a:[16,19],yyc_b:[16,19],yyc_bin:1,yyc_dec:1,yyc_hex:1,yyc_l:2,yyc_n:2,yyc_nam:16,yyc_oct:1,yyca:[16,19],yycb:[16,19],yych:[11,16,18,24,28],yycinit:1,yycl:2,yycnam:16,yycondtyp:[16,28],yyctabl:[16,19],yyctxmark:[0,1,16,28],yyctyp:[0,1,2,3,4,5,6,7,8,9,10,11,16,18,19,21,22,24,28],yycursor:[0,1,2,3,4,5,6,7,8,16,18,19,21,22,24,28],yydebug:[16,28],yyfil:[0,1,2,3,4,5,6,7,8,9,10,11,18,19,21,22,24,25,28],yyfilllabel:16,yygetcondit:[1,2,16,19],yygetst:[16,28],yylessthan:[9,11,16],yylimit:[3,5,6,9,10,16,24,28],yymark:[0,1,2,3,4,5,6,7,8,16,18,28],yymaxfil:[3,5,6,9,10,16,18,28],yymaxnmatch:[16,28],yymtagn:[6,7,16,28],yymtagp:[6,7,16,28],yynext:[16,28],yynmatch:[16,28],yypeek:[9,10,11,16,28],yypmatch:[16,28],yyrestor:[9,10,11,16],yyrestorectx:16,yyrestorerag:16,yyrestoretag:[16,28],yysetcondit:[1,2,16,19],yysetst:[16,28],yyskip:[9,10,11,16],yystabl:16,yystagn:[16,28],yystagp:[16,28],yyt1:16,yyt2:16,yyt:16,yytarget:16,yyyi:8,z_0:3,zakirov:[29,35],zero:[16,17,29,41],zip:28,ziris85:[29,37]},titles:["Multiple blocks","Conditions","Braille patterns","C++98 lexer","/etc/passwd","URI (RFC-3986)","HTTP (RFC-7230)","Records & structs","Options & arguments","Strings in binaries","Fake sentinel","std::ifstream","<no title>","re2c","Build instructions","<no title>","User manual","<no title>","A basic example","[-Wcondition-order]","[-Wempty-character-class]","[-Wmatch-empty-string]","[-Wsentinel-in-midrule]","[-Wswapped-range]","[-Wundefined-control-flow]","[-Wunreachable-rules]","[-Wuseless-escape]","Fast submatch extraction","Changelog","Release notes","Release 0.15","Release 0.15.1","Release 0.15.2","Release 0.15.3","Release 0.16","Release 1.0","Release 1.0.1","Release 1.0.2","Release 1.0.3","Release 1.1","Release 1.1.1","Release 1.2","Release 1.2.1"],titleterms:{"10x":28,"11x":28,"12x":28,"13x":28,"14x":28,"15x":28,"16x":28,"class":[16,20],"default":[16,24],The:[16,24,27],Using:16,adopt:28,api:16,argument:8,author:13,basic:[16,18],binari:9,block:[0,16],bound:16,braill:2,buffer:16,bug:13,build:14,changelog:28,charact:[16,20],check:16,condit:[1,16],configur:16,context:27,control:[16,24],danger:27,debug:16,depend:14,dfa:27,difficulti:27,direct:16,download:13,empti:[16,21],encod:16,eof:16,escap:[16,26],etc:4,exampl:[16,18],express:16,extract:[16,27],fake:10,fast:27,file:16,flow:[16,24],gener:16,handl:16,header:16,http:6,ifstream:11,includ:16,instruct:14,interfac:16,introduct:27,lexer:3,licens:13,manual:16,midrul:[16,22],more:16,multipl:0,note:29,old:[16,24],option:[8,16],order:[16,19],pad:16,paper:13,passwd:4,patch:13,pattern:2,program:16,rang:[16,23],re2c:[13,28],recognit:27,record:7,refil:16,regular:16,releas:[29,30,31,32,33,34,35,36,37,38,39,40,41,42],reusabl:16,rfc:[5,6],rule:[16,24,25],sentinel:[10,16],skeleton:16,start:16,state:16,std:11,storabl:16,string:[9,16,21],struct:7,submatch:[16,27],support:16,symbol:16,syntax:16,test:14,trail:27,uri:5,user:16,version:13,visual:16,warn:16,wcondit:[16,19],wempti:[16,20],wmatch:[16,21],wsentinel:[16,22],wswap:[16,23],wundefin:[16,24],wunreach:[16,25],wuseless:[16,26],yyfil:16}})
\ No newline at end of file