private function encodeKeywords($script) { // escape high-ascii values already in the script (i.e. in strings) if ($this->encoding == PACKER_ENCODING_HIGHASCII) { $script = $this->escape95($script); } // create the parser $parser = new ParseMaster(); $encode = $this->getEncoder($this->encoding); // for high-ascii, don't encode single character low-ascii $regex = '~'.(($this->encoding == PACKER_ENCODING_HIGHASCII) ? "\\w\\w+" : "\\w+").'~'; // build the word list $this->encodingLookup = $this->analyze($script, $regex, $encode); // encode $parser->Add(($this->encoding == PACKER_ENCODING.HIGHASCII) ? "\\w\\w+" : "\\w+", array(&$this, 'encodeWithLookup')); // if encoded, wrap the script in a decoding function return ($script == '') ? "" : $this->bootStrap($parser->Exec($script), $this->encodingLookup); }