OCamlRuby /

Filename Size Date modified Message
samples
1.5 KB
instance var scopes
3.9 KB
instance var scopes
154 B
typo
4.2 KB
instance var scopes
338 B
instance var scopes
871 B
line position
315 B
instance var scopes
6.1 KB
typo
1.1 KB
typo
846 B
instance var scopes
1.4 KB
instance var scopes
723 B
instance var scopes
699 B
line position
(**********************************************)
(*               OCamlRuby                    *)
(**********************************************)


BUILD
=====

	$ ./build.sh


USAGE
=====

	$ ./ocamlruby <filename>.rb


EXAMPLE
=======

	$ ./ocamlruby samples/test.rb

	$ ./ocamlruby samples/fib.rb



SYNTAX
======
	<program> ::= <expr>
	
	<expr> ::= <lterm>*
	<lterm> ::= <rterm> ( [ "&&" | "||" ] <rterm> )*

	<rterm> ::= <aterm> ( [ "==" | "!=" | "<=" | "<" | ">=" | ">" ] <aterm> )*

	<aterm> ::= <mterm> ( [ "+" | "-" ] <mterm> )*

	<mterm> ::= <factor> ( ["*" | "/" ] <factor> )*

	<factor> ::= <factor1> <factor_next>

	<factor1> ::= <ident> "=" <lterm>
		    | "@" <ident> "=" <lterm>
		    | <ident> "(" <expr> "," .. "," <expr> ")"
	    	    | <ident> <block>
		    | <ident>
		    | "@" <ident>
		    | "def" <ident> "(" <ident> "," .. "," <ident> ")" <expr> "end"
		    | "def" <ident>  <expr> "end"
		    | "class" <ident>  <expr>  "end"
	    	    | "class"  <expr>  "end"
		    | <block>
		    | "(" <expr> ")"
		    | "if" <expr> "then" <expr> "else" <expr> "end"
		    | <literal>
		 
	<factor_next> ::= "." <ident> "(" <expr> "," .. "," <expr> ")"  <factor_next>
		        | "." <ident>  <block> <factor_next>	
			| "." <ident>  <factor_next>
		        | <e>

	<block> ::= "{"  "|" <ident> "," .. "," <ident> "|" <expr> "}"
		  | "do" "|" <ident> "," .. "," <ident> "|" <expr> "end"

	<literal> ::= <string> | <int> | <bool>



AUTHOR
======

	Yoshihiro Imai
	yimai.v @ gmail.com