Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:47092 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68694 invoked from network); 6 Mar 2010 09:48:48 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Mar 2010 09:48:48 -0000 Authentication-Results: pb1.pair.com smtp.mail=rumi.kg@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rumi.kg@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.220 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rumi.kg@gmail.com X-Host-Fingerprint: 209.85.219.220 mail-ew0-f220.google.com Received: from [209.85.219.220] ([209.85.219.220:62289] helo=mail-ew0-f220.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/82-47356-EF4229B4 for ; Sat, 06 Mar 2010 04:48:47 -0500 Received: by ewy20 with SMTP id 20so945235ewy.1 for ; Sat, 06 Mar 2010 01:48:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=+ZVjmp/N/bDv+sOmUXCdrg4v7glDfXK/pjBhIc8OVOE=; b=V+ATAQ7DUIFvB8BK3WCGNZJAQI/4LkHUjllSVANIw5Bih2XRAManNZdnVwZJxyWC40 KhIEQgO68DyASswQ2DsVyAAYP3qCtbMYRFnlQYfTqtjFjskYadbDd3v5YL2NxlZf5zy/ OBOxKeeIsutg5O5+hA8GyEAolej7R21t9UAQI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=MpCFxYntNr9isAkfxoRRsh3dRUem178QMR9YDWSNSWS3rZpL8UQJusC/T45NvhrXX5 0EpETnCUU/uZ0O2W5ij9aWqJajZRO1vN0FdfX99oy3Snb8pVJnZQCiHCBDQDGbxDSoSj NO5FEO8JrDyZZXqLgCOj0qXz53XZBowdE73x8= MIME-Version: 1.0 Received: by 10.213.100.201 with SMTP id z9mr1221229ebn.65.1267868923576; Sat, 06 Mar 2010 01:48:43 -0800 (PST) In-Reply-To: <9db916bc1003060129p7ef6801an188b838792612993@mail.gmail.com> References: <9db916bc1003060129p7ef6801an188b838792612993@mail.gmail.com> Date: Sat, 6 Mar 2010 10:48:43 +0100 Message-ID: <9db916bc1003060148q31aae80dv586c2fdf20fd1b69@mail.gmail.com> To: internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Hacking language syntax From: rumi.kg@gmail.com (Rune Kaagaard) The files you want to change in PHP core are the lexer (http://code.google.com/p/php-alternative-syntax/source/browse/trunk/php-5.3.0/Zend/zend_language_scanner.l) and the scanner (http://code.google.com/p/php-alternative-syntax/source/browse/trunk/php-5.3.0/Zend/zend_language_parser.y) and then recompile. Unfortunately this approach makes your PHP code incompatible with all other PHP installations. Furthermore the learning code is _very_ steep because the files are pretty messy and hardly commented (IMO), which makes everything but the simplest of changes pretty hard. I walked down the same road you are now contemplating with http://code.google.com/p/php-alternative-syntax/ but soon abandoned the idea :) I collected some information about opcodes and the Zend core here: http://code.google.com/p/php-alternative-syntax/source/browse/#svn/trunk/documentation they might be useful for you. At the moment - being interested in language design - I'm contemplating building a meta language that compiles down to PHP instead which would keep things compatible. If you are interested it is called "snow" and looks like http://pastebin.com/9h1d3RpN . Cheers Rune