Class: Frepl::DerivedType

Inherits:
MultilineStatement show all
Defined in:
lib/frepl/statements/derived_type.rb

Instance Attribute Summary

Attributes inherited from MultilineStatement

#lines

Instance Method Summary collapse

Methods inherited from MultilineStatement

#complete?, #incomplete?, #initialize, #output

Methods inherited from Statement

#incomplete?, #output

Constructor Details

This class inherits a constructor from Frepl::MultilineStatement

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/frepl/statements/derived_type.rb', line 15

def ==(other)
  if other.is_a?(DerivedType)
    self.name == other.name
  else
    super(other)
  end
end

#accept(visitor) ⇒ Object



7
8
9
# File 'lib/frepl/statements/derived_type.rb', line 7

def accept(visitor)
  visitor.visit_derived_type(self)
end

#nameObject



11
12
13
# File 'lib/frepl/statements/derived_type.rb', line 11

def name
  @name ||= lines.first.match(Frepl::Classifier::DERIVED_TYPE_REGEX)[1]
end

#terminal_regexObject



3
4
5
# File 'lib/frepl/statements/derived_type.rb', line 3

def terminal_regex
  /end type\s*#{Frepl::Classifier::VARIABLE_NAME_REGEX}/i
end