metaprogramming - Ruby (MRI) Syntax Tree nodes documentation -
the meaning of nodes mri's syntax tree can infered. list quite long (source: bin/parse_tree_abc):
:attrasgn, :attrset, :dasgn_curr, :iasgn, :lasgn, :masgn, :and, :case, :else, :if, :iter, :or, :rescue, :until, :when, :while, :call, :fcall, :super, :vcall, :yield, :args, :argscat, :array, :begin, :block, :block_arg, :block_pass, :bool, :cfunc, :colon2, :const, :cvar, :defined, :defn, :dregx, :dstr, :dvar, :dxstr, :ensure, :false, :fbody, :gvar, :hash, :ivar, :lit, :long, :lvar, :match2, :match3, :nil, :not, :nth_ref, :return, :scope, :self, :str, :splat, :to_ary, :true, :unknown, :value, :void, :zarray, :zarray, :zclass, :zsuper
since python's ast manipulation builtin library, documentation far better. there place nodes parse tree's syntax tree documented?
there no such thing ruby ast, therefore there no documentation it. every implementation has own ast, might or might not documented.
besides, talking not abstract syntax tree parse tree (aka concrete syntax tree), is, definition, closely tied specific parser used construct it. different parsers might construct different parse trees same code , same syntax.
what show there looks parse tree either mri or yarv, both of notoriously badly documented.
Comments
Post a Comment