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.56 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.55-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.55 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.54-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.54 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.53-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.53 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.52-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.52 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.51-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.51 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.50-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.50 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.49-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.49 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.48-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.48 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.47-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.47 lib/bel_parser/language/syntax.rb
bel_parser-1.0.0.alpha.46-java lib/bel_parser/language/syntax.rb