The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
PHP-General - Parsing help
Discuss Parsing help in the PHP Development forum on Dev Shed. Parsing help PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 7th, 2012, 09:18 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 43 m 14 sec
Reputation Power: 0
|
|
|
PHP-General - Parsing help
hi all, new to the forum, new to programming. I'm working on a little project, and i could use a little help/guidance.
I'm trying to make a class that will crawl any php source, and then build an array of all the classes and their methods.
I'm totally new to programming and have no clue where to start or how to get it done. so i would like any feedback you guys might have, if there are any libraries or classes that do this.
Thanks,
|

November 7th, 2012, 10:23 PM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
Look at the reflectionClass.
Note that recursively parsing programming language syntax is not the best way to learn a language. It's a bit out of your depth.
__________________
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
|

November 7th, 2012, 11:46 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 43 m 14 sec
Reputation Power: 0
|
|
|
Thanks, That's the ticket. My main objective here is to create an intuitive UI to navigate through my framework's classes and methods. And i just needed a place to start, so thanks.
I was looking at using regex to parse the files as plain text, but i did not want to get into that kind of dredging.... so thanks i never knew about the ReflectionClass AWESOME!
|

November 8th, 2012, 08:21 AM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
Always describe your problem. Don't ask how to do what you've decided is the solution.
PHPDocumenter does this already.
|

November 8th, 2012, 12:18 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 43 m 14 sec
Reputation Power: 0
|
|
|
Very well, my end goal is to be able to read a php file, and come up with an array or all classes, and nested with in a class all it's methods. I will be using this to drive a GUI that highlights your systems objects, classes, and methods. and will provide an interactive UML or sorts. i have most of the JS ready, just need the php part.
Thanks
|

November 8th, 2012, 12:23 PM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
Quote: | thanks, im not trying to make a UML or diagram.... | I never thought you were.
Quote: | My end goal is to come up with li or divs, each one representing a method, or through a stack of methods a class, so i can produce a GUI for navigating and managing one's classes and methods. | That is exactly what PHPDocumenter does. PHP.net is made with PHPDocumenter.
|

November 8th, 2012, 12:24 PM
|
|
Registered User
|
|
Join Date: Nov 2012
Posts: 4
Time spent in forums: 43 m 14 sec
Reputation Power: 0
|
|
|
ok i will look at phpDocumenter, thanks
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|