File modules/dsl/ast/DslInteger.class.php
Last commit: Sun May 29 16:56:40 2022 +0200 Jan Dankert New: DSL with support for functions with return values, full arithmetic, object properties
1 <?php 2 3 namespace dsl\ast; 4 5 class DslInteger implements DslStatement 6 { 7 private $number; 8 9 /** 10 * DslInteger constructor. 11 * @param $number 12 */ 13 public function __construct($number) 14 { 15 $this->number = $number; 16 } 17 18 19 public function execute( & $context ) { 20 21 return intval($this->number); 22 } 23 24 public function parse($tokens) 25 { 26 $firstToken = $tokens[0]; 27 $this->number = intval( $firstToken->value ); 28 } 29 }
Downloadmodules/dsl/ast/DslInteger.class.php
History Sun, 29 May 2022 16:56:40 +0200 Jan Dankert New: DSL with support for functions with return values, full arithmetic, object properties Sat, 28 May 2022 18:00:13 +0200 Jan Dankert New: DSL with a much better syntax parsing and support for assignments, conditions, ...