File dsl/ast/DslIf.class.php
Last commit: Mon Jun 6 14:06:46 2022 +0200 Jan Dankert First commit after fetching from upstream repo.
1 <?php 2 3 namespace dsl\ast; 4 5 class DslIf implements DslStatement 6 { 7 8 /** 9 * Expression for the condition 10 * @var DslExpression 11 */ 12 private $condition; 13 14 /** 15 * @var DslStatementList 16 */ 17 private $pos; 18 19 /** 20 * @var DslStatementList 21 */ 22 private $neg; 23 24 public function execute( & $context ) { 25 26 $conditionValue = $this->condition->execute( $context ); 27 28 if ( $conditionValue ) 29 return $this->pos->execute( $context ); 30 else 31 return $this->neg->execute( $context ); 32 } 33 34 public function __construct( $condition, $positive,$negative ) { 35 $this->condition = new DslExpression( $condition ); 36 $this->pos = new DslStatementList( $positive ); 37 $this->neg = new DslStatementList( $negative ); 38 } 39 40 public function parse($tokens) 41 { 42 } 43 }
Downloaddsl/ast/DslIf.class.php
History Mon, 6 Jun 2022 14:06:46 +0200 Jan Dankert First commit after fetching from upstream repo.