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.1.6-java lib/bel_parser/language/syntax.rb
bel_parser-1.1.6 lib/bel_parser/language/syntax.rb
bel_parser-1.1.5 lib/bel_parser/language/syntax.rb
bel_parser-1.1.4-java lib/bel_parser/language/syntax.rb
bel_parser-1.1.4 lib/bel_parser/language/syntax.rb
bel_parser-1.1.3-java lib/bel_parser/language/syntax.rb
bel_parser-1.1.3 lib/bel_parser/language/syntax.rb
bel_parser-1.1.2-java lib/bel_parser/language/syntax.rb
bel_parser-1.1.2 lib/bel_parser/language/syntax.rb
bel_parser-1.1.1-java lib/bel_parser/language/syntax.rb
bel_parser-1.1.1 lib/bel_parser/language/syntax.rb
bel_parser-1.0.8-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.8 lib/bel_parser/language/syntax.rb
bel_parser-1.0.7-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.7 lib/bel_parser/language/syntax.rb
bel_parser-1.0.6-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.6 lib/bel_parser/language/syntax.rb
bel_parser-1.0.5-java lib/bel_parser/language/syntax.rb
bel_parser-1.0.5 lib/bel_parser/language/syntax.rb
bel_parser-1.0.4-java lib/bel_parser/language/syntax.rb