Sha256: 4a86abb4a9a909ea030f9dabb758c209b80823c1e6f509351f894ddfeb7e126e

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module Gisele
  module Language

    require 'yaml'
    DOT_ATTRIBUTES = YAML.load_file(Path.dir/"language/dot.yml")

    RESERVED_WORDS = [
      "if",
      "else",
      "elsif",
      "when",
      "while",
      "seq",
      "par",
      "task",
      "refinement",
      "fluent",
      "trackvar",
      "initially",
      "end",
      "not",
      "or",
      "and",
      "true",
      "false"
    ]

    def rule2mod(rule)
      rule.to_s.gsub(/(^|_)([a-z])/){|x| $2.capitalize}.to_sym
    end
    module_function :rule2mod

    def mod2rule(mod)
      mod = mod.name.to_s.split('::').last.to_sym if mod.is_a?(Module)
      mod.to_s.gsub(/[A-Z]/){|x| "_#{x.downcase}"}[1..-1].to_sym
    end
    module_function :mod2rule

  end # module Language
end # module Gisele
require_relative 'language/syntax'
require_relative 'language/ast'
require_relative 'language/rewriter'
require_relative 'language/elsif_flattener'
require_relative 'language/if_to_case'
require_relative 'language/sugar_removal'
require_relative 'language/to_graph'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gisele-0.3.0 lib/gisele/language.rb