Class: Frepl::Declaration

Inherits:
SinglelineStatement show all
Defined in:
lib/frepl/statements/declaration.rb

Direct Known Subclasses

Allocation

Instance Attribute Summary collapse

Attributes inherited from SinglelineStatement

#line

Instance Method Summary collapse

Methods inherited from SinglelineStatement

#incomplete?, #initialize, #output

Methods inherited from Statement

#incomplete?, #output

Constructor Details

This class inherits a constructor from Frepl::SinglelineStatement

Instance Attribute Details

#assigned_valueObject (readonly)

Returns the value of attribute assigned_value.



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

def assigned_value
  @assigned_value
end

#kindObject (readonly)

Returns the value of attribute kind.



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

def kind
  @kind
end

#lenObject (readonly)

Returns the value of attribute len.



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

def len
  @len
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#variable_nameObject (readonly)

Returns the value of attribute variable_name.



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

def variable_name
  @variable_name
end

Instance Method Details

#==(other) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/frepl/statements/declaration.rb', line 9

def ==(other)
  if other.is_a?(Declaration)
    self.variable_name == other.variable_name
  else
    super(other)
  end
end

#accept(visitor) ⇒ Object



5
6
7
# File 'lib/frepl/statements/declaration.rb', line 5

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

#pointer?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/frepl/statements/declaration.rb', line 21

def pointer?
  @pointer != nil
end

#target?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/frepl/statements/declaration.rb', line 17

def target?
  @target != nil
end