crystush v0.1.2

Interpreter for Push 3 language

crystush

GitHub release Build Status

Interpreter for the Push 3 language (based on work by Lee Spector, Maarten Keijzer, Jon Klein, Chris Perry and Tom Helmuth, among others)

Installation

Add this to your application's shard.yml:

dependencies:
  crystush:
    github: shalmezad/crystush

Usage

require "crystush"

# Create a string with your program like so:
program_string = "( INTEGER.DUP INTEGER.+ )"

# Create a Crystush Program:
program = Crystush::Program.new(program_string)

# Optional: Create a preloaded stack
preload_stacks = Crystush::PushStacks.new
preload_stacks.integer_stack.push 4

# Evaluate the program:
stacks = program.evaluate(preload_stacks)

# Get the output from any of the stacks:
result = stacks.integer_stack.last

Contributing

  1. Fork it ( https://github.com/Shalmezad/crystush/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • Shalmezad Richard Wardin - creator, maintainer
Repository

crystush

Owner
Statistic
  • 0
  • 0
  • 0
  • 1
  • 0
  • almost 7 years ago
  • November 20, 2017
License

MIT License

Links
Synced at

Thu, 07 Nov 2024 11:33:45 GMT

Languages