Skip to content

Instantly share code, notes, and snippets.

@dronov
Created March 16, 2015 20:02
Show Gist options
  • Save dronov/0846504ba3f5108ed71f to your computer and use it in GitHub Desktop.
Save dronov/0846504ba3f5108ed71f to your computer and use it in GitHub Desktop.
ruby --dump parsetree lex4.rb
[mechanic@dwave-laptop learning_ruby]$ ruby --dump parsetree lex4.rb
###########################################################
## Do NOT use this node dump for any purpose other than ##
## debug and research. Compatibility is not guaranteed. ##
###########################################################
# @ NODE_SCOPE (line: 11)
# +- nd_tbl: :code
# +- nd_args:
# | (null node)
# +- nd_body:
# @ NODE_BLOCK (line: 1)
# +- nd_head:
# | @ NODE_FCALL (line: 1)
# | +- nd_mid: :require
# | +- nd_args:
# | @ NODE_ARRAY (line: 1)
# | +- nd_alen: 1
# | +- nd_head:
# | | @ NODE_STR (line: 1)
# | | +- nd_lit: "ripper"
# | +- nd_next:
# | (null node)
# +- nd_next:
# @ NODE_BLOCK (line: 2)
# +- nd_head:
# | @ NODE_FCALL (line: 2)
# | +- nd_mid: :require
# | +- nd_args:
# | @ NODE_ARRAY (line: 2)
# | +- nd_alen: 1
# | +- nd_head:
# | | @ NODE_STR (line: 2)
# | | +- nd_lit: "pp"
# | +- nd_next:
# | (null node)
# +- nd_next:
# @ NODE_BLOCK (line: 8)
# +- nd_head:
# | @ NODE_DASGN_CURR (line: 4)
# | +- nd_vid: :code
# | +- nd_value:
# | @ NODE_STR (line: 4)
# | +- nd_lit: "10.times do |n|\n puts n\nend\n"
# +- nd_next:
# @ NODE_BLOCK (line: 10)
# +- nd_head:
# | @ NODE_FCALL (line: 10)
# | +- nd_mid: :puts
# | +- nd_args:
# | @ NODE_ARRAY (line: 10)
# | +- nd_alen: 1
# | +- nd_head:
# | | @ NODE_DVAR (line: 10)
# | | +- nd_vid: :code
# | +- nd_next:
# | (null node)
# +- nd_next:
# @ NODE_BLOCK (line: 11)
# +- nd_head:
# | @ NODE_FCALL (line: 11)
# | +- nd_mid: :pp
# | +- nd_args:
# | @ NODE_ARRAY (line: 11)
# | +- nd_alen: 1
# | +- nd_head:
# | | @ NODE_CALL (line: 11)
# | | +- nd_mid: :sexp
# | | +- nd_recv:
# | | | @ NODE_CONST (line: 11)
# | | | +- nd_vid: :Ripper
# | | +- nd_args:
# | | @ NODE_ARRAY (line: 11)
# | | +- nd_alen: 1
# | | +- nd_head:
# | | | @ NODE_DVAR (line: 11)
# | | | +- nd_vid: :code
# | | +- nd_next:
# | | (null node)
# | +- nd_next:
# | (null node)
# +- nd_next:
# (null node)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment