Formal grammar for DTS
Hello,
I would like to write a tool / library that allows me to (programmatically) edit .dts files, with the ability to regenerate the source files, preserving the original formatting (including comments and other non-semantic content).
To that end I need a formal definition of the DTS grammar. While I have found the dtc tool, all its source files (in particular the dtc-lexer.l and dtc-parser.y files) are released under GPL, so it isn't entirely clear whether I may use the grammar encoded in those and transcribe that into my own (I'm writing my tool in Java, most likely using the JavaCC parser generator tool).
So, is there another place where the grammar of Device Tree source files is formally defined in ways that allows tools developers to use that ? Any help and advice would be highly appreciated.
Thanks,
Stefan
Signature · 7 lines
Stefan Seefeld CodeSourcery / Mentor Embedded [email protected] -- To unsubscribe from this list: send the line "unsubscribe devicetree-spec" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 14 lines · Stefan Seefeld
Hello,
I would like to write a tool / library that allows me to (programmatically) edit .dts files, with the ability to regenerate the source files, preserving the original formatting (including comments and other non-semantic content).
To that end I need a formal definition of the DTS grammar. While I have found the dtc tool, all its source files (in particular the dtc-lexer.l and dtc-parser.y files) are released under GPL, so it isn't entirely clear whether I may use the grammar encoded in those and transcribe that into my own (I'm writing my tool in Java, most likely using the JavaCC parser generator tool).
Quoted 3 lines
So, is there another place where the grammar of Device Tree source files is formally defined in ways that allows tools developers to use that ? Any help and advice would be highly appreciated.
I'm not aware of any other presentation of the dts grammar than in the source files.
IANAL, but fwiw, I wouldn't consider transcribing the grammar rules (without the semantic actions) into some other form to be a derived work triggering the GPL.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
David,
Quoted 19 lines · David Gibson
Quoted 14 lines · Stefan Seefeld
Hello,
I would like to write a tool / library that allows me to (programmatically) edit .dts files, with the ability to regenerate the source files, preserving the original formatting (including comments and other non-semantic content).
To that end I need a formal definition of the DTS grammar. While I have found the dtc tool, all its source files (in particular the dtc-lexer.l and dtc-parser.y files) are released under GPL, so it isn't entirely clear whether I may use the grammar encoded in those and transcribe that into my own (I'm writing my tool in Java, most likely using the JavaCC parser generator tool).
Quoted 3 lines
So, is there another place where the grammar of Device Tree source files is formally defined in ways that allows tools developers to use that ? Any help and advice would be highly appreciated.
Quoted 6 lines
I'm not aware of any other presentation of the dts grammar than in the source files.
IANAL, but fwiw, I wouldn't consider transcribing the grammar rules (without the semantic actions) into some other form to be a derived work triggering the GPL.
Yes, I agree. Still, it would be a little clearer if the grammar would be held in a separate file (not covered by GPL). Perhaps you could c&p just the BNF grammar into a text file ?
Many thanks,
Stefan
Signature · 7 lines
Stefan Seefeld CodeSourcery / Mentor Embedded [email protected] -- To unsubscribe from this list: send the line "unsubscribe devicetree-spec" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 25 lines · Stefan Seefeld
David,
Quoted 22 lines · David Gibson
Quoted 14 lines · Stefan Seefeld
Hello,
I would like to write a tool / library that allows me to (programmatically) edit .dts files, with the ability to regenerate the source files, preserving the original formatting (including comments and other non-semantic content).
To that end I need a formal definition of the DTS grammar. While I have found the dtc tool, all its source files (in particular the dtc-lexer.l and dtc-parser.y files) are released under GPL, so it isn't entirely clear whether I may use the grammar encoded in those and transcribe that into my own (I'm writing my tool in Java, most likely using the JavaCC parser generator tool).
Quoted 3 lines
So, is there another place where the grammar of Device Tree source files is formally defined in ways that allows tools developers to use that ? Any help and advice would be highly appreciated.
I'm not aware of any other presentation of the dts grammar than in the source files.
Quoted 7 lines
Quoted 3 lines
IANAL, but fwiw, I wouldn't consider transcribing the grammar rules (without the semantic actions) into some other form to be a derived work triggering the GPL.
Yes, I agree. Still, it would be a little clearer if the grammar would be held in a separate file (not covered by GPL). Perhaps you could c&p just the BNF grammar into a text file ?
Isn't the DTS syntax described by ePAPR "Appendix A Device Tree Source Format (version 1)"? having said that it's not terribly formal.
Ian.
--
To unsubscribe from this list: send the line "unsubscribe devicetree-spec" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html