Project

minidsl

0.0
No commit activity in last 3 years
No release in over 3 years
Mini DSL Framework for trans-generating
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.11
~> 10.0
 Project Readme

Minidsl

Minidsl is an DSL way to generate mainly codes.

$: << "lib"
require 'minidsl'

include Minidsl
r = Scope.push_context :Statements


class Test
   def int(opt = {})
      opt.map{|k, v|
         "int #{k} = #{v};"
      }
   end
   def println(str)
     "System.out.println(#{str.inspect});"
   end
end

s = pure_proxy Test.new
s.instance_eval{
  int a: 3, b: 5
  println "Hello world"
}

puts r.result

would generate

int a = 3;
int b = 5;
System.out.println("Hello world");

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/RGSS3/minidsl.

License

The gem is available as open source under the terms of the MIT License.