Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
guide:start [2023/04/21 17:38] – [Referencing the languages body] rajitguide:start [2023/04/21 17:43] (current) – [Referencing a particular language body] rajit
Line 38: Line 38:
  
 A language body can be accessed from the languages pointer. For example, for the chp body: A language body can be accessed from the languages pointer. For example, for the chp body:
-<code>+<code c++>
 act_chp *chp; act_chp *chp;
 chp = lang->getchp(); chp = lang->getchp();
 </code> </code>
 +Note that the ''chp'' pointer will be NULL if there is no CHP sub-language specified within the process definition.
  
-Finally, to get a pointer to the actual object that stores the chp data structure:+Finally, to get a pointer to the actual object that stores the CHP data structure:
 <code> <code>
 act_chp_lang_t *chp_lang; act_chp_lang_t *chp_lang;
Line 53: Line 54:
  
 ==== The statement list data structure ==== ==== The statement list data structure ====
-The linked list ''list_t'' contains elements of type ''listitem_t''. See ''list.h'' or ''list.c'' for details and available methods. This is used to store lists of statements. To get the actual statement stored in the list of statements, call ''list_value'' on the required ''listitem_t'' of the list: +The linked list ''list_t'' contains elements of type ''listitem_t''. See ''list.h'' or ''list.c'' for details and available methods. In a CHP data structure, this is used to store lists of statements. To get the actual statement stored in the list of statements, call ''list_value'' on the required ''listitem_t'' of the list: 
-<code>+<code c++>
 act_chp_lang_t *c; // contains the overall chp body act_chp_lang_t *c; // contains the overall chp body
 act_chp_lang_t *stmt; act_chp_lang_t *stmt;
Line 60: Line 61:
 listitem_t *li; listitem_t *li;
  
 +// if c->type is ACT_CHP_SEMI or ACT_CHP_COMMA 
 stmt_list = c->u.semi_comma.cmd; // returns the linked list stmt_list = c->u.semi_comma.cmd; // returns the linked list