<commit_before>package com.sixtyfour.cbmnative.mos6502;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sixtyfour.Loader;
import com.sixtyfour.cbmnative.PlatformProvider;
import com.sixtyfour.cbmnative.Transformer;
import com.sixtyfour.cbmnative.mos6502.generators.Generator;
import com.sixtyfour.cbmnative.mos6502.generators.GeneratorContext;
import com.sixtyfour.cbmnative.mos6502.generators.GeneratorList;
import com.sixtyfour.elements.Type;
import com.sixtyfour.elements.Variable;
import com.sixtyfour.parser.assembly.AssemblyParser;
import com.sixtyfour.system.Machine;

/**
 * @author EgonOlsen
 * 
 */
public class Transformer6502 implements Transformer {
	@Override
	public List<String> transform(Machine machine, PlatformProvider platform, List<String> code) {
		List<String> res = new ArrayList<>();
		List<String> consts = new ArrayList<String>();
		List<String> vars = new ArrayList<String>();
		List<String> mnems = new ArrayList<String>();
		List<String> subs = new ArrayList<String>();
		mnems.add("; *** CODE ***");
		subs.add("; *** SUBROUTINES ***");

		subs.addAll(Arrays.asList(Loader.loadProgram(this.getClass().getResourceAsStream("/subroutines.asm"))));

		consts.add("; *** CONSTANTS ***");
		vars.add("; *** VARIABLES ***");
		Map<String, String> name2label = new HashMap<String, String>();

		res.add("TMP_ZP = 105");
		res.add("TMP2_ZP = 107");
		res.add("TMP3_ZP = 34");
		res.add("JUMP_TARGET = 69");
		res.add("*=" + platform.getStartAddress());
		int cnt = 0;

		GeneratorContext context = new GeneratorContext();
		for (String line : code) {
			String cmd = line;
			line = convertConstantsToReal(line, platform);
			line = AssemblyParser.truncateComments(line);
			String orgLine = line;<commit_msg>comment<commit_after>package com.sixtyfour.cbmnative.mos6502;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.sixtyfour.Loader;
import com.sixtyfour.cbmnative.PlatformProvider;
import com.sixtyfour.cbmnative.Transformer;
import com.sixtyfour.cbmnative.mos6502.generators.Generator;
import com.sixtyfour.cbmnative.mos6502.generators.GeneratorContext;
import com.sixtyfour.cbmnative.mos6502.generators.GeneratorList;
import com.sixtyfour.elements.Type;
import com.sixtyfour.elements.Variable;
import com.sixtyfour.parser.assembly.AssemblyParser;
import com.sixtyfour.system.Machine;

/**
 * @author EgonOlsen
 * 
 */
public class Transformer6502 implements Transformer {
	@Override
	public List<String> transform(Machine machine, PlatformProvider platform, List<String> code) {
		List<String> res = new ArrayList<>();
		List<String> consts = new ArrayList<String>();
		List<String> vars = new ArrayList<String>();
		List<String> mnems = new ArrayList<String>();
		List<String> subs = new ArrayList<String>();
		mnems.add("; *** CODE ***");
		subs.add("; *** SUBROUTINES ***");

		subs.addAll(Arrays.asList(Loader.loadProgram(this.getClass().getResourceAsStream("/subroutines.asm"))));

		consts.add("; *** CONSTANTS ***");
		vars.add("; *** VARIABLES ***");
		Map<String, String> name2label = new HashMap<String, String>();

		res.add("TMP_ZP = 105");
		res.add("TMP2_ZP = 107");
		res.add("TMP3_ZP = 34");
		res.add(";make sure that JUMP_TARGET's low can't be $ff");
		res.add("JUMP_TARGET = 69");
		res.add("*=" + platform.getStartAddress());
		int cnt = 0;

		GeneratorContext context = new GeneratorContext();
		for (String line : code) {
			String cmd = line;
			line = convertConstantsToReal(line, platform);
			line = AssemblyParser.truncateComments(line);
			String orgLine = line;
{'fraction_non_alphanumeric': 0.15039220989991886, 'fraction_numerical': 0.018393291858263456, 'mean_word_length': 5.487719298245614, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '2769546', 'n_tokens_mistral': 1343, 'n_tokens_neox': 1213, 'n_words': 237}