MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //usr/lib/python2.4/site-packages/dns/tokenizer.pyc
mò
ÚOc@sýdZdkZdkZdkZdkZdkZhde<de<de<de<de<de<de<Zhde<Z	d	Z
d
ZdZdZ
d
ZdZdZdeiifd„ƒYZdefd„ƒYZdefd„ƒYZdS(sTokenize DNS master file formatNt s	s
t;t(t)t"iiiiiiitUngetBufferFullcBstZdZRS(sRRaised when an attempt is made to unget a token when the unget
    buffer is full.(t__name__t
__module__t__doc__(((t1/usr/lib/python2.4/site-packages/dns/tokenizer.pyR,stTokencBs¤tZdZded„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„Zd„Zd„Zd„ZRS(sêA DNS master file format token.

    @ivar ttype: The token type
    @type ttype: int
    @ivar value: The token value
    @type value: string
    @ivar has_escape: Does the token value contain escapes?
    @type has_escape: bool
    tcCs||_||_||_dS(sInitialize a token instance.

        @param ttype: The token type
        @type ttype: int
        @param value: The token value
        @type value: string
        @param has_escape: Does the token value contain escapes?
        @type has_escape: bool
        N(tttypetselftvaluet
has_escape(R
RRR((R	t__init__<s			cCs
|itjS(N(R
RtEOF(R
((R	tis_eofJscCs
|itjS(N(R
RtEOL(R
((R	tis_eolMscCs
|itjS(N(R
Rt
WHITESPACE(R
((R	t
is_whitespacePscCs
|itjS(N(R
Rt
IDENTIFIER(R
((R	t
is_identifierSscCs
|itjS(N(R
Rt
QUOTED_STRING(R
((R	tis_quoted_stringVscCs
|itjS(N(R
RtCOMMENT(R
((R	t
is_commentYscCs
|itjS(N(R
Rt	DELIMITER(R
((R	tis_delimiter\scCs|itjp
|itjS(N(R
RRR(R
((R	t
is_eol_or_eof_scCs;t|tƒptSn|i|ijo|i|ijS(N(t
isinstancetotherR
tFalseR
RR(R
R!((R	t__eq__bscCs;t|tƒptSn|i|ijp|i|ijS(N(R R!R
tTrueR
RR(R
R!((R	t__ne__hscCsd|i|ifS(Ns%d "%s"(R
RR(R
((R	t__str__nscCs‰|ip|Snd}t|iƒ}d}xI||jo;|i|}|d7}|djo	||joti	i
‚n|i|}|d7}|iƒoÄ||joti	i
‚n|i|}|d7}||joti	i
‚n|i|}|d7}|iƒo
|iƒpti	i‚ntt|ƒdt|ƒdt|ƒƒ}qjn||7}q0Wt|i|ƒS(NRiis\idi
(R
Rt	unescapedtlenRtltitctdnst	exceptiont
UnexpectedEndtisdigittc2tc3tSyntaxErrortchrtintR
R(R
R+R*R'R)R1R0((R	tunescapeqs8














6cCsdS(Ni((R
((R	t__len__scCst|i|ifƒS(N(titerR
RR(R
((R	t__iter__“scCs:|djo|iSn|djo|iSnt‚dS(Nii(R*R
RRt
IndexError(R
R*((R	t__getitem__–s


(RRRR"RRRRRRRRRR#R%R&R5R6R8R:(((R	R
1s"															t	TokenizercBsÈtZdZeied„Zd„Zd„Zd„Z	d„Z
eed„Zd„Z
d„Zd	„Zd
„Zd„Zd„Zd
„Zed„Zed„Zed„Zd„Zd„ZRS(s´A DNS master file format tokenizer.

    A token is a (type, value) tuple, where I{type} is an int, and
    I{value} is a string.  The valid types are EOF, EOL, WHITESPACE,
    IDENTIFIER, QUOTED_STRING, COMMENT, and DELIMITER.

    @ivar file: The file to tokenize
    @type file: file
    @ivar ungotten_char: The most recently ungotten character, or None.
    @type ungotten_char: string
    @ivar ungotten_token: The most recently ungotten token, or None.
    @type ungotten_token: (int, string) token tuple
    @ivar multiline: The current multiline level.  This value is increased
    by one every time a '(' delimiter is read, and decreased by one every time
    a ')' delimiter is read.
    @type multiline: int
    @ivar quoting: This variable is true if the tokenizer is currently
    reading a quoted string.
    @type quoting: bool
    @ivar eof: This variable is true if the tokenizer has encountered EOF.
    @type eof: bool
    @ivar delimiters: The current delimiter dictionary.
    @type delimiters: dict
    @ivar line_number: The current line number
    @type line_number: int
    @ivar filename: A filename that will be returned by the L{where} method.
    @type filename: string
    cCsÀt|tƒo*ti|ƒ}|djo
d}qkn2|djo$|tijo
d}qkd}n||_
d|_d|_d|_
t|_t|_t|_d|_||_dS(s’Initialize a tokenizer instance.

        @param f: The file to tokenize.  The default is sys.stdin.
        This parameter may also be a string, in which case the tokenizer
        will take its input from the contents of the string.
        @type f: file or string
        @param filename: the name of the filename that the L{where} method
        will return.
        @type filename: string
        s<string>s<stdin>s<file>iiN(R tftstrt	cStringIOtStringIOtfilenametNonetsyststdinR
tfilet
ungotten_chartungotten_tokent	multilineR"tquotingteoft_DELIMITERSt
delimiterstline_number(R
R<R@((R	R¼s$




								cCsŠ|idjod|io
d}q†|iidƒ}|djo
t|_q†|djo|id7_q†n|i}d|_|S(s<Read a character from input.
        @rtype: string
        Ris
N(	R
RERARIR+RDtreadR$RL(R
R+((R	t	_get_charÜs




		cCs|i|ifS(sµReturn the current location in the input.

        @rtype: (string, int) tuple.  The first item is the filename of
        the input, the second is the current line number.
        N(R
R@RL(R
((R	twhereïscCs'|idj	o
t‚n||_dS(sEUnget a character.

        The unget buffer for characters is only one character large; it is
        an error to try to unget a character when the unget buffer is not
        empty.

        @param c: the character to unget
        @type c: string
        @raises UngetBufferFull: there is already an ungotten char
        N(R
RERARR+(R
R+((R	t_unget_charøs

cCszd}xmtoe|iƒ}|djo>|djo1|djp|io|i|ƒ|Sqgn|d7}q	WdS(s(Consume input until a non-whitespace character is encountered.

        The non-whitespace character is then ungotten, and the number of
        whitespace characters consumed is returned.

        If the tokenizer is in multiline mode, then newlines are whitespace.

        @rtype: int
        iRs	s
iN(tskippedR$R
RNR+RGRP(R
RQR+((R	tskip_whitespaces	
c
Csð|idj	oZ|i}	d|_|	iƒo|o|	Sqfqj|	iƒo|o|	Sqfqj|	Sn|iƒ}|o|djot
tdƒSnd}	t}t}xìtoä|iƒ}|djp||ijo0|djo|iotii‚n|	djoê|tjoÝ|djo |id7_|iƒq°q|djo@|idjptii‚n|id8_|iƒq°q|djoL|ipt|_t|_t}q°qút|_t|_|iƒq°q|djot
tdƒSq|d	joÏx:|iƒ}|djp
|djoPn|	|7}	q"W|o|i|ƒt
t|	ƒSqú|djo.|iotiid
ƒ‚nt
t ƒSqú|io|iƒd}	q°qút
tdƒSq|}	t!}n|i|ƒPn~|io|djoè|iƒ}|djotii‚n|i"ƒo®|iƒ}|djotii‚n|iƒ}|djotii‚n|i"ƒo
|i"ƒptii‚nt%t&|ƒdt&|ƒd
t&|ƒƒ}q2q|djotiidƒ‚qnX|djoJ|	|7}	t}|iƒ}|djp
|djotii‚qn|	|7}	q°W|	djo7|tjo*|iotiid
ƒ‚nt }nt
||	|ƒS(sGet the next token.

        @param want_leading: If True, return a WHITESPACE token if the
        first character read is whitespace.  The default is False.
        @type want_leading: bool
        @param want_comment: If True, return a COMMENT token if the
        first token read is a comment.  The default is False.
        @type want_comment: bool
        @rtype: Token object
        @raises dns.exception.UnexpectedEnd: input ended prematurely
        @raises dns.exception.SyntaxError: input was badly formed
        iRRRiRRs
Rsunbalanced parenthesess\idi
snewline in quoted stringN('R
RFRAttokenRtwant_leadingRtwant_commentRRRQR
RRRR"RR$RNR+RKRHR,R-R.RRGR2t_QUOTING_DELIMITERSRJRRPRRRR/R0R1R3R4(
R
RTRURRRQR1R0R+RS((R	tgetsÄ		







				















6




cCs'|idj	o
t‚n||_dS(s@Unget a token.

        The unget buffer for tokens is only one token large; it is
        an error to try to unget a token when the unget buffer is not
        empty.

        @param token: the token to unget
        @type token: Token object
        @raises UngetBufferFull: there is already an ungotten token
        N(R
RFRARRS(R
RS((R	tunget–s

cCs'|iƒ}|iƒo
t‚n|S(sLReturn the next item in an iteration.
        @rtype: (int, string)
        N(R
RWRSRt
StopIteration(R
RS((R	tnext¦s


cCs|S(N(R
(R
((R	R8°scCsh|iƒiƒ}|iƒptiidƒ‚n|ii	ƒptiidƒ‚nt
|iƒS(s|Read the next token and interpret it as an integer.

        @raises dns.exception.SyntaxError:
        @rtype: int
        sexpecting an identifiersexpecting an integerN(R
RWR5RSRR,R-R2RR/R4(R
RS((R	tget_intµs
cCsD|iƒ}|djp
|djotiid|ƒ‚n|S(s“Read the next token and interpret it as an 8-bit unsigned
        integer.

        @raises dns.exception.SyntaxError:
        @rtype: int
        iiÿs#%d is not an unsigned 8-bit integerN(R
R[RR,R-R2(R
R((R	t	get_uint8Ãs
cCsD|iƒ}|djp
|djotiid|ƒ‚n|S(s“Read the next token and interpret it as a 16-bit unsigned
        integer.

        @raises dns.exception.SyntaxError:
        @rtype: int
        iiÿÿs$%d is not an unsigned 16-bit integerN(R
R[RR,R-R2(R
R((R	t
get_uint16Ðs
cCs¢|iƒiƒ}|iƒptiidƒ‚n|ii	ƒptiidƒ‚nt
|iƒ}|djp
|djotiid|ƒ‚n|S(s“Read the next token and interpret it as a 32-bit unsigned
        integer.

        @raises dns.exception.SyntaxError:
        @rtype: int
        sexpecting an identifiersexpecting an integerils$%d is not an unsigned 32-bit integerN(R
RWR5RSRR,R-R2RR/tlong(R
RRS((R	t
get_uint32Ýs
cCsI|iƒiƒ}|iƒp
|iƒptiidƒ‚n|i	S(s}Read the next token and interpret it as a string.

        @raises dns.exception.SyntaxError:
        @rtype: string
        sexpecting a stringN(
R
RWR5RSRRR,R-R2R(R
toriginRS((R	t
get_stringïs
cCs<|iƒiƒ}|iƒptiidƒ‚n|iS(s’Read the next token and raise an exception if it is not an identifier.

        @raises dns.exception.SyntaxError:
        @rtype: string
        sexpecting an identifierN(	R
RWR5RSRR,R-R2R(R
R`RS((R	tget_identifierûs

cCsE|iƒ}|iƒptiidƒ‚ntii|i	|ƒS(s„Read the next token and interpret it as a DNS name.

        @raises dns.exception.SyntaxError:
        @rtype: dns.name.Name objectsexpecting an identifierN(R
RWRSRR,R-R2tnamet	from_textRR`(R
R`RS((R	tget_names

cCsF|iƒ}|iƒp&tiid|i|ifƒ‚n|iS(s–Read the next token and raise an exception if it isn't EOL or
        EOF.

        @raises dns.exception.SyntaxError:
        @rtype: string
        s expected EOL or EOF, got %d "%s"N(	R
RWRSRR,R-R2RR(R
RS((R	tget_eols

&cCsH|iƒiƒ}|iƒptiidƒ‚ntii	|i
ƒS(Nsexpecting an identifier(R
RWR5RSRR,R-R2tttlRdR(R
RS((R	tget_ttls
(RRRRBRCRARRNRORPRRR"RWRXRZR8R[R\R]R_RaRbReRfRh(((R	R;žs& 					z		
			
	
		
(RR>RBt
dns.exceptionR,tdns.nametdns.ttlR$RJRVRRRRRRRR-tDNSExceptionRtobjectR
R;(RR>RR;R
RRRBRRR,RJRRVR((R	t?s"					E	m