Class: Nasl::FunctionReference

Inherits:
Node
  • Object
show all
Defined in:
lib/nasl/parser/function_ref.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) ⇒ FunctionReference

Returns a new instance of FunctionReference.



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

def initialize(tree, *tokens)
  super

  @body = @tokens.last

  if @tokens.length == 5 
    @params = @tokens[0]
  else
    @params = []
  end

  @children << :params
  @children << :body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

#paramsObject (readonly)

Returns the value of attribute params.



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

def params
  @params
end

Instance Method Details

#eachObject



48
49
50
# File 'lib/nasl/parser/function_ref.rb', line 48

def each
  @body.each{ |stmt| yield stmt }
end