bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PHP support


From: Chris Morley
Subject: Re: PHP support
Date: Thu, 28 Jun 2012 15:51:35 +0100

Hello Akim,

I have a project where I am evaluating moving a parser from C++ to PHP.

Wow.  I'm curious: what's the goal?

It is for a parser for a play be email game.

$$$ -> $
$$$$ -> $$
@@@ -> @

Why not.  I have no strong opinion.  Yet \$ would have seemed more natural
to me.  \$1, \$\$, address@hidden  What do you think?

I wondered the same thing, I don't have a strong opinion either.

I only picked $$$ because it is slightly easier to type than \$ IMO (on a UK keyboard).

One problem with \ is that then we need a means to escape it itself,
such as \\.

I don't think so, you only need to (greedy) match digraphs "\$" & "\@" and handle "\" as now.

e.g. flex rules
"\\$" obstack_sgrow (&obstack_for_string, "$][");
"\\@" obstack_sgrow (&obstack_for_string, "@@");


Single \ is used in C & PHP (e.g. namespaces) - requiring \\ to escape \ could break existing C macros.

This seems tidier to me than the PHP specific ifs in the scfc/bison_php code. It might be helpful to add this to the release with a argument to enable it.

I'm not sure the argument to enable is needed.

Sure, as I don't think it can break existing C/C++ grammar file actions.

Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]