Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » questions about StructureText language(can I use StructureText language directly?)
questions about StructureText language [message #1851835] Tue, 19 April 2022 09:59 Go to next message
feng wang is currently offline feng wangFriend
Messages: 4
Registered: April 2022
Junior Member
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 #1851837 is a reply to message #1851835] Tue, 19 April 2022 12:43 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Hi,

if you could explain what you want to achieve, perhaps I can help you. right now I am not sure what your question is.

Best regards,
Martin
Re: questions about StructureText language [message #1851846 is a reply to message #1851837] Tue, 19 April 2022 18:51 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

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 Go to previous messageGo to next message
feng wang is currently offline feng wangFriend
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 98 times)
Re: questions about StructureText language [message #1851898 is a reply to message #1851897] Thu, 21 April 2022 10:40 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
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 Go to previous messageGo to next message
feng wang is currently offline feng wangFriend
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
Re: questions about StructureText language [message #1851976 is a reply to message #1851967] Sun, 24 April 2022 20:50 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi,

as pointed out by Martin the C++ code 4diac IDE is generating is very specific for 4diac FORTE. It requires classes and run-time infrastructure defined there. If you want some more generic C/C++ code generation you may want to have a look on the Matiec compiler (https://www.openhub.net/p/matiec).

BR,
Alois
Previous Topic:lua vs luajit in forte
Next Topic:ID fields of the SUBSCRIBE/PUBLISH function blocks
Goto Forum:
  


Current Time: Fri Apr 26 00:21:46 GMT 2024

Powered by FUDForum. Page generated in 0.03365 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top