module Pione::TestHelper::Lang

Public Class Methods

conditional_branch(string, opts={}) click to toggle source

Read a conditional branch.

# File lib/pione/test-helper/lang-helper.rb, line 20
def conditional_branch(string, opts={})
  read(string, :conditional_branch, opts)
end
conditional_branch_context(string, opts={}) click to toggle source

Read a conditional branch context.

# File lib/pione/test-helper/lang-helper.rb, line 54
def conditional_branch_context(string, opts={})
  read(string, :conditional_branch_context, opts)
end
conditional_branch_context!(env, string, opts={}) click to toggle source

Read and evaluate a rule condition context.

# File lib/pione/test-helper/lang-helper.rb, line 59
def conditional_branch_context!(env, string, opts={})
  conditional_branch_context(string, opts).eval!(env)
end
context(string, opts={}) click to toggle source

Read a structural context.

# File lib/pione/test-helper/lang-helper.rb, line 25
def context(string, opts={})
  read(string, :structural_context, opts)
end
context!(env, string, opts={}) click to toggle source
# File lib/pione/test-helper/lang-helper.rb, line 29
def context!(env, string, opts={})
  context(string, opts).eval!(env)
end
declaration(string, opts={}) click to toggle source

Read a declaration.

# File lib/pione/test-helper/lang-helper.rb, line 11
def declaration(string, opts={})
  read(string, :declaration, opts)
end
declaration!(env, string, opts={}) click to toggle source
# File lib/pione/test-helper/lang-helper.rb, line 15
def declaration!(env, string, opts={})
  declaration(string, opts).eval(env)
end
env(string=nil) click to toggle source

Build an environment and update it with the string as structural context.

# File lib/pione/test-helper/lang-helper.rb, line 84
def env(string=nil)
  _env = Pione::Lang::Environment.new.setup_new_package("Test")
  context(string).eval(_env) if string
  _env
end
expr(string, opts={}) click to toggle source

Read an expression.

# File lib/pione/test-helper/lang-helper.rb, line 64
def expr(string, opts={})
  read(string, :expr, opts)
end
expr!(env, string, opts={}) click to toggle source

Read and evaluate an expression.

# File lib/pione/test-helper/lang-helper.rb, line 69
def expr!(env, string, opts={})
  expr(string, opts).eval!(env)
end
feature_expr(string, opts={}) click to toggle source

Read a feature expression.

# File lib/pione/test-helper/lang-helper.rb, line 74
def feature_expr(string, opts={})
  read(string, :feature_expr, opts)
end
feature_expr!(string, opts={}) click to toggle source

Read and evaluate a feature expression.

# File lib/pione/test-helper/lang-helper.rb, line 79
def feature_expr!(string, opts={})
  feature_expr(string, opts).eval(env)
end
package_context(string, opts={}) click to toggle source

Read a package context.

# File lib/pione/test-helper/lang-helper.rb, line 34
def package_context(string, opts={})
  read(string, :package_context, opts)
end
package_context!(env, string, opts={}) click to toggle source

Read and evaluate a package context.

# File lib/pione/test-helper/lang-helper.rb, line 39
def package_context!(env, string, opts={})
  package_context(string, opts).eval!(env)
end
read(string, parser_name, opts={}) click to toggle source

Read PIONE language and return the result.

# File lib/pione/test-helper/lang-helper.rb, line 6
def read(string, parser_name, opts={})
  LangReader.new(string, parser_name, opts).read
end
rule_condition_context(string, opts={}) click to toggle source

Read a rule condition context.

# File lib/pione/test-helper/lang-helper.rb, line 44
def rule_condition_context(string, opts={})
  read(string, :rule_condition_context, opts)
end
rule_condition_context!(env, string, opts={}) click to toggle source

Read and evaluate a rule condition context.

# File lib/pione/test-helper/lang-helper.rb, line 49
def rule_condition_context!(env, string, opts={})
  rule_condition_context(string, opts).eval!(env)
end
test_pione_method(name, option={}) click to toggle source

Test pione method.

# File lib/pione/test-helper/lang-helper.rb, line 91
def test_pione_method(name, option={})
  TestPioneMethod.new(name, option).run
end