|
|
Re: questions about StructureText language [message #1851846 is a reply to message #1851837] |
Tue, 19 April 2022 18:51 |
|
Hi,
first of all welcome to Eclipse 4diac. We are happy to have you here.
Maybe to add to Martin's question. No it is not a full IEC 61131-3 ST because not all IEC 61131-3 ST statements would be allowed or make sense in IEC 61499. Our XText -Grammar is focused on specifying algorithms and methods of FBs, ECC condition expression and IEC 61131-3 functions. But it does not handle any declaration of FBs.
Please also be aware that Martin M. and Martin J. are currently completely reworking our ST grammar. So you may want to look into that in our development branch.
Cheers,
Alois
|
|
|
Re: questions about StructureText language [message #1851897 is a reply to message #1851837] |
Thu, 21 April 2022 10:33 |
feng wang Messages: 4 Registered: April 2022 |
Junior Member |
|
|
Hi,Martin
Hope you are doing well!
Thank you for your immediate reply.
I want to build a webIDE and the StructureText language is a build-in language for the webIDE.So,I need to do some work such like parser, linker, typechecker. And then,I find 4diac had already finish the above works.So,I find these xtext files about ST grammar language from 4diac to build the myself IDE. Now,I can launch a eclipseIDE that support StructureText language and in the finally the ST language can generate a cpp file.
Please see Fig 1 and Fig 2.
The Fig 1 show the eclipseIDE that support StructureText language.
The Fig 2 show the cpp file.
so my question is that:
1. How to verify the correctness of the cpp file?
The cpp file is auto generate.Considering all the input possibilities and then check the results one by one,I think it is not an Effectively way. So,I want to know whether have more efficient ways to check the result?(input means the ST language that I edit in eclipseIDE the and the output is the cpp file)
2. As shown in the Fig 2,the prefix "CIEC" what does it mean?
Really appreciate for your help!
Thanks & best regards
Wang Feng
-
Attachment: figure.zip
(Size: 289.85KB, Downloaded 182 times)
|
|
|
Re: questions about StructureText language [message #1851898 is a reply to message #1851897] |
Thu, 21 April 2022 10:40 |
Martin Melik Merkumians Messages: 117 Registered: March 2016 |
Senior Member |
|
|
Hi,
to your first question: Correctness is relative to the environment where you want to use it. Currently we also don't have a continuous chain to check this, but the way to go from our perspective is to create a complete CI chain, exporting code from correct ST code, building it and then testing the built code against the specification of the ST code.
2. CIEC comes from the FORTE coding rules, where the first C stands for class, and IEC is then part of the name, specificing we are implementing IEC 61131 compliant types. So CIEC_DINT is short for class IEC DINT
If you want a pure textual ST syntax for FBs, etc. you can reuse the STCore grammar, which should implement everything every ST editor usually needs to support.
Best regards,
Martin
|
|
|
Re: questions about StructureText language [message #1851967 is a reply to message #1851898] |
Sun, 24 April 2022 06:17 |
feng wang Messages: 4 Registered: April 2022 |
Junior Member |
|
|
Hi,
currently,the 4diac IDE provides an export filter to generate C++ code, the code is as follows:
1. In the source code file: org.eclipse.fordiac.ide.export/TemplateExportFilter.java
at line 135,'private DelayedFiles generateFileContent(final String destination, final LibraryElement type)'
2. In the source code file:org.eclipse.fordiac.ide.test.export/ExporterTestBase.java at line 120,'public CharSequence generateExpression(final FBType fb, final String expression, final List<String> errorList)'
the above methods contain a type parameter(LibraryElement/FBType) ,
i want to know,if not provide the type(LibraryElement/FBType) parameter,weather 4diac provide the method/service interface which can convert .st file to .cpp(c++) file?
Thanks & best regards
Wang Feng
|
|
|
|
Powered by
FUDForum. Page generated in 0.04882 seconds