Moving from -> to . for object operators?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Google Mike

    #1

    Moving from -> to . for object operators?

    Is there a way to change PHP's source and recompile so that I can use
    "." instead of "->" for the object operator? Of course, I would also
    change "." (the concat operator) to "&" or "+" for the concat
    operator.

    I think it's as simple as editing "zend_language_ scanner.l" from the
    source, changing "." to "&", and "->" to ".", then recompiling, but I
    haven't tested this. Has anyone done that before?
  • Jochen Daum

    #2
    Re: Moving from -> to . for object operators?

    Hi Google Mike!

    On 20 Oct 2003 13:54:47 -0700, googlemike@hotp op.com (Google Mike)
    wrote:
    [color=blue]
    >Is there a way to change PHP's source and recompile so that I can use
    >"." instead of "->" for the object operator? Of course, I would also
    >change "." (the concat operator) to "&" or "+" for the concat
    >operator.
    >
    >I think it's as simple as editing "zend_language_ scanner.l" from the
    >source, changing "." to "&", and "->" to ".", then recompiling, but I
    >haven't tested this. Has anyone done that before?[/color]

    Have you done that with any language before? Its all 1's and 0's in
    the end, but I doubt it is that easy. What about the + and the &
    operator. What about the ones you replace it with?

    SCNR,

    Jochen

    --
    Jochen Daum - CANS Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    http://sourceforge.net/projects/phpdbedittk/

    Comment

    • Google Mike

      #3
      Re: Moving from -> to . for object operators?

      Jochen Daum <jochen.daum@ca ns.co.nz> wrote[color=blue]
      > Have you done that with any language before? Its all 1's and 0's in
      > the end, but I doubt it is that easy. What about the + and the &
      > operator. What about the ones you replace it with?[/color]

      Nah. I think my suggested gameplan is the desired course. I'll attempt it.

      Comment

      • rush

        #4
        Re: Moving from -&gt; to . for object operators?

        "Google Mike" <googlemike@hot pop.com> wrote in message
        news:25d8d6a8.0 310201254.2740b c6c@posting.goo gle.com...[color=blue]
        > I think it's as simple as editing "zend_language_ scanner.l" from the
        > source, changing "." to "&", and "->" to ".", then recompiling, but I
        > haven't tested this. Has anyone done that before?[/color]

        What you suggest is equivalent of running sed (or any other search and
        replace) over your source and and changing "." to "&".

        While running sed would be much simpler than poking over the lex files,
        neither would work properly. You would need to get up in your arms in mud of
        scanner and parser to change things at least a bit meaningfully. And even
        then I am not sure that the grammar you are proposing can be implemented
        properly (for instance can you distinguish use of & as concat operator, and
        use of & as reference operator?)

        rush
        --




        Comment

        • sk

          #5
          Re: Moving from -&gt; to . for object operators?

          Does the ability to run all the millions of lines of existing PHP code
          bother you? Is this some way of forcing yourself to write all your own
          libraries and programs to do everything?

          While you're at it, maybe you should translate all the language keywords
          into Mingrelian and build your own keyboard out of peanut shells and
          bubblegum for writing Google Mike Mingrelian-Dotted-Notation PHP.

          Google Mike wrote:[color=blue]
          > Is there a way to change PHP's source and recompile so that I can use
          > "." instead of "->" for the object operator? Of course, I would also
          > change "." (the concat operator) to "&" or "+" for the concat
          > operator.
          >
          > I think it's as simple as editing "zend_language_ scanner.l" from the
          > source, changing "." to "&", and "->" to ".", then recompiling, but I
          > haven't tested this. Has anyone done that before?[/color]

          Comment

          • Jeffrey Silverman

            #6
            Re: Moving from -&gt; to . for object operators?

            On Tue, 21 Oct 2003 15:19:29 +0000, sk wrote:

            <snip!>[color=blue]
            > While you're at it, maybe you should translate all the language keywords
            > into Mingrelian and build your own keyboard out of peanut shells and
            > bubblegum for writing Google Mike Mingrelian-Dotted-Notation PHP.[/color]
            <snip!>

            That made me laugh out loud! Thanks.
            --
            Jeffrey D. Silverman | jeffrey AT jhu DOT edu
            Johns Hopkins University | Baltimore, MD
            Website | http://www.wse.jhu.edu/newtnotes/

            Comment

            Working...