fg71
Any good C programmer or have experience in flex lexical parser, I think I have find in the source code of maitec.
The the folder stage1_2 you will find the file iec_flex.ll
 
line 641 - 643
line 1303 - 1312 the implementation of comment begin (* and comment end *)
 
 
I wonder if there could be possible to include single line comment and I believe this maybe will work
 
"//".* { /* Ignore comment */ }
 
Anyone with knowledge about this ??
Reply 0 0
bosmutus
hi, @fg71
i modified iec_flex.ll as follows to enable the // single line comment ,and rebuild the matiec, u can modify the single_line_comment as u wish like picture 1.
 
good luck!
 
[203128%2F9306396%2Fmceclip0]
 
[203128%2F9306397%2Fmceclip0]
 
[203128%2F9306398%2Fmceclip0]
Reply 0 0
fg71
That is great, I hope @thiagoralves could implement it so we in the feature could do update.
I will test your suggestion and give it a go, and return here if it works. (I'm on the windows platform)
 
if you wonder how I could find the line in windows platform I did: findstr /s /c:"comment" *
Its a windows command /s search in subfolder /c:"" * search string * all files not as powerful as grep but it works to search in text files.
 
Thanks again, its very useful to ask AI-Assistant for structure text solution or comment a solution. It could be it pick one over the other.
 
I have not yet test your suggestion but should it not be a yy_push_state(comment_state); ??
Reply 0 0
fg71
I try to cross-compile on raspberry pi, after ./configure I was able to get a executable but that version didn't work (something wrong with the binary)
What I'm trying to do is cross-compile on RaspberryPI for windows platform.
Reply 0 0
thiagoralves
Compile on Windows for Windows and on Raspberry Pi for Raspberry Pi. Cross compiling adds another layer of complexity that you don’t want to deal with. The OpenPLC installer script already has the commands to compile natively, so just run them on a MSYS terminal to compile for windows and on Linux terminal to compile for the Pi
Reply 0 0
fg71
I like to compile the matiec for windows only, so I was running the make inside that folder.
Are you saying I should configure the make on windows platform and running it there?
 
I'm running on MSYS2 MINGW64, it say: installing OpenPLC for Windows, but it looks like a forever process or maybe it have stopped.
I will try other MSYS2
 
It looks like MSYS2 MSYS was the one that was working, it compile now... will let you know if single comment is working.
 
[203128%2F9307090%2Fmceclip0]
Reply 0 0
thiagoralves
Are you saying I should configure the make on windows platform and running it there?
Yes. Just use MSYS environment that comes with the runtime for Windows. No need for anything extra. Clone your modified MatIEC version and then run the commands to build it from within MSYS
Reply 0 0
fg71
@bosmutus I tested your suggestion with a example in structured text it didn't work, I have to do more research how this is working.
If you have something working let me know.
 
Thanks
Reply 0 0
Reply