Module: SelfML

Defined in:
lib/selfml.rb,
lib/selfml.rb,
lib/selfml/transformer.rb

Defined Under Namespace

Modules: AST Classes: HashTransformer, Parser, Transformer

Class Method Summary (collapse)

Class Method Details

+ (Object) parse(s, engine = nil)



12
13
14
15
16
17
18
19
20
# File 'lib/selfml.rb', line 12

def self.parse(s, engine=nil)
  transformer = engine.new if engine.instance_of? Class

  parser        = Parser.new
  transformer ||= Transformer.new
  
  tree = parser.parse(s)
  out  = transformer.apply(tree)
end