convert awesome's syntax into php
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README
compiled.php
grammar.y
input.aw
lexer.rb
lexer_test.rb
nodes.rb
parser.rb
parser_output.txt
parser_test.rb
phlower.rb
runtime.rb
tests.rb

README

                    __
                .-.'  '.-.
             .-(   \  /   )-.
            /   '..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 :
<?php

class Awesome{

function __construct(){
pass();
}

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

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

}

$aw = new Awesome();


==FEATURES==
Here are a few language features that phlower supports :
* classes & methods
* if..else
* assignation operator
* binary operators
* string, boolean and int types
* converts init() constructors to __construct() php's constructors

==TODO==
* indent outputted php
* comments
* object properties access
* static class method access Class.method() => 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