Closed Beidendorfer closed 3 years ago
Chances are good the parser won't be as good as you're hoping (it's barely a prototype at this point), but the gist of it is as follows:
Preferably using non-system Python, set up an environment using, e.g., miniconda:
$ conda create -n blark-env python=3.7
$ conda activate blark-env
Install the library (using conda or otherwise, these steps are the same)
$ pip install blark
$ blark parse (filename)
where filename is a supported type from a standard TwinCAT project: .tsproj, .sln, .TcPOU, .TcGVL
Thanks for quick answers, I like the idea of the IEC parser.
I get at blark parse (filename) --verbose *Parsing (file name)...
but then there is no output file or console message.
Where can I find the parsing ritual?
Thanks
No problem. The command-line tool isn't so user-friendly, try this instead:
blark parse (filename) -vvv
(for very-very-verbose)
You should get something that looks like the following:
The original grammar is here: https://github.com/klauer/blark/blob/master/blark/iec.grammar It's converted into a lark-based grammar that's used by blark: https://github.com/klauer/blark/blob/master/blark/iec.lark
Eventually I plan to only have the .lark
and remove the need for the conversion step - if I ever find time.
Is there a description how to use the parser? How is it started?