questions about StructureText language [message #1851835] |
Tue, 19 April 2022 05:59  |
Eclipse User |
|
|
|
Hi All,
I am new to the 4diac and I am trying to use the xtext files to model the StructureText language. In the process of extracting grammer model about ST, I have the following questions:
1. Whether the grammar rules about StructureText in 4diac have been complete model?
2. How can I verify that a language grammar has been complete model ?
ps. My English is not so good, I hope my questions has been described clearly
Thanks
Wang
|
|
|
|
|
Re: questions about StructureText language [message #1851897 is a reply to message #1851837] |
Thu, 21 April 2022 06:33   |
Eclipse User |
|
|
|
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 208 times)
|
|
|
Re: questions about StructureText language [message #1851898 is a reply to message #1851897] |
Thu, 21 April 2022 06:40   |
Eclipse User |
|
|
|
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 02:17   |
Eclipse User |
|
|
|
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.05270 seconds