Menu

#10 Specify analyzer filename separately from classname/namespac

open
nobody
None
5
2012-10-02
2010-07-15
No

The option --analyzer-class specifies both namespace/classname of a lexer and the filestem of the output files generated by Quex. Sometimes it is inconvenient, e.g. when a build system requires dependencies like foobar.ext1 -> foobar.ext2; besides, changing namespace/classname implies filename change, which is sometime almost (or absolutely) intolerable. And it is impossible to change resulting filenames while not changing analyzer classname.

The attached patch adds one more option, --analyzer-class-file, which allows to specify filestem of generated files independently of namespace/classname; when it is not specified, Quex uses --analyzer-class for naming files, as before; when it is specified, it specifies a filestem for generated files.

P.S. QueX ist ein grossartiges Programm! Danke!

Discussion

  • Yakov Markovitch

    Patch that adds --analyzer-class-file option to QueX

     
  • Frank-Rene Schäfer

    Thanks for the patch.

    However, the option '-o' shall control the
    output file stem. There is an interference with the analyzer class name somehow
    in the default value management. What you pinpoint would actually be an
    error. I will have a look at it. Would you mind switching it to 'bugs'?

     
  • Yakov Markovitch

    Actually, '-o' is handled as an alias to '--analyzer-class' (see setup.py:14), and it is as documented, so I thought it was on purpose. Besides, the original (unpatched) __prepare_file_name (see setup_parser.py:425 in the trunk) creates a filename using only values derived from analyzer class name and namespace.

    I attach a new patch, which breaks a relation between '-o' and '--analyzer-class' (this is quite simple, actually, differs only by 2 lines with the previous patch - the code organization of QueX is excellent, really), but this requires changes in documentation and breaks compatibility, since I'm sure some did use '-o' as alias to '--analyzer-class'. Maybe adding a new option as in the previous patch would be better?

    And of course I wouldn't mind switching it to 'bugs' if you feel it appropriate.

     
  • Yakov Markovitch

    Use '-o' to specify output file stem

     

Anonymous
Anonymous

Add attachments
Cancel