#!/usr/bin/php -q
<?php
ini_set('include_path', realpath(dirname(__FILE__) . '/../../ParserDriver') . ':' .
realpath(dirname(__FILE__) . '/../../Structures_CSS/Structures_CSS') . ':' .
realpath(dirname(__FILE__) . '/../../CSSDOM') . ':' .
realpath(dirname(__FILE__) . '/../') . ':' .
ini_get('include_path'));
function main() {
require_once('CSS/Parser.php');
require_once('CSS/Lexer.php');
$aux = new ReflectionClass('CSS_Parser');
$aux = $aux->getConstants();
$tokenNames = array();
foreach ($aux as $constant => $value) {
if ($constant == 'YY_NO_ACTION') break;
$tokenNames[$value] = $constant;
}
$testCSS = file_get_contents(dirname(__FILE__) . '/input/a.css');
var_dump($testCSS);
$lexer = new CSS_Lexer($testCSS);
while ($token = $lexer->nextToken()) {
printf("Lexer output token {%s, '%s'}\n", $tokenNames[$token['token']], addcslashes($token['value'], "\0..\37!@\177..\377"));
}
}
main();
?>