Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56113 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20643 invoked from network); 7 Nov 2011 17:31:00 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2011 17:31:00 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@schlueters.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@schlueters.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain schlueters.de from 217.114.211.66 cause and error) X-PHP-List-Original-Sender: johannes@schlueters.de X-Host-Fingerprint: 217.114.211.66 config.schlueters.de Received: from [217.114.211.66] ([217.114.211.66:39348] helo=config.schlueters.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/16-13242-1D518BE4 for ; Mon, 07 Nov 2011 12:30:58 -0500 Received: from [192.168.2.230] (ppp-93-104-41-182.dynamic.mnet-online.de [93.104.41.182]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by config.schlueters.de (Postfix) with ESMTPSA id 39B8F77140; Mon, 7 Nov 2011 18:30:54 +0100 (CET) To: Clint M Priest Cc: Nikita Popov , Keloran , "internals@lists.php.net" In-Reply-To: <9570D903A3BECE4092E924C2985CE485397FF8AA@MBX206.domain.local> References: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> <9570D903A3BECE4092E924C2985CE485397FF8AA@MBX206.domain.local> Content-Type: text/plain; charset="UTF-8" Date: Mon, 07 Nov 2011 18:30:50 +0100 Message-ID: <1320687050.11662.1.camel@guybrush> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Subject: RE: [PHP-DEV] Help w/ Parser From: johannes@schlueters.de (Johannes =?ISO-8859-1?Q?Schl=FCter?=) On Mon, 2011-11-07 at 16:58 +0000, Clint M Priest wrote: > I'm sure the problem is that I hadn't modified the .l file as Nikita > suggested, which I have now done but the build doesn't seem to be > affected by changes to that file so I'm trying to find out how to make > that occur. I believe it's via re2c which I have installed but a make > clean/make still results in the same error. > > Is there something I need to run to process zend_language_scanner.l? After installing re2c re-run configure. check the configure output for re2c references. We don't expect Average Joe to have it installed and fail silently if it's not detected. You can also delete zend_language_scanner.c. johannes > -----Original Message----- > From: Nikita Popov [mailto:nikita.ppv@googlemail.com] > Sent: Monday, November 07, 2011 12:12 AM > To: php-dev@zerocue.com > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] Help w/ Parser > > I don't see an attachment. Could you send it again with .txt as file extension? > > If you want 'get' to be recognized as T_GET you need to define such a token in the lexer (zend_language_scanner.l). Did you do that? > > On Mon, Nov 7, 2011 at 3:53 AM, wrote: > > I'm having trouble getting some changes to the parser to recognize > > some new syntax. I've attached a patch of what I've done. > > > > > > > > Here is the syntax I am trying to get to be parsed properly: > > > > > > > class TimePeriod { > > > > > > > > public $Seconds; > > > > > > > > public function __construct($Seconds) { > > > > $this->Seconds = $Seconds; > > > > } > > > > // Getters/Setters > > > > public $Hours { > > > > get { return $this->Seconds / 3600; } > > > > set { $this->Seconds = $value * 3600; } // The variable > > $value holds the incoming value to be "set" > > > > } > > > > }; > > > > ?> > > > > > > > > After compiling and attempting to execute the above PHP file, I'm > > getting this parse error: > > > > > > > > Parse error: syntax error, unexpected 'get' (T_STRING), expecting get > > (T_GET) or set (T_SET) in /mnt/hgfs/svn/php-src-test/test.php on line > > 13 > > > > > > > > Why is the parse recognizing the 'get' as T_STRING rather than get (T_GET)? > > > > > > > > Thanks, > > > > > > > > -Clint > > > > -- > > PHP Internals - PHP Runtime Development Mailing List To unsubscribe, > > visit: http://www.php.net/unsub.php > > >