Class: Rly::PlyDump
- Inherits:
-
Object
- Object
- Rly::PlyDump
- Defined in:
- lib/rly/parse/ply_dump.rb
Defined Under Namespace
Classes: TinyContext
Instance Attribute Summary collapse
-
#backlog ⇒ Object
readonly
Returns the value of attribute backlog.
Class Method Summary collapse
Instance Method Summary collapse
- #debug(*args) ⇒ Object
- #info(*args) ⇒ Object
-
#initialize(grammar) ⇒ PlyDump
constructor
A new instance of PlyDump.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#backlog ⇒ Object (readonly)
Returns the value of attribute backlog.
8 9 10 |
# File 'lib/rly/parse/ply_dump.rb', line 8 def backlog @backlog end |
Class Method Details
Instance Method Details
#debug(*args) ⇒ Object
34 35 36 37 |
# File 'lib/rly/parse/ply_dump.rb', line 34 def debug(*args) s = sprintf(*args) @backlog += s + "\n" end |
#info(*args) ⇒ Object
29 30 31 32 |
# File 'lib/rly/parse/ply_dump.rb', line 29 def info(*args) s = sprintf(*args) @backlog += s + "\n" end |
#to_s ⇒ Object
19 20 21 22 23 |
# File 'lib/rly/parse/ply_dump.rb', line 19 def to_s fn = File.join(File.dirname(__FILE__), '..', '..', '..', 'assets', 'ply_dump.erb') e = ERB.new(open(fn).read) e.result(TinyContext.new(g: @grammar, backlog: @backlog, ver: Rly::VERSION).get_binding) end |