Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #7668 > unrolled thread

Simple expression parser for PHP.

Started byDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
First post2012-11-30 15:56 -0800
Last post2012-12-10 09:40 -0800
Articles 20 on this page of 36 — 10 participants

Back to article view | Back to comp.lang.php


Contents

  Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-11-30 15:56 -0800
    Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-01 18:58 +0100
      Re: Simple expression parser for PHP. Allodoxaphobia <knock_yourself_out@example.net> - 2012-12-01 18:09 +0000
      Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-01 11:06 -0800
        Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-02 12:45 +0100
          Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 09:28 -0800
            Re: Simple expression parser for PHP. Shake <QUITAESTO@QUITAESTO.NOES> - 2012-12-03 18:44 +0100
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 10:06 -0800
                Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-03 21:04 +0100
            Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-03 20:59 +0100
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 12:30 -0800
                Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-03 23:09 +0100
            Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-03 20:39 +0000
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 15:58 -0800
                Re: Simple expression parser for PHP. Jerry Stuckle <jstucklex@attglobal.net> - 2012-12-03 20:50 -0500
                  Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 18:40 -0800
                    Re: Simple expression parser for PHP. "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-12-04 09:49 +0100
                      Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-04 09:34 +0000
                      Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-04 10:09 -0800
                Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-04 03:52 +0000
                  Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 22:24 -0800
                Re: Simple expression parser for PHP. Anders Wegge Keller <wegge@wegge.dk> - 2012-12-04 13:49 +0100
                  Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-04 10:20 -0800
                    Re: Simple expression parser for PHP. Anders Wegge Keller <wegge@wegge.dk> - 2012-12-04 19:52 +0100
              Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-03 17:18 -0800
                Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-04 11:55 +0100
                  Re: Simple expression parser for PHP. Tim Streater <timstreater@greenbee.net> - 2012-12-04 10:58 +0000
                  Re: Simple expression parser for PHP. Scott Johnson <noonehome@chalupasworld.com> - 2012-12-04 05:54 -0800
                    Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-04 15:29 +0100
                      Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-04 10:25 -0800
                        Re: Simple expression parser for PHP. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-12-04 23:23 +0100
                      Re: Simple expression parser for PHP. Scott Johnson <noonehome@chalupasworld.com> - 2012-12-04 23:58 -0800
                    Re: Simple expression parser for PHP. Jerry Stuckle <jstucklex@attglobal.net> - 2012-12-04 10:36 -0500
                    Re: Simple expression parser for PHP. The Natural Philosopher <tnp@invalid.invalid> - 2012-12-05 09:24 +0000
                      Re: Simple expression parser for PHP. Scott Johnson <noonehome@chalupasworld.com> - 2012-12-06 16:53 -0800
    Re: Simple expression parser for PHP. Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-12-10 09:40 -0800

Page 1 of 2  [1] 2  Next page →


#7668 — Simple expression parser for PHP.

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-11-30 15:56 -0800
SubjectSimple expression parser for PHP.
Message-ID<mIbus.31680$_c1.31329@newsfe16.iad>
Hello,
I have a requirement that I need to take an expression and evaluate it. 
  I'd very much like to avoid using PHP's eval(), for obvious reasons. 
I'm kind of looking for something that is similar to OGNL (a Java 
library for expressions).

Speed is a plus, ease of integration is a nice-to-have. Low bug density 
and active community is also a plus.

[toc] | [next] | [standalone]


#7672

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-01 18:58 +0100
Message-ID<25576097.vU8W1YSclW@PointedEars.de>
In reply to#7668
Daniel Pitts wrote:

> I have a requirement that I need to take an expression and evaluate it.
> 
>   I'd very much like to avoid using PHP's eval(), for obvious reasons.
> I'm kind of looking for something that is similar to OGNL (a Java
> library for expressions).
> 
> Speed is a plus, ease of integration is a nice-to-have. Low bug density
> and active community is also a plus.

What kind of expression are you talking about?


PointedEars
-- 
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
  -- Richard Cornford, comp.lang.javascript, 2011-11-14

[toc] | [prev] | [next] | [standalone]


#7673

FromAllodoxaphobia <knock_yourself_out@example.net>
Date2012-12-01 18:09 +0000
Message-ID<slrnkbkhv0.2s9r.knock_yourself_out@vps.jonz.net>
In reply to#7672
On Sat, 01 Dec 2012 18:58:03 +0100, Thomas 'PointedEars' Lahn wrote:
> Daniel Pitts wrote:
>
>> I have a requirement that I need to take an expression and evaluate it.
>> 
>>   I'd very much like to avoid using PHP's eval(), for obvious reasons.
>> I'm kind of looking for something that is similar to OGNL (a Java
>> library for expressions).
>> 
>> Speed is a plus, ease of integration is a nice-to-have. Low bug density
>> and active community is also a plus.
>
> What kind of expression are you talking about?

 "Have a nice day."    :-)

[toc] | [prev] | [next] | [standalone]


#7674

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-01 11:06 -0800
Message-ID<_ysus.11073$8M.10572@newsfe03.iad>
In reply to#7672
On 12/1/12 9:58 AM, Thomas 'PointedEars' Lahn wrote:
> Daniel Pitts wrote:
>
>> I have a requirement that I need to take an expression and evaluate it.
>>
>>    I'd very much like to avoid using PHP's eval(), for obvious reasons.
>> I'm kind of looking for something that is similar to OGNL (a Java
>> library for expressions).
>>
>> Speed is a plus, ease of integration is a nice-to-have. Low bug density
>> and active community is also a plus.
>
> What kind of expression are you talking about?

Things along the lines of "request['some_attribute']" or "3 * someValue" 
etc... Where I can specify the objects available to act upon ('request' 
in the first example, 'someValue' in the second).

Some method of traversing object graphs would be useful as well.  Like I 
said, something similar to OGNL, but for PHP instead.

[toc] | [prev] | [next] | [standalone]


#7675

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-02 12:45 +0100
Message-ID<150517755.VHYi74ehju@PointedEars.de>
In reply to#7674
Daniel Pitts wrote:

> On 12/1/12 9:58 AM, Thomas 'PointedEars' Lahn wrote:
>> Daniel Pitts wrote:
>>> I have a requirement that I need to take an expression and evaluate it.
>>>
>>>    I'd very much like to avoid using PHP's eval(), for obvious reasons.
>>> I'm kind of looking for something that is similar to OGNL (a Java
>>> library for expressions).
>>>
>>> Speed is a plus, ease of integration is a nice-to-have. Low bug density
>>> and active community is also a plus.
>>
>> What kind of expression are you talking about?
> 
> Things along the lines of "request['some_attribute']" or "3 * someValue"
> etc... Where I can specify the objects available to act upon ('request'
> in the first example, 'someValue' in the second).
> 
> Some method of traversing object graphs would be useful as well.  Like I
> said, something similar to OGNL, but for PHP instead.

What do you need this for?


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [next] | [standalone]


#7685

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-03 09:28 -0800
Message-ID<Wi5vs.31351$Sm5.28145@newsfe25.iad>
In reply to#7675
On 12/2/12 3:45 AM, Thomas 'PointedEars' Lahn wrote:
> Daniel Pitts wrote:
>
>> On 12/1/12 9:58 AM, Thomas 'PointedEars' Lahn wrote:
>>> Daniel Pitts wrote:
>>>> I have a requirement that I need to take an expression and evaluate it.
>>>>
>>>>     I'd very much like to avoid using PHP's eval(), for obvious reasons.
>>>> I'm kind of looking for something that is similar to OGNL (a Java
>>>> library for expressions).
>>>>
>>>> Speed is a plus, ease of integration is a nice-to-have. Low bug density
>>>> and active community is also a plus.
>>>
>>> What kind of expression are you talking about?
>>
>> Things along the lines of "request['some_attribute']" or "3 * someValue"
>> etc... Where I can specify the objects available to act upon ('request'
>> in the first example, 'someValue' in the second).
>>
>> Some method of traversing object graphs would be useful as well.  Like I
>> said, something similar to OGNL, but for PHP instead.
>
> What do you need this for?
A program I'm writing. What's it to you? I've given the specific 
requirements. ;-)

More specifically, it is to ease configuration of my program. The 
expressions are going to be embedded into a DSL (domain-specific 
language) for declaring a part of the business logic.

I'm trying to avoid using "eval" or forcing someone to write a PHP 
function and reference that function by name.  Most of the time, the 
expressions are so simple, and only make sense in the context they 
appear in the DSL.

Thanks,
Daniel.

[toc] | [prev] | [next] | [standalone]


#7687

FromShake <QUITAESTO@QUITAESTO.NOES>
Date2012-12-03 18:44 +0100
Message-ID<k9iodq$ko9$1@dont-email.me>
In reply to#7685
Perhaps some work with "variable variables" can help


http://php.net/manual/en/language.variables.variable.php

Rgds.

[toc] | [prev] | [next] | [standalone]


#7688

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-03 10:06 -0800
Message-ID<bS5vs.54560$Sv5.5501@newsfe05.iad>
In reply to#7687
On 12/3/12 9:44 AM, Shake wrote:
>
> Perhaps some work with "variable variables" can help
>
>
> http://php.net/manual/en/language.variables.variable.php

Not really.  Also, that is an ugly ugly language feature.

[toc] | [prev] | [next] | [standalone]


#7692

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-03 21:04 +0100
Message-ID<3242086.c4pj7VVjfD@PointedEars.de>
In reply to#7688
Daniel Pitts wrote:

> On 12/3/12 9:44 AM, Shake wrote:
>> Perhaps some work with "variable variables" can help
>>
>> http://php.net/manual/en/language.variables.variable.php
> 
> Not really.  Also, that is an ugly ugly language feature.

It is a rather nice and useful language feature if written properly. That 
is, not “$$x”, but “${$x}”.  And variable property access is certainly 
useful in this case, considering “__get()” and “__set()”.


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#7691

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-03 20:59 +0100
Message-ID<10607116.X5usb9AkeZ@PointedEars.de>
In reply to#7685
Daniel Pitts wrote:

> On 12/2/12 3:45 AM, Thomas 'PointedEars' Lahn wrote:
>> Daniel Pitts wrote:
>>> On 12/1/12 9:58 AM, Thomas 'PointedEars' Lahn wrote:
>>>> Daniel Pitts wrote:
>>>>> I have a requirement that I need to take an expression and evaluate
>>>>> it.
>>>>>
>>>>>     I'd very much like to avoid using PHP's eval(), for obvious
>>>>>     reasons.
>>>>> I'm kind of looking for something that is similar to OGNL (a Java
>>>>> library for expressions).
>>>>>
>>>>> Speed is a plus, ease of integration is a nice-to-have. Low bug
>>>>> density and active community is also a plus.
>>>>
>>>> What kind of expression are you talking about?
>>>
>>> Things along the lines of "request['some_attribute']" or "3 * someValue"
>>> etc... Where I can specify the objects available to act upon ('request'
>>> in the first example, 'someValue' in the second).
>>>
>>> Some method of traversing object graphs would be useful as well.  Like I
>>> said, something similar to OGNL, but for PHP instead.
>>
>> What do you need this for?
> A program I'm writing. What's it to you?

I am someone who could help you solve this problem.

> I've given the specific requirements. ;-)
 
ISTM you want a person writing or finding that software for you without any 
real effort on your part.  If so, you are wrong here; there are smart but 
starving PHP developers out there who you should *pay* for that instead.  
The smiley does not change anything.

> More specifically, it is to ease configuration of my program. The
> expressions are going to be embedded into a DSL (domain-specific
> language) for declaring a part of the business logic.

I would suggest you look more into the features of PHP instead of inventing 
another OGNL-like expression language to be parsed with PHP.  Without 
knowing OGNL [1] well or having used it before, ISTM that many of the things 
that OGNL extends Java syntax with are built into PHP these days.

For example, accessing properties instead of calling methods is facilitated 
with the __get() and __set() magic methods. [2]  PHP 5.4 even allows 
accessing the items of array return values directly, which allows for 
“$root->foo()["bar"]” or “$root->foo()[0]”. [3]  (For PHP 5.3 there can be a 
fallback, line “$root->foo()->items(0)”).

Further inspiration, which is probably going to use closures (introduced in 
PHP 5.3, improved in PHP 5.4 [3]), can be drawn from Microsoft LINQ [4]; 
there is an implementation of that in PHP already [5].  Even if that is not 
useful to you, writing that parser (using PHP's PCRE support [6]) should not 
be too difficult a task.

> I'm trying to avoid using "eval" or forcing someone to write a PHP
> function and reference that function by name.

I can understand that and, JFYI, I had understood that already.

> Most of the time, the expressions are so simple, and only make sense in
> the context they appear in the DSL.

If you say so.


PointedEars
___________
[1] <http://commons.apache.org/ognl/>
[2] <http://php.net/manual/en/language.oop5.magic.php>
[3] <http://php.net/manual/en/migration54.new-features.php>
[4] <http://msdn.microsoft.com/en-us/library/vstudio/bb397926.aspx>
[5] <http://phplinq.codeplex.com/>
[6] <http://php.net/manual/en/book.pcre.php>
-- 
    realism:    HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness:    XHTML 1.1 as application/xhtml+xml
                                                    -- Bjoern Hoehrmann

[toc] | [prev] | [next] | [standalone]


#7693

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-03 12:30 -0800
Message-ID<PZ7vs.1$3R7.0@newsfe10.iad>
In reply to#7691
On 12/3/12 11:59 AM, Thomas 'PointedEars' Lahn wrote:
> Daniel Pitts wrote:
>
>> On 12/2/12 3:45 AM, Thomas 'PointedEars' Lahn wrote:
>>> Daniel Pitts wrote:
>>>> On 12/1/12 9:58 AM, Thomas 'PointedEars' Lahn wrote:
>>>>> Daniel Pitts wrote:
>>>>>> I have a requirement that I need to take an expression and evaluate
>>>>>> it.
>>>>>>
>>>>>>      I'd very much like to avoid using PHP's eval(), for obvious
>>>>>>      reasons.
>>>>>> I'm kind of looking for something that is similar to OGNL (a Java
>>>>>> library for expressions).
>>>>>>
>>>>>> Speed is a plus, ease of integration is a nice-to-have. Low bug
>>>>>> density and active community is also a plus.
>>>>>
>>>>> What kind of expression are you talking about?
>>>>
>>>> Things along the lines of "request['some_attribute']" or "3 * someValue"
>>>> etc... Where I can specify the objects available to act upon ('request'
>>>> in the first example, 'someValue' in the second).
>>>>
>>>> Some method of traversing object graphs would be useful as well.  Like I
>>>> said, something similar to OGNL, but for PHP instead.
>>>
>>> What do you need this for?
>> A program I'm writing. What's it to you?
>
> I am someone who could help you solve this problem.
>
>> I've given the specific requirements. ;-)
>
> ISTM you want a person writing or finding that software for you without any
> real effort on your part.  If so, you are wrong here; there are smart but
> starving PHP developers out there who you should *pay* for that instead.
> The smiley does not change anything.
I am, of course, trying to do this with the least amount of effort on my 
part possible. A lazy engineer is an efficient engineer ;-).  This is 
part of a rather large project for the rather large company I work for, 
so we are already paying PHP developers.  I'm not asking for anyone to 
create something for free, only trying to find out what is already out 
there. An hour of googling didn't really turn up much, so I thought I'd 
turn to the community.

>> More specifically, it is to ease configuration of my program. The
>> expressions are going to be embedded into a DSL (domain-specific
>> language) for declaring a part of the business logic.
>
> I would suggest you look more into the features of PHP instead of inventing
> another OGNL-like expression language to be parsed with PHP.  Without
> knowing OGNL [1] well or having used it before, ISTM that many of the things
> that OGNL extends Java syntax with are built into PHP these days.
Perhaps.
>
> For example, accessing properties instead of calling methods is facilitated
> with the __get() and __set() magic methods. [2]  PHP 5.4 even allows
> accessing the items of array return values directly, which allows for
> “$root->foo()["bar"]” or “$root->foo()[0]”. [3]  (For PHP 5.3 there can be a
> fallback, line “$root->foo()->items(0)”).
Sure it can access a single value, but can you do math in that as well? 
String concatenation?
For example, I may have an expression such as: $myObject['someValue'] * 3

>
> Further inspiration, which is probably going to use closures (introduced in
> PHP 5.3, improved in PHP 5.4 [3]), can be drawn from Microsoft LINQ [4];
> there is an implementation of that in PHP already [5].  Even if that is not
> useful to you, writing that parser (using PHP's PCRE support [6]) should not
> be too difficult a task.
>
>> I'm trying to avoid using "eval" or forcing someone to write a PHP
>> function and reference that function by name.
>
> I can understand that and, JFYI, I had understood that already.
>
>> Most of the time, the expressions are so simple, and only make sense in
>> the context they appear in the DSL.
>
> If you say so.
Even if I don't say so, this is a fact of my project.


In any case, thanks for all the links, I'll look through the ones I 
don't know anything about for inspiration.
>
>
> PointedEars
> ___________
> [1] <http://commons.apache.org/ognl/>
> [2] <http://php.net/manual/en/language.oop5.magic.php>
> [3] <http://php.net/manual/en/migration54.new-features.php>
> [4] <http://msdn.microsoft.com/en-us/library/vstudio/bb397926.aspx>
> [5] <http://phplinq.codeplex.com/>
> [6] <http://php.net/manual/en/book.pcre.php>
>

[toc] | [prev] | [next] | [standalone]


#7695

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2012-12-03 23:09 +0100
Message-ID<1890394.JZUSze7zFj@PointedEars.de>
In reply to#7693
Daniel Pitts wrote:

> On 12/3/12 11:59 AM, Thomas 'PointedEars' Lahn wrote:
>> Daniel Pitts wrote:
>>> I've given the specific requirements. ;-)
>>
>> ISTM you want a person writing or finding that software for you without
>> any real effort on your part.  If so, you are wrong here; there are smart
>> but starving PHP developers out there who you should *pay* for that
>> instead. The smiley does not change anything.
> 
> I am, of course, trying to do this with the least amount of effort on my
> part possible. A lazy engineer is an efficient engineer ;-).  This is
> part of a rather large project for the rather large company I work for,
> so we are already paying PHP developers.  I'm not asking for anyone to
> create something for free, only trying to find out what is already out
> there. An hour of googling didn't really turn up much, so I thought I'd
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> turn to the community.

ACK, that is different, of course.  You should say so, and tell the keywords 
you have searched with, from the start next time.

>> For example, accessing properties instead of calling methods is
>> facilitated with the __get() and __set() magic methods. [2]  PHP 5.4 even
>> allows accessing the items of array return values directly, which allows
>> for “$root->foo()["bar"]” or “$root->foo()[0]”. [3]  (For PHP 5.3 there
>> can be a fallback, line “$root->foo()->items(0)”).
> 
> Sure it can access a single value, but can you do math in that as well?

Like what?

> String concatenation?

String concatenation is a built-in.  But if you must, you can do it step by 
step.

> For example, I may have an expression such as: $myObject['someValue'] * 3

I fail to see the use-case.

> In any case, thanks for all the links, I'll look through the ones I
> don't know anything about for inspiration.

You're welcome.

Please trim your quotes and add an empty line before each of your blocks of 
new text next time.


PointedEars
-- 
When all you know is jQuery, every problem looks $(olvable).

[toc] | [prev] | [next] | [standalone]


#7694

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-12-03 20:39 +0000
Message-ID<k9j2ms$kp8$1@news.albasani.net>
In reply to#7685
On 03/12/12 17:28, Daniel Pitts wrote:
> On 12/2/12 3:45 AM, Thomas 'PointedEars' Lahn wrote:
>> Daniel Pitts wrote:
>>
>>> On 12/1/12 9:58 AM, Thomas 'PointedEars' Lahn wrote:
>>>> Daniel Pitts wrote:
>>>>> I have a requirement that I need to take an expression and evaluate
>>>>> it.
>>>>>
>>>>>     I'd very much like to avoid using PHP's eval(), for obvious
>>>>> reasons.
>>>>> I'm kind of looking for something that is similar to OGNL (a Java
>>>>> library for expressions).
>>>>>
>>>>> Speed is a plus, ease of integration is a nice-to-have. Low bug
>>>>> density
>>>>> and active community is also a plus.
>>>>
>>>> What kind of expression are you talking about?
>>>
>>> Things along the lines of "request['some_attribute']" or "3 * someValue"
>>> etc... Where I can specify the objects available to act upon ('request'
>>> in the first example, 'someValue' in the second).
>>>
>>> Some method of traversing object graphs would be useful as well.  Like I
>>> said, something similar to OGNL, but for PHP instead.
>>
>> What do you need this for?
> A program I'm writing. What's it to you? I've given the specific
> requirements. ;-)
>
> More specifically, it is to ease configuration of my program. The
> expressions are going to be embedded into a DSL (domain-specific
> language) for declaring a part of the business logic.
>
> I'm trying to avoid using "eval" or forcing someone to write a PHP
> function and reference that function by name.  Most of the time, the
> expressions are so simple, and only make sense in the context they
> appear in the DSL.
>
> Thanks,
> Daniel.
>
I still havent a clue what you are talking about.

Hint: smart people make complex things understandable by good 
description. Stupid people make simple things incomprehensible, to make 
them look smarter than they really are. Or at least that's what they 
think...



-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#7697

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-03 15:58 -0800
Message-ID<d0bvs.3$Id.0@newsfe24.iad>
In reply to#7694
On 12/3/12 12:39 PM, The Natural Philosopher wrote:
> I still havent a clue what you are talking about.
>
> Hint: smart people make complex things understandable by good
> description.
Indeed, that much is true. To a point.

> Stupid people make simple things incomprehensible, to make
> them look smarter than they really are. Or at least that's what they
> think...
We'll, I don't *intentionally* make anything incomprehensible.  I also 
don't intentionally insult someone who asks a question I can't comprehend.

I'm working on some core framework for a large project. For one part of 
this framework, I want to provide a simple, but powerful configuration 
language. The configuration language is best expressed using a 
Declarative syntax.

I have the rest of the configuration language worked out, but there is a 
need to have some of the configured values be "calculated" real time, 
based on some context.

My trouble here is not that I'm trying to look smarter, but that I'm 
trying to minimize exposing proprietary information of my employer.

[toc] | [prev] | [next] | [standalone]


#7700

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-12-03 20:50 -0500
Message-ID<k9jktj$21u$1@dont-email.me>
In reply to#7697
On 12/3/2012 6:58 PM, Daniel Pitts wrote:
> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>> I still havent a clue what you are talking about.
>>
>> Hint: smart people make complex things understandable by good
>> description.
> Indeed, that much is true. To a point.
>
>> Stupid people make simple things incomprehensible, to make
>> them look smarter than they really are. Or at least that's what they
>> think...
> We'll, I don't *intentionally* make anything incomprehensible.  I also
> don't intentionally insult someone who asks a question I can't comprehend.
>
> I'm working on some core framework for a large project. For one part of
> this framework, I want to provide a simple, but powerful configuration
> language. The configuration language is best expressed using a
> Declarative syntax.
>
> I have the rest of the configuration language worked out, but there is a
> need to have some of the configured values be "calculated" real time,
> based on some context.
>
> My trouble here is not that I'm trying to look smarter, but that I'm
> trying to minimize exposing proprietary information of my employer.

Daniel, I see you've run into two of the newsgroup trolls (TNP and 
"Pointed Head").  You'll be best off ignoring them - they can't help 
you, and will cause you no end of grief.

I found your description quite clear, and really don't care WHY you need 
it (or what keywords you used to search).  I just don't know of any code 
samples for what you need.  Last time I needed something like that was 
several years ago (and another language, but that's besides the point). 
  It took a while, but I got it working for that project.

But I don't know of anything like this available.  You might drop a line 
to the webmaster of algebra.com.  He used to be a regular on here, and 
he has an expression parser in his code.  He might be able to help, or 
maybe not.  I haven't seen him around here for at least 2-3 years.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#7701

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-03 18:40 -0800
Message-ID<lodvs.40$pV4.13@newsfe21.iad>
In reply to#7700
On 12/3/12 5:50 PM, Jerry Stuckle wrote:
> Daniel, I see you've run into two of the newsgroup trolls (TNP and
> "Pointed Head").  You'll be best off ignoring them - they can't help
> you, and will cause you no end of grief.
>
> I found your description quite clear, and really don't care WHY you need
> it (or what keywords you used to search).  I just don't know of any code
> samples for what you need.  Last time I needed something like that was
> several years ago (and another language, but that's besides the point).
>   It took a while, but I got it working for that project.
>
> But I don't know of anything like this available.  You might drop a line
> to the webmaster of algebra.com.  He used to be a regular on here, and
> he has an expression parser in his code.  He might be able to help, or
> maybe not.  I haven't seen him around here for at least 2-3 years.

Thanks Jerry.  I appreciate it.

[toc] | [prev] | [next] | [standalone]


#7704

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-12-04 09:49 +0100
Message-ID<ai5ro2Fgih4U1@mid.uni-berlin.de>
In reply to#7701
Am 04.12.2012 03:40, schrieb Daniel Pitts:
> On 12/3/12 5:50 PM, Jerry Stuckle wrote:
>> Daniel, I see you've run into two of the newsgroup trolls (TNP and
>> "Pointed Head").  You'll be best off ignoring them - they can't help
>> you, and will cause you no end of grief.
>>
>> I found your description quite clear, and really don't care WHY you need
>> it (or what keywords you used to search).  I just don't know of any code
>> samples for what you need.  Last time I needed something like that was
>> several years ago (and another language, but that's besides the point).
>>   It took a while, but I got it working for that project.
>>
>> But I don't know of anything like this available.  You might drop a line
>> to the webmaster of algebra.com.  He used to be a regular on here, and
>> he has an expression parser in his code.  He might be able to help, or
>> maybe not.  I haven't seen him around here for at least 2-3 years.
> 
> Thanks Jerry.  I appreciate it.
> 

You should be aware that he only expressed _his_ opinion.

/Str.

[toc] | [prev] | [next] | [standalone]


#7705

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-12-04 09:34 +0000
Message-ID<k9kg38$g97$1@news.albasani.net>
In reply to#7704
On 04/12/12 08:49, M. Strobel wrote:
> Am 04.12.2012 03:40, schrieb Daniel Pitts:
>> On 12/3/12 5:50 PM, Jerry Stuckle wrote:
>>> Daniel, I see you've run into two of the newsgroup trolls (TNP and
>>> "Pointed Head").  You'll be best off ignoring them - they can't help
>>> you, and will cause you no end of grief.
>>>
>>> I found your description quite clear, and really don't care WHY you need
>>> it (or what keywords you used to search).  I just don't know of any code
>>> samples for what you need.  Last time I needed something like that was
>>> several years ago (and another language, but that's besides the point).
>>>    It took a while, but I got it working for that project.
>>>
>>> But I don't know of anything like this available.  You might drop a line
>>> to the webmaster of algebra.com.  He used to be a regular on here, and
>>> he has an expression parser in his code.  He might be able to help, or
>>> maybe not.  I haven't seen him around here for at least 2-3 years.
>>
>> Thanks Jerry.  I appreciate it.
>>
>
> You should be aware that he only expressed _his_ opinion.
>
And that in fact he is King Troll here..


> /Str.
>


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#7712

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-12-04 10:09 -0800
Message-ID<V%qvs.4259$pV4.2610@newsfe21.iad>
In reply to#7704
On 12/4/12 12:49 AM, M. Strobel wrote:
> Am 04.12.2012 03:40, schrieb Daniel Pitts:
>> On 12/3/12 5:50 PM, Jerry Stuckle wrote:
>>> Daniel, I see you've run into two of the newsgroup trolls (TNP and
>>> "Pointed Head").  You'll be best off ignoring them - they can't help
>>> you, and will cause you no end of grief.
>>>
>>> I found your description quite clear, and really don't care WHY you need
>>> it (or what keywords you used to search).  I just don't know of any code
>>> samples for what you need.  Last time I needed something like that was
>>> several years ago (and another language, but that's besides the point).
>>>    It took a while, but I got it working for that project.
>>>
>>> But I don't know of anything like this available.  You might drop a line
>>> to the webmaster of algebra.com.  He used to be a regular on here, and
>>> he has an expression parser in his code.  He might be able to help, or
>>> maybe not.  I haven't seen him around here for at least 2-3 years.
>>
>> Thanks Jerry.  I appreciate it.
>>
>
> You should be aware that he only expressed _his_ opinion.

I am aware of that. He is also the first who answered directly my 
question.  PointedEars seems like he's genuinely interested in helping 
me, but doesn't seem to believe me that I understand my requirements.

TNP on the other hand, seems like he wants to just insult me because 
*he* doesn't understand my description of my requirements. I use too 
many big words apparently.

[toc] | [prev] | [next] | [standalone]


#7702

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-12-04 03:52 +0000
Message-ID<k9js0v$lco$1@news.albasani.net>
In reply to#7697
On 03/12/12 23:58, Daniel Pitts wrote:
> On 12/3/12 12:39 PM, The Natural Philosopher wrote:
>> I still havent a clue what you are talking about.
>>
>> Hint: smart people make complex things understandable by good
>> description.
> Indeed, that much is true. To a point.
>
>> Stupid people make simple things incomprehensible, to make
>> them look smarter than they really are. Or at least that's what they
>> think...
> We'll, I don't *intentionally* make anything incomprehensible.  I also
> don't intentionally insult someone who asks a question I can't comprehend.
>
> I'm working on some core framework for a large project. For one part of
> this framework, I want to provide a simple, but powerful configuration
> language. The configuration language is best expressed using a
> Declarative syntax.
>
Declarative Syntax?? Like 'My knob is bigger than yours'? Thats a syntax 
that declares...


Configuration language? Like 'set variable X to 3'? That's an 
instruction in a language that configures x..

Stop talking buzz words and start talking English.


> I have the rest of the configuration language worked out, but there is a
> need to have some of the configured values be "calculated" real time,
> based on some context.
>

That's what programming languages do..
Are you trying to write an interpreter in php?


> My trouble here is not that I'm trying to look smarter, but that I'm
> trying to minimize exposing proprietary information of my employer.


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.php


csiph-web