I wrote a simple recursive original parser in C ++.
I want a way to print it out of the studs but how can I understand how to do it.
I have a class node and its function is printSymbol ()
to print its symbol.
Include a thanks Add a surcharge to Looking at a single node, However, this should give you at least one picture that you can print. Either I or your question absolutely misunderstood. Good luck std :: list & lt; Node *>
printSymbol
, which takes an indent-level or default value, either works: < Code> zero print symbol (unsigned indent = 0) const {std :: cout & lt; & Lt; Std :: string (Indent, '') & lt; & Lt; M_symbol & lt; & Lt; '\ N'; (Auto child: m_children) child-> Print symbol (indent + 2); }
printSymbol ()
should output a direct call to only one symbol, a new line and all its children, if Nobody is properly jagged. Looking at the root pointer, it should dump its entire pars hierarchy into the studio. If you can actually get exceptionally creative about the characters of the eighty-art, console-dependent line, but actually set it as soon as possible, then I warn you.
No comments:
Post a Comment