Class: Nasl::Increment

Inherits:
Node
  • Object
show all
Defined in:
lib/nasl/parser/increment.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#ctx, #tokens

Instance Method Summary collapse

Methods inherited from Node

#context, #region, #to_xml

Constructor Details

#initialize(tree, *tokens) ⇒ Increment

Returns a new instance of Increment.



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/nasl/parser/increment.rb', line 33

def initialize(tree, *tokens)
  super

  if @tokens.first.is_a? Lvalue
    @type = :post
    @ident = @tokens[0]
  else
    @type = :pre
    @ident = @tokens[1]
  end

  @children << :ident
  @children << :type
end

Instance Attribute Details

#identObject (readonly)

Returns the value of attribute ident.



31
32
33
# File 'lib/nasl/parser/increment.rb', line 31

def ident
  @ident
end

#typeObject (readonly)

Returns the value of attribute type.



31
32
33
# File 'lib/nasl/parser/increment.rb', line 31

def type
  @type
end