Class: Languages::VariableBehaviour Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/kuniri/language/abstract_container/structured_and_oo/variable_behaviour.rb

Overview

This class is abstract.

This class is an abstraction for handling any element whose the

behaviour is similar to a variable. As an example, we have global variables and attributes that have some similarities.

Direct Known Subclasses

Ruby::VariableBehaviourRuby

Instance Method Summary collapse

Instance Method Details

#handle_line_declaration(pString) ⇒ Object (protected)

Handling line declaration.

Parameters:

  • pString

    Line with simple declaration.

Returns:

  • Return a string.

Raises:

  • (NotImplementedError)


45
46
47
# File 'lib/kuniri/language/abstract_container/structured_and_oo/variable_behaviour.rb', line 45

def handle_line_declaration(pString)
  raise NotImplementedError
end

#handle_multiple_declaration_with_comma(pString) ⇒ Object (protected)

One common behaviour related with variables, is the multiple declaration separated by comma. This method is responsible for handling multiple line declaration separated by comma.

Parameters:

  • pString

    String to be handled.

Returns:

  • Return an array with multiple variables.

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/kuniri/language/abstract_container/structured_and_oo/variable_behaviour.rb', line 31

def handle_multiple_declaration_with_comma(pString)
  raise NotImplementedError
end

#handle_multiple_declaration_with_equal(pString) ⇒ Object (protected)

Handling multiple declaration with equal.

Parameters:

  • pString

    String with multiple declaration.

Returns:

  • Return an string.

Raises:

  • (NotImplementedError)


38
39
40
# File 'lib/kuniri/language/abstract_container/structured_and_oo/variable_behaviour.rb', line 38

def handle_multiple_declaration_with_equal(pString)
  raise NotImplementedError
end

#prepare_final_string(pLine) ⇒ Object (protected)

Prepare final string, before save it in a container data.

Parameters:

  • pLine

    Line to be inspected.

Returns:

  • Return a string.

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/kuniri/language/abstract_container/structured_and_oo/variable_behaviour.rb', line 22

def prepare_final_string(pLine)
  raise NotImplementedError
end

#remove_unnecessary_information(pString) ⇒ Object (protected)

Remove unnecessary information from line. For example, remove everything into parenthesis or line comment.

Parameters:

  • pString

    String for remove unnecessary information.

Returns:

  • If match any unnecessary character defined by the programmer returns the new string, otherwise return the same string.

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/kuniri/language/abstract_container/structured_and_oo/variable_behaviour.rb', line 15

def remove_unnecessary_information(pString)
  raise NotImplementedError
end