phlower icon indicating copy to clipboard operation
phlower copied to clipboard

convert awesome's syntax into php

                __
            .-.'  '.-.
         .-(   \  /   )-.
        /   '..pHPh..'   \
,       \.--.hPHPHPHp.--./
|\  ,   (   :hPHPHPHp:   )

./| /'--'pPHPHPHp'--'
'-.. ;/| \ .''pHPh''. / .--'. :/|'-( / \ )-' '--. . / //'-'.__.'-; '-,_';// , /| '(( |\/./_ \\ . |\; ..-' \\ |\: .'--. \, .' .--' ))'
,-'` //-' // // |/

==Introduction== phlower (pronounced flower) is a small ruby script that compiles the Awesome code (invented by MACournoyer for his book http://createyourproglang.com/ ) into PHP code. This script is written in Ruby and it depends on the racc gem.

==Usage==

input.aw file should contain your Awesome input code :

class Awesome{ def init(){ pass(); }

def x(){ return(2 + 2); }

def z(){ print("poulet"); } }

aw = Awesome.new();

And : $ ruby phlower.rb input.aw compiled.php

Should output this PHP code :

Class::method() * elsif * foreach * while, do..while * for * switch..case * try..catch * arrays * ++,--,+=,-=,*=,/=,.=,%=,!,!=,||,&&,==,>,= operators * break, continue * constants defined with define() * extends (for classes) * type-casting , eq: (int)$var