Class: Pegarus::Character

Inherits:
Pattern
  • Object
show all
Defined in:
lib/pegarus/ast/character.rb,
lib/pegarus/rubinius/compiler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Pattern

#*, #+, #+@, #-, #-@, #/, engine, #graph, #match, select_engine

Constructor Details

#initialize(string) ⇒ Character

Returns a new instance of Character.



5
6
7
# File 'lib/pegarus/ast/character.rb', line 5

def initialize(string)
  @string = string
end

Instance Attribute Details

#stringObject

Returns the value of attribute string.



3
4
5
# File 'lib/pegarus/ast/character.rb', line 3

def string
  @string
end

Instance Method Details

#bytecode(g) ⇒ Object



145
146
147
# File 'lib/pegarus/rubinius/compiler.rb', line 145

def bytecode(g)
  char g, @string
end

#visit(visitor) ⇒ Object



9
10
11
# File 'lib/pegarus/ast/character.rb', line 9

def visit(visitor)
  visitor.character self
end