Search code examples
gnubisonyacclex

GNU marks in auto generated source by lex or bison


I want to submit some code that generated by lex and bison. Since there are gnu marks in them, I'm serious if it will become a trouble later to a non open source, commercial project.

Thanks for any suggestion.


Solution

  • lex (you are probably referring to flex) is not a GNU project, and is not GPL-licensed (it uses the permissive BSD license instead). So there are no "gnu marks" in its output. You may be talking about text such as

    #line 3 "lex.yy.c"
    
    #define  YY_INT_ALIGNED short int
    
    /* A lexical scanner generated by flex */
    
    #define FLEX_SCANNER
    #define YY_FLEX_MAJOR_VERSION 2
    #define YY_FLEX_MINOR_VERSION 5
    #define YY_FLEX_SUBMINOR_VERSION 35
    #if YY_FLEX_SUBMINOR_VERSION > 0
    #define FLEX_BETA
    #endif
    

    which are conventional C-preprocessor lines, unrelated to licensing.

    Bison's output is explicitly addressed in its licensing, and is not a problem:

    The distribution terms for Bison-generated parsers permit using the parsers in nonfree programs.