You are viewing da404lewzer

entries friends calendar profile da404lewzer.com
da404lewzer
Share
Just letting everyone know my current blogs!
So yea, this a small list of places to start reading about me or things that I do including PHP and programming.

My Randomness - http://da404lewzer.blogspot.com/
PHP 4 FUN - http://php4fun.blogspot.com/
LOL Squirrels! - http://lolsquirrel.blogspot.com/
MySpace - http://myspace.com/da404lewzer
Wordpress - http://da404lewzer.wordpress.com/
Orkut - http://www.orkut.com/Profile.aspx?uid=9799142247351077178

Tags: , , , , , , , , ,
Current Mood: drained drained

Share
My life is starting to all set up. This is great. For the first time in a while, things are going smoothly. I really need to sit down and write out my thoughts more often, thats why I'm going to start devoting some time into blogging. It's a way to vent, plus I get a copy I can search. So yea, I work from home and sit on my laptop stumbling all day lol. I am currently editing a local news web-show called the Bakersfield Underground News Syndicate: BUNS lol. We have a new episode every week and just filmed episode 24. I do a lot of stuff with Hectic Films from camera to editing.

I need to figure out something to do or I'm going to die of boredom.

Tags: , , , , , ,
Current Location: bedroom
Current Mood: bored bored
Current Music: Some Chillout Stream

Share
Alright, so I'm not learning a new language, I'm writing my own. This project struck me as the perfect goal to advance me to the next level of programming; parse the very data I pound out of my keyboard each day. I will be writing a parsing engine in PHP that can parse PHP code. Thats right, a PHP script that can successfully parse PHP in the same way PHP would. PHP in my opinion is perfect for building web applications and I <3 webbers, so all systems g0!

Basically, my goal is to make a PHP interpreter completely from scratch and, of course, only using source that my hands physically type written directly from memory. I "technically" started coding it three days ago, but thats besides the point. So far I must seem like a spaz, but I really want to emphasize from scratch. Deep breath.

Heres what it does so far:
  1. It takes the block of PHP code and goes char by char over the entire chunk storing the lines of code and extracting out the functions. (This also does a quick check to see if the line is a variable update, if, comment, function call or function declaration.)
  2. Parses all the declared functions and adds them to the avail functions list
  3. Then, starts to parse all the executable code
  4. Any variables that are bumped into are set via an equals sign.
  5. The remainder is parsed for data.
  6. If it finds anything, it will go char by char through the data, this time, being more finicky about the syntax.
  7. If it detects a function call, it will attempt it via calling a new instance of itself and waiting for returning data
  8. More to code...

An example of what it can parse:
    $test = "this is a test";
    $name = "da404lewzer";
   
    echo $test . '<br />';
    echo "My name is: $name " . "<br />" . '<br />';
   
    echo ohBaby("My name is:" . $name);
    echo ohBaby2($test);
   
    function ohBaby($meh){
        return "w00t $meh<br />";
    }
    function ohBaby2($meh){
        $meh = "w00t $meh<br />";
        return $meh . "oh yea, this works too!";      
    }

This outputs:
this is a test
My name is: da404lewzer

w00t My name is:
w00t
oh yea, this works too!
End of output
As you can see in the output, the variables passed to the functions do not correctly parse as of tonight.
PHP outputs:
this is a test
My name is: da404lewzer

w00t My name is:da404lewzer
w00t this is a test
oh yea, this works too!
END of PHP
PHP however, will always do a better job than I can :P

So far the project has been fun and frustrating. Wow, you can actually get both! My next step is creating conditional checking and type guessing. Fun. Well, its only 9pm so I think I'm gonna grab me a DP, launch notepad2 and get coding.

Tags: , , ,
Current Location: bed
Current Mood: anxious anxious
Current Music: Barenaked Ladies - If I had $1000000

profile
da404lewzer
Name: da404lewzer
calendar
Back November 2007
123
45678910
11121314151617
18192021222324
252627282930
page summary
tags