For a project, I need to build grammar file (.g4 file) for OpenHAB. I am wondering if there is some work done on similar thing by anyone here in the community, if yes please share or guide me through your findings.
So far, as per my understanding, for truly capturing OpenHAB working in an AST(Abstract Syntax Tree) we need to user both .rules and .items files.
And .things, .sitemap, and .persist and config files. All but the last one’s grammar are defined using Xtext The cfg files are plain old INI.
But it is worth noting that these are all OH 1.x ways to define OH config. The newer ways get suited as JSON in files in /var/lib/openhab2/jsondb.
Thanks Rich. Can you recommend any source where I can find Xtext grammar of involved files.
I don’t know where they are specifically but would expect to find them in the openhab-core repo.