U _:@s4GdddeZGdddeZGdddeZdS)c@s&eZdZdZdZdddZddZdS) Coordz Coordinates of a syntactic element. Consists of: - File name - Line number - (optional) column number, for the Lexer )filelinecolumn __weakref__NcCs||_||_||_dS)Nrrr)selfrrrr /plyparser.py__init__szCoord.__init__cCs(d|j|jf}|jr$|d|j7}|S)Nz%s:%sz:%sr)rstrrrr __str__sz Coord.__str__)N)__name__ __module__ __qualname____doc__ __slots__r r rrrr r s rc@s eZdZdS) ParseErrorN)r rrrrrr rsrc@s&eZdZddZdddZddZdS) PLYParsercCs<|d}dd}d||f|_d||_t|j|j|dS)z Given a rule name, creates an optional ply.yacc rule for it. The name of the optional rule is _opt Z_optcSs|d|d<dS)Nr)rprrr optrule)sz+PLYParser._create_opt_rule..optrulez%s : empty | %szp_%sN)rr setattr __class__)rZrulenameZoptnamerrrr _create_opt_rule"s  zPLYParser._create_opt_ruleNcCst|jj||dS)Nr)rZclexfilename)rlinenorrrr _coord0s zPLYParser._coordcCstd||fdS)Nz%s: %s)r)rmsgZcoordrrr _parse_error6szPLYParser._parse_error)N)r rrrrrrrrr r!s rN)objectr Exceptionrrrrrr  s