Class: AdLint::CompilerTraits

Inherits:
Object
  • Object
show all
Includes:
CompoundPathParser, Validation
Defined in:
lib/adlint/traits.rb

Overview

DESCRIPTION

Traits information of the compiler used in the project.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CompoundPathParser

parse_compound_path_list, parse_compound_path_str

Methods included from Validation

#ensure_dir_presence_of, #ensure_dirs_presence_of, #ensure_exam_packages_presence_of, #ensure_file_presence_of, #ensure_inclusion_of, #ensure_numericality_of, #ensure_presence_of, #ensure_true_or_false_of, #ensure_validity_of, #ensure_with, #errors, included, #valid?, #validators

Constructor Details

#initialize(doc) ⇒ CompilerTraits

Returns a new instance of CompilerTraits.



216
217
218
219
220
221
222
223
224
225
# File 'lib/adlint/traits.rb', line 216

def initialize(doc)
  @initial_header    = doc["initial_header"]
  @file_search_paths = parse_compound_path_list(doc["file_search_paths"])
  @standard_types    = StandardTypes.new(doc["standard_types"])
  @arithmetic        = Arithmetic.new(doc["arithmetic"])
  @identifier_max    = doc["identifier_max"]

  @extension_substitutions = doc["extension_substitutions"] || {}
  @arbitrary_substitutions = doc["arbitrary_substitutions"] || {}
end

Instance Attribute Details

#arbitrary_substitutionsObject (readonly)

VALUE

Hash<String, String > – The arbitrary code substitution settings.



263
264
265
# File 'lib/adlint/traits.rb', line 263

def arbitrary_substitutions
  @arbitrary_substitutions
end

#arithmeticObject (readonly)

VALUE

CompilerTraits::Arithmetic – The arithmetic traits information.



248
249
250
# File 'lib/adlint/traits.rb', line 248

def arithmetic
  @arithmetic
end

#extension_substitutionsObject (readonly)

VALUE

Hash<String, String > – The compiler-extension code substitution settings.



259
260
261
# File 'lib/adlint/traits.rb', line 259

def extension_substitutions
  @extension_substitutions
end

#file_search_pathsObject (readonly)

VALUE

Array< String > – System include paths.



238
239
240
# File 'lib/adlint/traits.rb', line 238

def file_search_paths
  @file_search_paths
end

#identifier_maxObject (readonly)

VALUE

Integer – Max length of all symbols identified by the compiler.



253
254
255
# File 'lib/adlint/traits.rb', line 253

def identifier_max
  @identifier_max
end

#initial_headerObject (readonly)

VALUE

String – The file path of the initial source.



233
234
235
# File 'lib/adlint/traits.rb', line 233

def initial_header
  @initial_header
end

#standard_typesObject (readonly)

VALUE

CompilerTraits::StandardTypes – The standard type traits information.



243
244
245
# File 'lib/adlint/traits.rb', line 243

def standard_types
  @standard_types
end

Instance Method Details

#entity_nameObject



227
228
229
# File 'lib/adlint/traits.rb', line 227

def entity_name
  "compiler_traits"
end

#freezeObject



449
450
451
452
453
454
455
456
457
# File 'lib/adlint/traits.rb', line 449

def freeze
  @file_search_paths.freeze
  @standard_types.freeze
  @arithmetic.freeze
  @identifier_max.freeze
  @extension_substitutions.freeze
  @arbitrary_substitutions.freeze
  super
end