U if@s0ddlmZGdddeZGdddeZdS))tokenc@seZdZddZddZdS) ParseErrorcCs4t|d||||f||_||_||_||_dS)Nz!%s: type=%r, value=%r, context=%r) Exception__init__msgtypevaluecontext)selfrrrr r 8/opt/alt/python38/lib64/python3.8/lib2to3/pgen2/parse.pyrs zParseError.__init__cCst||j|j|j|jffSN)rrrr )r r r r __reduce__szParseError.__reduce__N)__name__ __module__ __qualname__rrr r r r rsrc@sHeZdZdddZdddZddZdd Zd d Zd d ZddZ dS)ParserNcCs||_|pdd|_dS)NcSs|Sr r )grammarnoder r r Zz!Parser.__init__..)rconvert)r rrr r r r<szParser.__init__cCsH|dkr|jj}|ddgf}|jj|d|f}|g|_d|_t|_dS)N)rstartdfasstackrootnodeset used_names)r rnewnodeZ stackentryr r r setup\s  z Parser.setupcCs0||||}|jd\}}}|\}} ||} | D]\} } |jj| \} }|| kr|||| || }||d|fgkr||jsdS|jd\}}}|\}} qfdS| dkr2|jj| }|\}}||kr2|| |jj| | |qq2d|f| kr||js*td|||qtd|||qdS)NrTFztoo much inputz bad input) classifyrrlabelsshiftpoprpushr)r rrr ilabeldfastaterZstatesfirstZarcsinewstatetvZitsdfaZ itsstatesZitsfirstr r r addtokents>   zParser.addtokencCsX|tjkr0|j||jj|}|dk r0|S|jj|}|dkrTtd||||S)Nz bad token) rNAMEraddrkeywordsgettokensr)r rrr r(r r r r#s  zParser.classifyc CsT|jd\}}}|||df}||j|}|dk r@|d||||f|jd<dSNr!)rrrappend) r rrr-r r)r*rrr r r r%s  z Parser.shiftc CsB|jd\}}}|d|gf}|||f|jd<|j|d|fdS)Nr!r)rr7) r rZnewdfar-r r)r*rrr r r r's z Parser.pushcCs`|j\}}}||j|}|dk r\|jrL|jd\}}}|d|n||_|j|j_dSr6)rr&rrr7rr)r ZpopdfaZpopstateZpopnoderr)r*rr r r r&sz Parser.pop)N)N) rrrrr r0r#r%r'r&r r r r rs 0 rN)rrrobjectrr r r r s