Sha256: 48eae190f1629fc71ca3142b1bc9fb73e493adcf5c012854a77dfa94aad863b7

Contents?: true

Size: 895 Bytes

Versions: 4

Compression:

Stored size: 895 Bytes

Contents

require 'yaml'
module Gisele

  # Load the Language through Sexpr
  Language = Sexpr.load Path.dir/"language/grammar.sexp.yml"

  # Load syntax nodes, abstract syntax nodes, and processors
  require_relative 'language/syntax/node'
  require_relative 'language/ast/node'
  require_relative 'language/processors'

  # Force loading the Citrus parser now
  Language.parser.parser

  module Language

    # By default, Sexpr will find for abstract nodes under Language itself. We
    # override that behavior here and let it know that the AST module is the
    # parent of all ast nodes.
    def tagging_reference
      AST
    end

    # The tagging function (from s-expr kind to AST module) is not complete so far.
    # This allows us to at least include the AST:Node module in all s-expressions.
    def default_tagging_module
      AST::Node
    end

  end # module Language
end # module Gisele

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
gisele-language-0.6.0 lib/gisele/language.rb
gisele-language-0.5.1 lib/gisele/language.rb
gisele-language-0.5.0 lib/gisele/language.rb
gisele-0.5.0 lib/gisele/language.rb