Home
theroin
wiki
(WikiPage)
This is the personal project of theroin. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2020-03-28
Home
hazar
wiki
(WikiPage)
This is the personal project of hazar. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2020-03-28
Home (version 1) discussion
theroin
wiki
(Thread)
Home (version 1) discussion
Last updated: 2020-04-28
(no subject)
theroin
wiki
(Thread)
Last updated: 2020-03-28
(no subject)
hazar
wiki
(Thread)
Last updated: 2020-03-28
Home (version 1) discussion
hazar
wiki
(Thread)
Home (version 1) discussion
Last updated: 2020-04-29
blog Discussion
theroin
blog
(Discussion)
Forum for blog comments
Last updated: 2020-03-28
wiki Discussion
theroin
wiki
(Discussion)
Forum for wiki comments
Last updated: 2020-03-28
blog Discussion
hazar
blog
(Discussion)
Forum for blog comments
Last updated: 2020-03-28
wiki Discussion
hazar
wiki
(Discussion)
Forum for wiki comments
Last updated: 2020-03-28
Home
marcosilva
wiki
(WikiPage)
This is the personal project of marcosilva. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2020-03-28
Home
tomjandro
wiki
(WikiPage)
This is the personal project of tomjandro. This project is created automatically during user registration as an easy place to store personal data that doesn't need its own project such as cloned repositories.
Last updated: 2020-03-28
Home (version 1) discussion
marcosilva
wiki
(Thread)
Home (version 1) discussion
Last updated: 2020-04-28
(no subject)
marcosilva
wiki
(Thread)
Last updated: 2020-03-28
(no subject)
tomjandro
wiki
(Thread)
Last updated: 2020-03-28
Home (version 1) discussion
tomjandro
wiki
(Thread)
Home (version 1) discussion
Last updated: 2020-04-29
blog Discussion
marcosilva
blog
(Discussion)
Forum for blog comments
Last updated: 2020-03-28
wiki Discussion
marcosilva
wiki
(Discussion)
Forum for wiki comments
Last updated: 2020-03-28
blog Discussion
tomjandro
blog
(Discussion)
Forum for blog comments
Last updated: 2020-03-28
wiki Discussion
tomjandro
wiki
(Discussion)
Forum for wiki comments
Last updated: 2020-03-28
Home
c2iec
home
(WikiPage)
Why ST is a very robust and easy to understand language. A good fit for industrial applications. But on the internet you find by far more example algorithms, applications and libraries written in C or other languages. The mission of this project is to make the step from a working C example code to a working ST code as small as possible. Technique The transpiler is built using the very old but famous and solid compiler builder tools flex and yacc / bison. So the code transformation consists only of two steps: flex: tokenize the ANSI C code bison: parse and transform the tokens to ST code As the transformations from the tokens to the resulting ST code is done in just one step, we have to live with a few limitations, which can't be transformed as the ST language doesn't support those language constructs. Features The following features are currently tested, and should work therefore: feature C ST expressions a = b * (c + d) * e; a := b * ( c + d ) * e; lvalues c++; ((c:=c+1)-1); case switch (value) CASE value OF for for (i=0; i < 5; i++) WHILE i < 5; while while (x < 10) WHILE x < 10 DO named structs / unions struct test TYPE test: STRUCT unnamed structs / unions union ...; flattened as members into the type in which they are embedded typedef typedef struct ... t_struct; TYPE t_struct: Id2036658550; arrays char arr2[1][2]; arr2: ARRAY[0..(1-1),0..(2-1)] OF BYTE; Limitations The following features will definitely not be supported by this transpiler, because of its design. Explicit type conversions of user defined data types (e.g. structs) Function pointers Pointer arithmetics Static variables or functions Usage This project is in a proof-of-concept phase. So it can't be easily used, yet, nor would I try to encourage non-experienced people to use it in this state. If your code is proberly pre processed, you can quickly try it with the web-version of the transpiler.
Last updated: 2020-06-30
Post by ingo on #3 Unary operators are not working
c2iec
tickets
(Post)
Nice idea! Actually I already thought of inventing a runtime library (emscripting is doing it similar). Then I could pass the variable by reference, to increment it, and return the old value as a result. But would this work with an Any-Type? Because in the place where I get the operator I don't know the datatype. Not sure, yet. BR, Ingo
Last updated: 2020-07-06
Post by i-campbell on #3 Unary operators are not working
c2iec
tickets
(Post)
if i is a DINT you can use __XADD(ADR(i) , 1) for i++
Last updated: 2020-07-06
(no subject)
c2iec
tickets
(Thread)
Last updated: 2020-06-30
Home (version 2) discussion
c2iec
home
(Thread)
Home (version 2) discussion
Last updated: 2020-04-13