From daa1160e3b7e7bd94dc06da9e11ce9e188406fda Mon Sep 17 00:00:00 2001 From: David Beazley Date: Fri, 24 Apr 2015 13:06:34 -0500 Subject: Further refinement of table handling with packages. More unit tests. --- CHANGES | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'CHANGES') diff --git a/CHANGES b/CHANGES index 08e4876..3dcdef9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,18 +1,28 @@ Version 3.6 --------------------- 04/24/15: beazley - Fixed some problems related to use of packages and table file - modules. Just to emphasize, if you use a command such as this: + Fixed some issues related to use of packages and table file + modules. Just to emphasize, PLY now generates its special + files such as 'parsetab.py' and 'lextab.py' in the *SAME* + directory as the source file that uses lex() and yacc(). - # lexer.py - parser = yacc.yacc(tabmodule='foo.bar.parsetab') + If for some reason, you want to change the name of the table + module, use the tabmodule and lextab options: - You need to make sure that the file 'lexer.py' is located at - foo/bar/lexer.py. If this is not the same location, then - you need to also include the outputdir option + lexer = lex.lex(lextab='spamlextab') + parser = yacc.yacc(tabmodule='spamparsetab') - parse = yacc.yacc(tabmodule='foo.bar.parsetab', - outputdir='foo/bar') + If you specify a simple name as shown, the module will still be + created in the same directory as the file invoking lex() or yacc(). + If you want the table files to be placed into a different package, + then give a fully qualified package name. For example: + + lexer = lex.lex(lextab='pkgname.files.lextab') + parser = yacc.yacc(tabmodule='pkgname.files.parsetab') + + For this to work, 'pkgname.files' must already exist as a valid + Python package (i.e., the directories must already exist and be + set up with the proper __init__.py files, etc.). Version 3.5 --------------------- -- cgit v1.2.1