Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56084 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77312 invoked from network); 7 Nov 2011 06:11:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2011 06:11:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.161.42 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:45300] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 10/D2-26948-89677BE4 for ; Mon, 07 Nov 2011 01:11:36 -0500 Received: by faan2 with SMTP id n2so1542208faa.29 for ; Sun, 06 Nov 2011 22:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=/q9yPdzeVZUFVOVHCtjB597cDh30H8gGy5n0bOqoUhs=; b=anCwU8seONvqGm5otNfwDaaQuQIlo52CAiPWIDNTl5eQs6hbP/gfGZc88vEZqwGIfl E0qmH9FmBwAkfB96EDBYu7Z9NBXpH5b3BfwzroyQhT2Zj1yBj4sisGq1KKHUZG0gFB6q bHToeP5BoP7O4fSC8vzzKu4PelbrxPtd7+Wog= MIME-Version: 1.0 Received: by 10.152.105.67 with SMTP id gk3mr5780707lab.48.1320646293297; Sun, 06 Nov 2011 22:11:33 -0800 (PST) Received: by 10.152.12.10 with HTTP; Sun, 6 Nov 2011 22:11:33 -0800 (PST) In-Reply-To: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> References: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> Date: Mon, 7 Nov 2011 07:11:33 +0100 Message-ID: To: php-dev@zerocue.com Cc: internals@lists.php.net Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Help w/ Parser From: nikita.ppv@googlemail.com (Nikita Popov) 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=92m having trouble getting some changes to the parser to recognize some= new > syntax.=A0 I=92ve attached a patch of what I=92ve 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 $value > holds the incoming value to be "set" > > =A0=A0=A0=A0 } > > }; > > ?> > > > > After compiling and attempting to execute the above PHP file, I=92m getti= ng > 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 =91get=92 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 >