Class: Pegparse::ParserContext

Inherits:
Object
  • Object
show all
Defined in:
lib/pegparse/parser_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(scanner) ⇒ ParserContext

Returns a new instance of ParserContext.



12
13
14
15
16
17
18
# File 'lib/pegparse/parser_context.rb', line 12

def initialize(scanner)
  @scanner = scanner
  @rule_stack = []
  @errors = Pegparse::ParserErrors.new
  @line_counter = Pegparse::LineCounter.new
  @borrowed_areas = Pegparse::BorrowedAreas.new
end

Instance Attribute Details

#borrowed_areasObject

Returns the value of attribute borrowed_areas.



10
11
12
# File 'lib/pegparse/parser_context.rb', line 10

def borrowed_areas
  @borrowed_areas
end

#errorsObject

Returns the value of attribute errors.



8
9
10
# File 'lib/pegparse/parser_context.rb', line 8

def errors
  @errors
end

#line_counterObject

Returns the value of attribute line_counter.



9
10
11
# File 'lib/pegparse/parser_context.rb', line 9

def line_counter
  @line_counter
end

#rule_stackObject

Returns the value of attribute rule_stack.



7
8
9
# File 'lib/pegparse/parser_context.rb', line 7

def rule_stack
  @rule_stack
end

#scannerObject

Returns the value of attribute scanner.



6
7
8
# File 'lib/pegparse/parser_context.rb', line 6

def scanner
  @scanner
end