Class: Nasl::Parser

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

Instance Method Summary collapse

Constructor Details

#initializeParser

Returns a new instance of Parser.



36
37
38
39
# File 'lib/nasl/parser.rb', line 36

def initialize
  @grammar = Grammar.new
  @env = Tree.new
end

Instance Method Details

#parse(code, path = "(unknown)") ⇒ Object



41
42
43
# File 'lib/nasl/parser.rb', line 41

def parse(code, path="(unknown)")
  @grammar.parse(@env, code, path)
end