I can't say i'm familiar with what a string parser is???feyd wrote:I feel a string parser would fair a lot easier and faster (performance) to do this task.
Regex negative look behind???
Moderator: General Moderators
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
A very good idea.Maybe i'll just use the PHP tokenizer
You build it totally out of PHP. A search string parsing example can be found here (along with a competing, regexp solution) as well as another example built for parsing HTML.I can't say i'm familiar with what a string parser is???
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
IndeedAmbush Commander wrote:Would you like me to write one?
But what you mean string parser?
Your going to write an EBNF grammar and parsing framework in PHP???
Or a more trivial PHP class which knows only the rules which I stipulate earlier???
Is that what Feyd meant? That was kinda the route I was hoping to avoid, because locating statements is JUST one task of many which I wanted to perform on the source code...
It would be easier to just use the tokenizer functions...which I think i'm going to do anyways...originally I didn't want to...cuz the version of PHP I have installed on my local machine doesn't support tokenizer functions....but I guess thats easy enough to solve
Cheers
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
That one.Or a more trivial PHP class which knows only the rules which I stipulate earlier???
The PHP language isn't too hairy to deal with, but lexically speaking, why bother when you can have PHP's real lexer do it for you? I think, comparing the time tradeoff, that you'll get more bang for your buck installing a later version of PHP. I recommend 4.3.11.
I probably won't write one for you actually.
By the way...
And how would you go about reusing that regexp?Is that what Feyd meant? That was kinda the route I was hoping to avoid, because locating statements is JUST one task of many which I wanted to perform on the source code...
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Thats what I thought you/Feyd meant...Ambush Commander wrote:A very good idea.Maybe i'll just use the PHP tokenizer
You build it totally out of PHP. A search string parsing example can be found here (along with a competing, regexp solution) as well as another example built for parsing HTML.I can't say i'm familiar with what a string parser is???
I haven't attempted anything of the like since my introduction to CFG grammars a few years back...now i'm spoiled...and would have a hard time spending time writing one by hand...
Not an ideal solution...but...
For speed it would certainly be better than regex...not to mention possible
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Problem is...the verison on my computer is 2.4 or some stupid thing...so I don't have PHP tokenizing functions...Ambush Commander wrote:Quite a bit of post phasing, hmm? Well, read my earlier post. Tokenizing all the way.
Speaking of which...
I have used phpDev for a while now, but clearly that project has fallen off the face of the earth and sucks...
Know of any other PHP triad project for Windows...which wouldn't require me to install a thing and work right from install with no configuring???
I am too lazy and don't have the time or interest to go learning anything past the basic understanding of PHP/MySQL/Apache administration...so phpDev was ideal for me...
Suggestions???
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
My website server has everything, but some times...I don't feel like cluttering my server with a bunch of projects...and then there's the fact...that some code...I like to keep confidential...having it on a shared host isn't a great ideaAmbush Commander wrote:Actually, it's really the MySQL setup (and making 4.1's passwords work with 4.0), which was the main problem with me. If you want, you can start a new thread and get your PHP up to date. You are missing out on a lot with such an ancient version.
I think i'll check out that Xaamp (Apache friends) site