Module: Jaina::Parser::Expression::Operator::Abstract::DSL::ClassMethods Private

Defined in:
lib/jaina/parser/expression/operator/abstract/dsl.rb,
lib/jaina/parser/expression/operator/grouping/dsl.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Instance Method Summary collapse

Instance Method Details

#acts_as_binary_termvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



136
137
138
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 136

def acts_as_binary_term
  @acts_as_binary_term = true
end

#acts_as_binary_term?void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



152
153
154
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 152

def acts_as_binary_term?
  @acts_as_binary_term
end

#acts_as_group_closenervoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



52
53
54
# File 'lib/jaina/parser/expression/operator/grouping/dsl.rb', line 52

def acts_as_group_closener
  @acts_as_group_closener = true
end

#acts_as_group_closener?void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



68
69
70
# File 'lib/jaina/parser/expression/operator/grouping/dsl.rb', line 68

def acts_as_group_closener?
  @acts_as_group_closener
end

#acts_as_group_openervoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



60
61
62
# File 'lib/jaina/parser/expression/operator/grouping/dsl.rb', line 60

def acts_as_group_opener
  @acts_as_group_opener = true
end

#acts_as_group_opener?void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



76
77
78
# File 'lib/jaina/parser/expression/operator/grouping/dsl.rb', line 76

def acts_as_group_opener?
  @acts_as_group_opener
end

#acts_as_unary_termvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



144
145
146
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 144

def acts_as_unary_term
  @acts_as_unary_term = true
end

#acts_as_unary_term?void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Since:

  • 0.1.0



160
161
162
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 160

def acts_as_unary_term?
  @acts_as_unary_term
end

#associativity_direction(assoc = nil) ⇒ String, NilClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • assoc (String, NilClass) (defaults to: nil)

Returns:

  • (String, NilClass)

Since:

  • 0.1.0



120
121
122
123
124
125
126
127
128
129
130
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 120

def associativity_direction(assoc = nil)
  unless assoc.is_a?(NilClass) || assoc == LEFT_ASSOC || assoc == RIGHT_ASSOC
    raise(
      IncorrectAssociativityDirectionError,
      "Associativity direction can be :#{LEFT_ASSOC} or :#{RIGHT_ASSOC}"
    )
  end

  @associativity_direction = assoc unless assoc.nil?
  @associativity_direction
end

#non_terminal?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.1.0



176
177
178
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 176

def non_terminal?
  false
end

#precedence_level(level = nil) ⇒ Integer, NilClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • level (Integer, NilClass) (defaults to: nil)

Returns:

  • (Integer, NilClass)

Since:

  • 0.1.0



106
107
108
109
110
111
112
113
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 106

def precedence_level(level = nil)
  unless level.is_a?(Integer) || level.is_a?(NilClass)
    raise IncorrectPrecedenceLevelError, 'Precendence level should be a type of integer'
  end

  @precedence_level = level unless level.nil?
  @precedence_level
end

#terminal?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

Since:

  • 0.1.0



168
169
170
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 168

def terminal?
  false
end

#token(term = nil) ⇒ String, NilClass

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • term (String, NilClass) (defaults to: nil)

Returns:

  • (String, NilClass)

Since:

  • 0.1.0



92
93
94
95
96
97
98
99
# File 'lib/jaina/parser/expression/operator/abstract/dsl.rb', line 92

def token(term = nil)
  unless term.is_a?(String) || term.is_a?(NilClass)
    raise IncorrectTokenError, 'Token should be a type of string'
  end

  @token = term unless term.nil?
  @token
end