{"id":286,"date":"2015-02-22T10:54:35","date_gmt":"2015-02-22T10:54:35","guid":{"rendered":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=286"},"modified":"2015-07-13T09:41:47","modified_gmt":"2015-07-13T09:41:47","slug":"statements","status":"publish","type":"page","link":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=286","title":{"rendered":"Statements"},"content":{"rendered":"<p>As in C, every <a title=\"Expressions\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=283\">expression<\/a> can serve as a statement, provided that it is followed by a semicolon <code>;<\/code>.<\/p>\n<p>In particular, assignments <em>var<\/em><code>=<\/code><em>expr<\/em><code>;<\/code> are statements.<\/p>\n<p>The other kinds of statements are:<\/p>\n<ul>\n<li><strong>conditional<\/strong>: <code>if<\/code> <a title=\"Expressions\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=283\"><em>expr<\/em><\/a> <code>then<\/code> <em>statement<sub>1<\/sub><\/em> [<code>else<\/code> <em>statement<sub>2<\/sub><\/em>]<code>;<\/code><br \/>\nif <em>expr<\/em> is true, then execute <em>statement<sub>1<\/sub><\/em>;<br \/>\nelse, if <code>else<\/code> branch is present, execute <em>statement<sub>2<br \/>\n<\/sub><\/em><strong>Typing:<\/strong><\/p>\n<ul>\n<li>Requires: <em>expr<\/em> : <code>int<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong>split regex<\/strong>: <code>split<\/code> <em>regexp<\/em> <code>\/<\/code><em>var<sub>1<\/sub><\/em><code>,<\/code>&#8230;<code>,<\/code><em>var<sub>n<\/sub><\/em><code>\/<\/code> <a title=\"Expressions\" href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=283\"><code>expr<\/code><\/a><br \/>\nmatch value of <em>expr<\/em>\u00a0against <em>regexp<\/em> (an explicit string constant)<br \/>\nstore values of parenthesized sub-regexps into variables <em>var<sub>1<\/sub><\/em>, &#8230;, <em>var<sub>n<\/sub><\/em> respectively<br \/>\n<strong>Typing:<\/strong><\/p>\n<ul>\n<li>Requires: <em>var<\/em> : <code>str<\/code> <em>var<sub>1<\/sub><\/em> : <code>str<\/code> &#8230; <em>var<sub>n<\/sub><\/em> : <code>str<\/code><\/li>\n<\/ul>\n<p><strong>Error messages:<\/strong><\/p>\n<ul>\n<li><code>\"duplicate variable <\/code><em>var<sub>i<\/sub><\/em><code> in split regex\"<\/code><br \/>\n<em>var<sub>i<\/sub><\/em><code><\/code> appears twice or more in list of variables <em>var<sub>1<\/sub><\/em>, &#8230;, <em>var<sub>n<\/sub><\/em><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>As in C, every expression can serve as a statement, provided that it is followed by a semicolon ;. In particular, assignments var=expr; are statements. The other kinds of statements are: conditional: if expr then statement1 [else statement2]; if expr is true, then execute statement1; else, if else branch is present, execute statement2 Typing: Requires: &hellip; <a href=\"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/?page_id=286\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Statements<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-286","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=286"}],"version-history":[{"count":3,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages\/286\/revisions"}],"predecessor-version":[{"id":418,"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=\/wp\/v2\/pages\/286\/revisions\/418"}],"wp:attachment":[{"href":"https:\/\/projects.lsv.ens-paris-saclay.fr\/orchidsdoc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}