Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56105 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6335 invoked from network); 7 Nov 2011 16:21:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2011 16:21:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=irker@irker.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=irker@irker.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain irker.net from 209.85.215.170 cause and error) X-PHP-List-Original-Sender: irker@irker.net X-Host-Fingerprint: 209.85.215.170 mail-ey0-f170.google.com Received: from [209.85.215.170] ([209.85.215.170:59219] helo=mail-ey0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 75/63-13242-A9508BE4 for ; Mon, 07 Nov 2011 11:21:48 -0500 Received: by eyg7 with SMTP id 7so3680469eyg.29 for ; Mon, 07 Nov 2011 08:21:44 -0800 (PST) Received: by 10.213.20.77 with SMTP id e13mr2401802ebb.75.1320682904141; Mon, 07 Nov 2011 08:21:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.34.13 with HTTP; Mon, 7 Nov 2011 08:21:23 -0800 (PST) In-Reply-To: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> References: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> Date: Mon, 7 Nov 2011 20:21:23 +0400 Message-ID: To: php-dev@zerocue.com Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary=0015174c0cbc5cc1ac04b1277316 Subject: Re: [PHP-DEV] Help w/ Parser From: irker@irker.net (=?UTF-8?B?0JDQu9C10LrRgdCw0L3QtNGAINCc0L7RgdC60LDQu9GR0LI=?=) --0015174c0cbc5cc1ac04b1277316 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable What about expressions between { } in getter_setter_declaration ? In your example we see "set {something}" and not "set {}" as you declared. Sorry if I wrong. I'm not C coder =3D) With regards, Alexander Moskaliov Irker@irker.net 2011/11/7 > I=E2=80=99m having trouble getting some changes to the parser to recogniz= e some > new syntax. I=E2=80=99ve attached a patch of what I=E2=80=99ve done.**** > > ** ** > > Here is the syntax I am trying to get to be parsed properly:**** > > > class TimePeriod {**** > > **** > > public $Seconds;**** > > ** ** > > public function __construct($Seconds) {**** > > $this->Seconds =3D $Seconds;**** > > }**** > > **** > > // Getters/Setters**** > > public $Hours {**** > > get { return $this->Seconds / 3600; }**** > > set { $this->Seconds =3D $value * 3600; } // The variable $val= ue > holds the incoming value to be "set"**** > > }**** > > };**** > > ?>**** > > ** ** > > After compiling and attempting to execute the above PHP file, I=E2=80=99m= 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 =E2=80=98get=E2=80=99 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 > --0015174c0cbc5cc1ac04b1277316--