Example #1
0
 public static function getCFMLTagsFile($file)
 {
     $parser = new CFMLParser();
     $tokens = $parser->tokenize($file);
     $output = $parser->parse($tokens, 'tags');
     return $output;
 }
Example #2
0
 public static function getCFMLTagsFile($file, $vars = array())
 {
     self::$fallback = $vars;
     self::$variables = method_exists($vars, 'getRecord') ? (array) $vars->getRecord() : (array) $vars;
     $parser = new CFMLParser();
     $tokens = $parser->tokenize($file);
     $output = $parser->parse($tokens, 'tags');
     return $output;
 }
Example #3
0
 public function parseCFMLFile($file)
 {
     $parser = new CFMLParser();
     $tokens = $parser->tokenize($file);
     echo '<pre>';
     var_dump($tokens);
     echo '</pre>';
     $output = $parser->parse($tokens);
     return $output;
 }
Example #4
0
 public function parseCFMLFile($file)
 {
     $parser = new CFMLParser();
     $time = microtime(true);
     $tokens = $parser->tokenize($file);
     $this->compilationTime = number_format(microtime(true) - $time, 4);
     echo htmlentities(print_r($tokens, TRUE));
     $time = microtime(true);
     $output = $parser->parse($tokens);
     $this->executionTime = number_format(microtime(true) - $time, 4);
     return $output;
 }
Example #5
0
 public function close()
 {
     $attr = $this->startTag->attributes;
     $index = $this->getVar($attr['index']);
     if ($attr['from'] > $attr['to']) {
         if ($index <= $attr['to']) {
             return;
         }
     } else {
         if ($index >= $attr['to']) {
             return;
         }
     }
     $index += $attr['step'];
     $this->setVar($attr['index'], $index);
     CFMLParser::gotoTag($this->startTag);
 }
Example #6
0
switch ($thisTag['mode']) {
    case 'start':
        if (!isset($thisTag['attributes']['from'])) {
            throw new CFML_Syntax_Exception('cfloop: from attribute is required.');
        }
        if (!isset($thisTag['attributes']['to'])) {
            throw new CFML_Syntax_Exception('cfloop: to attribute is required.');
        }
        if (!isset($thisTag['attributes']['index'])) {
            throw new CFML_Syntax_Exception('cfloop: index attribute is required.');
        }
        if (!isset($thisTag['attributes']['step'])) {
            $thisTag['attributes']['step'] = 1;
        }
        eval("{$thisTag['attributes']['index']} = {$thisTag['attributes']['from']};");
        break;
    case 'end':
        $index = eval("return {$thisTag['parenttag']['attributes']['index']} += {$thisTag['parenttag']['attributes']['step']};");
        if (empty($local['lastpass'])) {
            if ($index != $thisTag['parenttag']['attributes']['to']) {
                CFMLParser::gotoToken($thisTag['parenttag']);
                break;
            }
            $local['lastpass'] = TRUE;
            CFMLParser::gotoToken($thisTag['parenttag']);
        }
        break;
    case 'selfclosing':
        break;
}
Example #7
0
 public function getContainer($name = NULL, $depth = 1)
 {
     return CFMLParser::getContainer($name, $depth);
 }
Example #8
0
 public static function gotoTag($tag)
 {
     ob_start();
     self::$tagStack[] =& $tag;
     self::$tokenIndex = $tag->startIndex;
 }
<?php

switch ($thisTag['mode']) {
    case 'start':
        break;
    case 'end':
        break;
    case 'selfclosing':
        $parent =& CFMLParser::getParent();
        $parent['tagscope']['localscope']['params'][] = $thisTag['attributes']['value'];
        echo '?';
        break;
}
Example #10
0
 public static function &getParent($name = NULL)
 {
     self::$tagStack = array_values(self::$tagStack);
     $i = count(self::$tagStack) - 1;
     if ($name === NULL) {
         return self::$tagStack[$i];
     } else {
         $elem =& self::$tagStack[$i];
         while ($elem['token']['tag'] != $name && $i > 0) {
             --$i;
             $elem =& self::$tagStack[$i];
         }
         return $elem;
     }
 }