/** * Construct new document * * @param ezcDocumentParserOptions $options */ public function __construct(ezcDocumentParserOptions $options = null) { parent::__construct($options); $this->documentStack = new ezcDocumentRstStack(); }
/** * Construct parser * * Creates the regualr expressions for tokenizing the PCSS file. * * @return void */ public function __construct() { parent::__construct(); $xmlName = '(?:' . self::XML_NAME_STARTCHAR . '(?:' . self::XML_NAME_STARTCHAR . '|' . self::XML_NAME_CHAR . ')*)'; $this->expressions = array(array('type' => self::T_WHITESPACE, 'match' => '(\\A\\s+)S'), array('type' => self::T_COMMENT, 'match' => '(\\A/\\*.*\\*/)SUs'), array('type' => self::T_COMMENT, 'match' => '(\\A//.*$)Sm'), array('type' => self::T_START, 'match' => '(\\A\\{)S'), array('type' => self::T_END, 'match' => '(\\A\\})S'), array('type' => self::T_FORMATTING, 'match' => '(\\A(?P<name>[A-Za-z-]+)\\s*:)S', 'to' => 'formats'), array('state' => 'formats', 'type' => self::T_VALUE, 'match' => '(\\A"(?P<value>[^"]+)"\\s*;)S', 'to' => 'default'), array('state' => 'formats', 'type' => self::T_VALUE, 'match' => '(\\A(?P<value>[^;]+?)\\s*;)S', 'to' => 'default'), array('type' => self::T_ADDRESS, 'match' => '(\\A' . $xmlName . ')S'), array('type' => self::T_DESC_ADDRESS, 'match' => '(\\A>[\\t\\x20]+' . $xmlName . ')S'), array('type' => self::T_ADDRESS_CLASS, 'match' => '(\\A\\.[A-Za-z_-]+)S'), array('type' => self::T_ADDRESS_ID, 'match' => '(\\A#' . $xmlName . ')S'), array('type' => self::T_DEFINITION, 'match' => '(\\A@[A-Za-z_-]+)S')); }