No, Syside does not parse textual representation contents at all besides trimming separators /* and */, and leading stars *, same as in comments and documentation.
The SysML v2 Specification does not require tool vendors to support OCL or ALF (or any other language aside from KerML and SysML v2 itself) parsing. These languages are only given as an example.
What can be done, however, is to use Syside Automator to find the TextualRepresentation elements in the model. Then, you can use the language attribute of TextualRepresentation to see if you are working with Python code (or ocl, alf, or whatever else). Afterwards, you can extract the body attribute of TextualRepresentation, which will contain the defined script without the separators (as mentioned by Daumantas above) and pass it on to a Python interpreter, ALF interpreter, OCL interpreter, or any other interpreter.
However, keep in mind that blindly executing these Textual Representations can have security implications, so be cautious.
Hi Daumantas and Simonas,
thank you for your helpful responses. My intent is biased by the willingness to promote a single-source-of-truth and can be achieved with your proposed method, knowing that this may bring associated risks as Simonas stated. I wonder whether the Automator might in the future enable this kind of extensibility. Syside > Feature Requests
Best regards!