Sha256: 7f414ac58694f3cb358ce1ac3eb5b2c1a00725c827a743ccc2fd0c54f4be9b5c

Contents?: true

Size: 970 Bytes

Versions: 116

Compression:

Stored size: 970 Bytes

Contents

require_relative 'syntax_function'
require_relative 'syntax_error'
require_relative 'syntax_warning'

module BELParser
  module Language
    # Syntax module aggregates the generic {SyntaxFunction}
    # implementations that apply to all
    # {BELParser::Language::Specification BEL specifications}.
    module Syntax
      def self.syntax_functions
        constants.collect do |symbol|
          const = const_get(symbol)
          const if
            const.respond_to?(:include?) &&
            const.include?(SyntaxFunction)
        end.compact
      end

      # Valid defines a {SyntaxResult} that indicates successful syntax
      # validation.
      class Valid < SyntaxResult
        def msg
          'Syntax is valid.'
        end
      end
    end
  end
end

# Require all generic syntax functions.
Dir[
  File.join(
    File.dirname(File.expand_path(__FILE__)),
    'syntax', '*.rb')
].each do |path|
  require_relative "syntax/#{File.basename(path)}"
end

Version data entries

116 entries across 116 versions & 1 rubygems

Version Path
bel_parser-1.0.0.alpha.46 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.45-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.45 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.44-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.44 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.43-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.43 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.42-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.42 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.41-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.41 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.40-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.40 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.39-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.39 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.38-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.38 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.37-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.37 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.36-java lib/bel_parser/language/syntax.rb