<commit_before>package primitive.node.impl.terminal;

import primitive.env.Enviroment;
import primitive.env.Memory;
import primitive.env.Pointer;
import primitive.node.Node;

public class MEMDUMP implements Node{
    private Enviroment env;
    public MEMDUMP(Enviroment env){
        this.env = env;
    }
    @Override
    public char get() {
        int no = 0;
        char ch = 0;
        Pointer p = env.getPointer();
        //get top
        while(p.hasLeft()){
            p = p.left();
        }
        //show all
        System.out.println("\n---- memory dump ----");
        while(p.hasRight()){
            ch = p.getMemory().get();
            System.out.println("addr:0x"+ Integer.toHexString((no)) + " val:0x" + Integer.toHexString((int)ch));
            p = p.right();
            no++;
        }
        System.out.println("---------------------");
        return 0;
    }
    @Override
    public boolean parse() {<commit_msg>MEMDUMP updated<commit_after>package primitive.node.impl.terminal;

import primitive.env.Enviroment;
import primitive.env.Memory;
import primitive.env.Pointer;
import primitive.node.Node;

public class MEMDUMP implements Node{
    private Enviroment env;
    public MEMDUMP(Enviroment env){
        this.env = env;
    }
    @Override
    public char get() {
        int no = 0,thisNo = -1;
        char ch = 0;
        Pointer p = env.getPointer();
        final Pointer finalPointer = p;
        StringBuffer sb = new StringBuffer();
        //get top
        while(p.hasLeft()){
            p = p.left();
        }
        //show all
        System.out.println("\n---- memory dump ----");
        while(p.hasRight()){
            ch = p.getMemory().get();
            if(p == finalPointer){
                System.out.println("current pointer - no:0x" + Integer.toHexString((no)));
            }
            sb.append("addr:0x"+ Integer.toHexString((no)) + " val:0x" + Integer.toHexString((int)ch) + "\n");
            p = p.right();
            no++;
        }
        System.out.println(sb);
        System.out.println("---------------------");
        return 0;
    }
    @Override
    public boolean parse() {
{'fraction_non_alphanumeric': 0.16003700277520813, 'fraction_numerical': 0.005550416281221091, 'mean_word_length': 1.7945736434108528, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2226609', 'n_tokens_mistral': 646, 'n_tokens_neox': 637, 'n_words': 144}