https://github.com/konn/grasuby
grasuby - GRASs rUBY interpreter and his firends
https://github.com/konn/grasuby
Last synced: 2 months ago
JSON representation
grasuby - GRASs rUBY interpreter and his firends
- Host: GitHub
- URL: https://github.com/konn/grasuby
- Owner: konn
- Created: 2008-09-14T16:56:36.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2008-09-14T18:14:06.000Z (over 16 years ago)
- Last Synced: 2025-01-23T17:20:37.164Z (4 months ago)
- Language: Ruby
- Homepage: http://konn.x0.com/
- Size: 78.1 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rd
Awesome Lists containing this project
README
=begin
= Grasuby -- Grass rUBY interpreter and his friendsver 0.1b1 2008-09-15T02:20:51+09:00
Copyright (c) 2008 Hiromi Ishii
You can redistribute it and/or modify it under the same term as Ruby.== What is this?
Yet anoter grass interpreter that perhaps work.== Usage
Result is written to the standard output.
=== Interpreter
Interprete
$ echo 'wWWwwww' | ruby grasuby.rbOr,
$ ruby grasuby.rb prog.www
=== Compile
Compile from formal notation to grass program.$ cat prog1.asm
[[:abs, 1, [[:app, 5, 1], [:app, 3, 1], [:app, 3, 3]]]]
$ ruby1.9 grasuby.rb compile prog1.asm
wWWWWWwWWWwWWWwww
$ cat prog2.asm
[Abs(1, [App(5,1),App(3,1),App(3,3)])]
$ ruby1.9 grasuby.rb compile prog2.asm
wWWWWWwWWWwWWWwww=== Decompile
Decompile from Grass program to formal notation.$ cat prog.www
wWWWWWwWWWwWWWwww
$ ruby1.9 grasuby.rb decompile prog.www
[[:abs, 1, [[:app, 5, 1], [:app, 3, 1], [:app, 3, 3]]]]=== Evaluate
Evaluate formal notation.$ cat prog3.asm
[[:abs, 1, [[:app, 2, 4]]]]
$ grasuby.rb evaluate prog3.asm
w
$ cat prog4.asm
[Abs(1, [App(2, 4)])]
$ grasuby.rb evaluate prog4.asm
w== Todo
(1) Test.