EAL – ExtendedActionLanguage.
No edit summary
(Automatically adding template at the end of the page.)
 
(2 intermediate revisions by 2 users not shown)
Line 7: Line 7:
* StateMachine Effects
* StateMachine Effects


==== EAL Differences ====
=== EAL Differences ===
When using EAL, one often wants to stack expressions one after the other. To allow for this, EAL has introduced an expression separator: The semicolon “''';'''”. This means that you can build method bodies that do several things like this:
When using EAL, one often wants to stack expressions after each other. To allow for this, EAL has introduced an expression separator: The semicolon <code>;</code>. This means that you can build method bodies that do several things like this:
   self.SomeDateTime := DateTime.Now;
   self.SomeDateTime := DateTime.Now;
   self.SomeInt := 27;
   self.SomeInt := 27;
   self.SomeString := self.SomeDateTime.ToString('yyyy-MM-dd')
   self.SomeString := self.SomeDateTime.ToString('yyyy-MM-dd')
In EAL, we use ''':='''" to assign but "'''='''" to compare.
In EAL, we use <code>:=</code> to assign but <code>=</code> to compare.


In EAL, we can also create new objects Thing.Create
In EAL, we can also create new objects <code>Thing.Create</code>


Worth noting is that the expression separator “''';'''” can only be used between statements. So writing this ‘a string’;0 is of type integer. But writing this ‘a string’;0; is of unknown type and hence wrong – the last statement that the parser expects after the last "''';'''" is not found.
Worth noting is that the expression separator <code>;</code> can only be used between statements. So writing this <code>‘a string’;0</code> is of type integer. But writing this <code>‘a string’;0;</code> is of unknown type and hence wrong – the last statement that the parser expects after the last <code>;</code> is not found.
[[Category:EAL]]
[[Category:EAL]]
{{Edited|July|12|2024}}

Latest revision as of 15:34, 10 February 2024

In MDriven, we want to change data when appropriate – so we use the same syntax as OCL in something we call EAL – ExtendedActionLanguage.

We use EAL in MDriven here:

  • Action execute expression
  • Actions in ViewModel columns Execute expression
  • Class method implementations
  • StateMachine Effects

EAL Differences

When using EAL, one often wants to stack expressions after each other. To allow for this, EAL has introduced an expression separator: The semicolon ;. This means that you can build method bodies that do several things like this:

 self.SomeDateTime := DateTime.Now;
 self.SomeInt := 27;
 self.SomeString := self.SomeDateTime.ToString('yyyy-MM-dd')

In EAL, we use := to assign but = to compare.

In EAL, we can also create new objects Thing.Create

Worth noting is that the expression separator ; can only be used between statements. So writing this ‘a string’;0 is of type integer. But writing this ‘a string’;0; is of unknown type and hence wrong – the last statement that the parser expects after the last ; is not found.

This page was edited 98 days ago on 02/10/2024. What links here