Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56109 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13273 invoked from network); 7 Nov 2011 16:58:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2011 16:58:24 -0000 Authentication-Results: pb1.pair.com smtp.mail=cpriest@zerocue.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cpriest@zerocue.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zerocue.com designates 74.115.204.53 as permitted sender) X-PHP-List-Original-Sender: cpriest@zerocue.com X-Host-Fingerprint: 74.115.204.53 relay-hub203.domainlocalhost.com Received: from [74.115.204.53] ([74.115.204.53:55365] helo=relay-hub203.domainlocalhost.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3E/B4-13242-E2E08BE4 for ; Mon, 07 Nov 2011 11:58:24 -0500 Received: from MBX206.domain.local ([169.254.6.220]) by HUB203.domain.local ([74.115.204.53]) with mapi id 14.01.0289.001; Mon, 7 Nov 2011 11:58:19 -0500 To: Nikita Popov , Keloran CC: "internals@lists.php.net" Thread-Topic: [PHP-DEV] Help w/ Parser Thread-Index: Acyc9+LIVH31bUatS/eIW7rhOla9iwARh76AAAwXnXA= Date: Mon, 7 Nov 2011 16:58:18 +0000 Message-ID: <9570D903A3BECE4092E924C2985CE485397FF8AA@MBX206.domain.local> References: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.64.27] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: [PHP-DEV] Help w/ Parser From: cpriest@zerocue.com (Clint M Priest) I'm sure the problem is that I hadn't modified the .l file as Nikita sugges= ted, which I have now done but the build doesn't seem to be affected by cha= nges to that file so I'm trying to find out how to make that occur. I beli= eve it's via re2c which I have installed but a make clean/make still result= s in the same error. Is there something I need to run to process zend_language_scanner.l? -----Original Message----- From: Nikita Popov [mailto:nikita.ppv@googlemail.com]=20 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 extens= ion? 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=20 > some new syntax.=A0 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 { > > > > =A0=A0=A0=A0 public $Seconds; > > > > =A0=A0=A0=A0 public function __construct($Seconds) { > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 $this->Seconds =3D $Seconds; > > =A0=A0=A0=A0 } > > =A0=A0=A0=A0 // Getters/Setters > > =A0=A0=A0=A0 public $Hours { > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 get { return $this->Seconds / 3600; } > > =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 set { $this->Seconds =3D $value * 3600; } = // The variable=20 > $value holds the incoming value to be "set" > > =A0=A0=A0=A0 } > > }; > > ?> > > > > After compiling and attempting to execute the above PHP file, I'm=20 > 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=20 > 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,=20 > visit: http://www.php.net/unsub.php >