Methods are struct members. e methods are similar to C functions, Verilog tasks, and VHDL processes. An e method is an operational procedure containing actions that define its behavior.
A method can have parameters, local variables, and a return value. You can define a method only within a struct and you must create an instance of the struct before you can execute the method.
Methods can read or write locally declared variables, fields within the local struct, arguments and return value (implicit result variable), and fields in other structs using path notation.
Methods are not executed unless they are invoked. Invoking a method is done by simply calling the method in a predefined or a user-defined method. For example, a method can be invoked from a predefined post_generate() method of a struct.
Conditional actions are used to specify code segments that will be executed only if a certain condition is met. The e language supports if-then-else and case actions.
The four types of iterative actions are for, for each, while, and repeat loops.
There are three types of output routines: out(), outf(), and the do_print() method. The print action implicitly calls the do_print() method.