Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:56087 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8647 invoked from network); 7 Nov 2011 09:12:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Nov 2011 09:12:26 -0000 Authentication-Results: pb1.pair.com header.from=ava3ar@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ava3ar@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: ava3ar@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:63341] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FC/10-03509-9F0A7BE4 for ; Mon, 07 Nov 2011 04:12:25 -0500 Received: by vcbfl10 with SMTP id fl10so67374vcb.29 for ; Mon, 07 Nov 2011 01:12:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Axf/wmY/KfGMGX823FZN9O7MA9IyxtPmqg3T8uQMbl8=; b=Hye4u+Huw8l20fT1H3AdgibhODLT8/r1inYttFcjbMaKQDt+9yYG//cMBtu6hC5X9I LuJB8wE+V1lPsm7mrXVFvvbo1/bu22sOFsC/4O9mZZkTJXIUf2v6anE37UOn/dN9iJtq LYMMHFWdmj21gSV8VYocOd4YtpG9GOlzTfFfQ= Received: by 10.52.173.113 with SMTP id bj17mr25429887vdc.98.1320657142120; Mon, 07 Nov 2011 01:12:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.159.203 with HTTP; Mon, 7 Nov 2011 01:12:01 -0800 (PST) In-Reply-To: References: <000001cc9cf8$7ec899c0$7c59cd40$@zerocue.com> Date: Mon, 7 Nov 2011 09:12:01 +0000 Message-ID: To: Nikita Popov Cc: php-dev@zerocue.com, internals@lists.php.net Content-Type: multipart/alternative; boundary=bcaec51ba055d380d704b12173a4 Subject: Re: [PHP-DEV] Help w/ Parser From: ava3ar@gmail.com (Keloran) --bcaec51ba055d380d704b12173a4 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable this looks cool if you get it to work, move the object-orientation forwards quite abit On Mon, Nov 7, 2011 at 6:11 AM, Nikita Popov wro= te: > 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=92m having trouble getting some changes to the parser to recognize so= me > new > > syntax. 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 { > > > > > > > > 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 $v= alue > > holds the incoming value to be "set" > > > > } > > > > }; > > > > ?> > > > > > > > > After compiling and attempting to execute the above PHP file, I=92m get= ting > > 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 1= 3 > > > > > > > > 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 > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --bcaec51ba055d380d704b12173a4--