klauer / blark

Beckhoff TwinCAT ST (IEC 61131-3) code parsing in Python using Lark (Earley)
https://klauer.github.io/blark/
GNU General Public License v2.0
42 stars 5 forks source link

Add Support of Indirection in Unions #26

Closed engineerjoe440 closed 2 years ago

engineerjoe440 commented 2 years ago

Changes:

TYPE TypeName :
    UNION
        pt_value : POINTER TO INT;
        pt_SomethingElse : POINTER TO class_SomethingCool;
    END_UNION
END_TYPE

Closing Thoughts:

I couldn't find a good sample set of documentation for this, but I've used unions for pointer manipulation in a few cases. Most commonly when dealing with dynamic memory allocations. Please let me know if you have any questions about this!

engineerjoe440 commented 2 years ago

Alright! I think that should be updated accordingly, but please let me know if I oversimplified it, or if I'm missing anything! :)