Class: Analyst::Parser
- Inherits:
-
Object
- Object
- Analyst::Parser
- Extended by:
- Forwardable
- Defined in:
- lib/analyst/parser.rb
Constant Summary collapse
- PROCESSORS =
TODO: Empty -> Unhandled (or something like that)
Hash.new(Entities::Empty).merge!( :root => Entities::Root, :class => Entities::Class, :def => Entities::InstanceMethod, :defs => Entities::SingletonMethod, :begin => Entities::Begin, :module => Entities::Module, :send => Entities::MethodCall, :sclass => Entities::SingletonClass, :dstr => Entities::InterpolatedString # :def => :method_node_parser, # :send => :send_node_parser # TODO: make a method parser, which pushes the the context_stack so that things inside method bodies # are treated differently than those inside class or module bodies. same with Block (right?) )
Instance Attribute Summary collapse
-
#start_path ⇒ Object
readonly
Returns the value of attribute start_path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ast) ⇒ Parser
constructor
A new instance of Parser.
- #inspect ⇒ Object
Constructor Details
#initialize(ast) ⇒ Parser
Returns a new instance of Parser.
36 37 38 |
# File 'lib/analyst/parser.rb', line 36 def initialize(ast) @ast = ast end |
Instance Attribute Details
#start_path ⇒ Object (readonly)
Returns the value of attribute start_path.
10 11 12 |
# File 'lib/analyst/parser.rb', line 10 def start_path @start_path end |
Class Method Details
.process_node(node, parent) ⇒ Object
31 32 33 34 |
# File 'lib/analyst/parser.rb', line 31 def self.process_node(node, parent) return if node.nil? # TODO: maybe a Entities:Nil would be appropriate? maybe? PROCESSORS[node.type].new(node, parent) end |
Instance Method Details
#inspect ⇒ Object
40 41 42 |
# File 'lib/analyst/parser.rb', line 40 def inspect "\#<#{self.class}:#{object_id}>" end |