src/Converter.java
/**
     * Converts the BF file read into the scanner into the .rtl format and
     * saves the newly created file.
     *
     * @param outputPath - where to save the .rtl file
     */
Converts the BF file read into the scanner into the .rtl format and
saves the newly created file.

@param outputPath - where to save the .rtl file
Converts the BF file read into the scanner into the . rtl format and saves the newly created file . @param outputPath - where to save the . rtl file
private void convert(String outputPath) {
        Path outfile;
        try {
            outfile = Files.createFile(Paths.get(outputPath));
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        StringBuilder line = new StringBuilder();
        Map<Character, String> commandMap = createCommandMap();
        int c;
        for (c = readChar(); c != -1; c = readChar()) {
            if (c == -2)
                return;
            line.append(commandMap.get((char) c));
            line.append(" ");
        }
        List<String> lines = Collections.singletonList(line.toString());
        try {
            Files.write(outfile, lines, StandardCharsets.US_ASCII);
        } catch (IOException e) {
            e.printStackTrace();
            System.out.println(".rtl file write failed.");
        }
    }
private void convert ( String outputPath ) { Path outfile ; try { outfile = Files . createFile ( Paths . get ( outputPath ) ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; return ; } StringBuilder line = new StringBuilder ( ) ; Map < Character , String > commandMap = createCommandMap ( ) ; int c ; for ( c = readChar ( ) ; c != - 1 ; c = readChar ( ) ) { if ( c == - 2 ) return ; line . append ( commandMap . get ( ( char ) c ) ) ; line . append ( " " ) ; } List < String > lines = Collections . singletonList ( line . toString ( ) ) ; try { Files . write ( outfile , lines , StandardCharsets . US_ASCII ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; System . out . println ( ".rtl file write failed." ) ; } }
Converts the BF file read into the scanner into the .rtl format and
 saves the newly created file.
Converts the BF file read into the scanner into the . rtl format and saves the newly created file .