diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-25 22:15:51 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-25 22:15:51 -0700 |
commit | 9542bb112419d575190a72baf7f964c3e32df223 (patch) | |
tree | f9edd69ee91c47d41d50dc1f86ae86dcf10e4428 /html/029debug.cc.html | |
parent | 955a66a504aec3f106b415d271403b63d0d0e410 (diff) | |
download | mu-9542bb112419d575190a72baf7f964c3e32df223.tar.gz |
1853
Diffstat (limited to 'html/029debug.cc.html')
-rw-r--r-- | html/029debug.cc.html | 129 |
1 files changed, 12 insertions, 117 deletions
diff --git a/html/029debug.cc.html b/html/029debug.cc.html index 58adec43..80f33d7d 100644 --- a/html/029debug.cc.html +++ b/html/029debug.cc.html @@ -15,10 +15,9 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } * { font-size: 1.05em; } .cSpecial { color: #008000; } .Constant { color: #00a0a0; } -.Comment { color: #9090ff; } +.Normal { color: #eeeeee; background-color: #080808; padding-bottom: 1px; } .Delimiter { color: #a04060; } .Identifier { color: #804000; } -.CommentedCode { color: #6c6c6c; } --> </style> @@ -30,26 +29,24 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } </head> <body> <pre id='vimCodeElement'> -<span class="Comment">//: Recipe to look at elements of containers.</span> - <span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> _PRINT<span class="Delimiter">,</span> <span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> Recipe_ordinal[<span class="Constant">"$print"</span>] = _PRINT<span class="Delimiter">;</span> <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _PRINT: <span class="Delimiter">{</span> - for <span class="Delimiter">(</span>long long int i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Delimiter">{</span> - trace<span class="Delimiter">(</span>Primitive_recipe_depth<span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"$print: "</span> << current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name<span class="Delimiter">;</span> - if <span class="Delimiter">(</span>has_property<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">),</span> <span class="Constant">"newline"</span><span class="Delimiter">))</span> +<span class="Normal">case</span> _PRINT: <span class="Delimiter">{</span> + <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < SIZE<span class="Delimiter">(</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Delimiter">{</span> + trace<span class="Delimiter">(</span>Primitive_recipe_depth<span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"$print: "</span> << current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name << end<span class="Delimiter">();</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>has_property<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">),</span> <span class="Constant">"newline"</span><span class="Delimiter">))</span> cout << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> - else + <span class="Normal">else</span> cout << current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name<span class="Delimiter">;</span> <span class="Delimiter">}</span> - else <span class="Delimiter">{</span> - for <span class="Delimiter">(</span>long long int j = <span class="Constant">0</span><span class="Delimiter">;</span> j < SIZE<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> ++j<span class="Delimiter">)</span> <span class="Delimiter">{</span> - trace<span class="Delimiter">(</span>Primitive_recipe_depth<span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"$print: "</span> << ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>at<span class="Delimiter">(</span>j<span class="Delimiter">);</span> - if <span class="Delimiter">(</span>j > <span class="Constant">0</span><span class="Delimiter">)</span> cout << <span class="Constant">" "</span><span class="Delimiter">;</span> + <span class="Normal">else</span> <span class="Delimiter">{</span> + <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">long</span> <span class="Normal">long</span> <span class="Normal">int</span> j = <span class="Constant">0</span><span class="Delimiter">;</span> j < SIZE<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> ++j<span class="Delimiter">)</span> <span class="Delimiter">{</span> + trace<span class="Delimiter">(</span>Primitive_recipe_depth<span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"$print: "</span> << ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>at<span class="Delimiter">(</span>j<span class="Delimiter">)</span> << end<span class="Delimiter">();</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>j > <span class="Constant">0</span><span class="Delimiter">)</span> cout << <span class="Constant">" "</span><span class="Delimiter">;</span> cout << ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>at<span class="Delimiter">(</span>j<span class="Delimiter">);</span> <span class="Delimiter">}</span> <span class="Delimiter">}</span> @@ -58,116 +55,14 @@ case _PRINT: <span class="Delimiter">{</span> <span class="Delimiter">}</span> <span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_START_TRACING<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$start-tracing"</span>] = _START_TRACING<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _START_TRACING: <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> - Trace_stream<span class="Delimiter">-></span>dump_layer = <span class="Constant">"all"</span><span class="Delimiter">;</span> - else - Trace_stream<span class="Delimiter">-></span>dump_layer = current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">;</span> -<span class="CommentedCode">//? cout << Trace_stream << ": " << Trace_stream->dump_layer << '\n'; //? 1</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_STOP_TRACING<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$stop-tracing"</span>] = _STOP_TRACING<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _STOP_TRACING: <span class="Delimiter">{</span> - Trace_stream<span class="Delimiter">-></span>dump_layer = <span class="Constant">""</span><span class="Delimiter">;</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_CLOSE_TRACE<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$close-trace"</span>] = _CLOSE_TRACE<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _CLOSE_TRACE: <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>Trace_stream<span class="Delimiter">)</span> <span class="Delimiter">{</span> - delete Trace_stream<span class="Delimiter">;</span> - Trace_stream = <span class="Constant">NULL</span><span class="Delimiter">;</span> - <span class="Delimiter">}</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> _EXIT<span class="Delimiter">,</span> <span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> Recipe_ordinal[<span class="Constant">"$exit"</span>] = _EXIT<span class="Delimiter">;</span> <span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _EXIT: <span class="Delimiter">{</span> +<span class="Normal">case</span> _EXIT: <span class="Delimiter">{</span> exit<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Delimiter">}</span> - -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_DUMP_TRACE<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$dump-trace"</span>] = _DUMP_TRACE<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _DUMP_TRACE: <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> - DUMP<span class="Delimiter">(</span><span class="Constant">""</span><span class="Delimiter">);</span> - <span class="Delimiter">}</span> - else <span class="Delimiter">{</span> - DUMP<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">);</span> - <span class="Delimiter">}</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_CLEAR_TRACE<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$clear-trace"</span>] = _CLEAR_TRACE<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _CLEAR_TRACE: <span class="Delimiter">{</span> - CLEAR_TRACE<span class="Delimiter">;</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_DUMP_MEMORY<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$dump-memory"</span>] = _DUMP_MEMORY<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _DUMP_MEMORY: <span class="Delimiter">{</span> - dump_memory<span class="Delimiter">();</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_DUMP<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$dump"</span>] = _DUMP<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _DUMP: <span class="Delimiter">{</span> - reagent after_canonize = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> - cerr << current_recipe_name<span class="Delimiter">()</span> << <span class="Constant">": "</span> << current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name << <span class="Constant">' '</span> << current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>value << <span class="Constant">" => "</span> << after_canonize<span class="Delimiter">.</span>value << <span class="Constant">" => "</span> << Memory[after_canonize<span class="Delimiter">.</span>value] << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> - -<span class="Comment">//: Helper for debugging: grab an address and then dump its value.</span> -<span class="Delimiter">:(before "End Globals")</span> -long long int foo = -<span class="Constant">1</span><span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> -_FOO<span class="Delimiter">,</span> -<span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -Recipe_ordinal[<span class="Constant">"$foo"</span>] = _FOO<span class="Delimiter">;</span> -<span class="Delimiter">:(before "End Primitive Recipe Implementations")</span> -case _FOO: <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> - if <span class="Delimiter">(</span>foo != -<span class="Constant">1</span><span class="Delimiter">)</span> cerr << foo << <span class="Constant">": "</span> << Memory[foo] << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> - else cerr << <span class="cSpecial">'\n'</span><span class="Delimiter">;</span> - <span class="Delimiter">}</span> - else <span class="Delimiter">{</span> - foo = canonize<span class="Delimiter">(</span>current_instruction<span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)).</span>value<span class="Delimiter">;</span> - <span class="Delimiter">}</span> - <span class="Identifier">break</span><span class="Delimiter">;</span> -<span class="Delimiter">}</span> </pre> </body> </html> |