98 static void display_str(std::ostream & out,
String str)
101 for(
as_char_t const *s(str.c_str()); *s !=
'\0'; ++s)
106 out << '^' << static_cast<char>(*s +
'@');
116 out << static_cast<char>(*s);
121 out <<
"\\x" << std::hex << *s << std::dec;
123 else if(*s < 0x10000)
125 out <<
"\\u" << std::hex << std::setfill(
'0') << std::setw(4) << *s << std::dec;
129 out <<
"\\U" << std::hex << std::setfill(
'0') << std::setw(8) << *s << std::dec;
138 out << std::setw(4) << std::setfill('0') << static_cast<int>(
static_cast<node_t>(
f_type))
140 if(static_cast<int>(static_cast<node_t>(
f_type)) >
' ' && static_cast<int>(static_cast<node_t>(
f_type)) < 0x7F)
142 out <<
" = '" <<
static_cast<char>(
static_cast<node_t>(
f_type)) <<
"'";
154 sub_function::display_str(out,
f_str);
169 out <<
" NEW-VARIABLES";
174 sub_function::display_str(out,
f_str);
205 sub_function::display_str(out,
f_str);
217 sub_function::display_str(out,
f_str);
220 out <<
" IMPLEMENTS";
225 sub_function::display_str(out,
f_str);
228 out <<
" FOUND-LABELS";
232 out <<
" REFERENCED";
237 out <<
": " <<
f_int.
get() <<
", 0x" << std::hex << std::setw(16) << std::setfill(
'0') <<
f_int.
get() << std::dec << std::setw(0) << std::setfill(
'\0');
245 sub_function::display_str(out,
f_str);
277 sub_function::display_str(out,
f_str);
305 out <<
" UNPROTOTYPED";
309 out <<
" REFERENCED";
325 out <<
" UNPROTOTYPED";
347 sub_function::display_str(out,
f_str);
366 out <<
" ATTRIBUTES";
431 out <<
this <<
": " << std::setfill(
'0') << std::setw(2) << indent << std::setfill(
' ') << c << std::setw(indent) <<
"";
441 out <<
" Instance: " << node.get();
448 out <<
" Type Node: " << node.get();
461 out <<
" Goto Exit: " << node.get();
468 out <<
" Goto Enter: " << node.get();
473 struct display_attributes
544 out <<
" Locked: " <<
static_cast<int32_t
>(
f_lock);
550 for(
size_t idx(0); idx <
f_children.size(); ++idx)
552 f_children[idx]->display(out, indent + 1,
'-');
556 for(
size_t idx(0); idx <
f_variables.size(); ++idx)
561 variable->display(out, indent + 1,
'=');
571 label->display(out, indent + 1,
':');
weak_pointer_t f_goto_enter
weak_pointer_t f_type_node
A class used to safely handle stream flags, width, and precision.
weak_pointer_t f_goto_exit
weak_pointer_t f_instance
void display_data(std::ostream &out) const
Display a node.
void lock()
Lock this node.
static char const * attribute_to_string(attribute_t const attr)
Convert an attribute to a string.
vector_of_pointers_t f_children
void display(std::ostream &out, int indent, char c) const
Display a node tree.
std::shared_ptr< Node > pointer_t
attribute_set_t f_attributes
std::bitset< static_cast< int >attribute_t::NODE_ATTR_max)> attribute_set_t
std::ostream & operator<<(std::ostream &out, Node const &node)
Send a node to the specified output stream.
vector_of_weak_pointers_t f_variables
map_of_weak_pointers_t f_labels
The AlexScript to JavaScript namespace.
pointer_t f_attribute_node
char const * get_type_name() const
Retrieve the type of this node.