import java.util.*;
import java.io.*;

public class Fifth {
    public static final String VERSION = "1";

    public static Fifth instance;

    public static void main(String[] a) throws IOException{
        if(a.length == 1){
            File f = new File(a[0]);
            instance = new Fifth(f);
        } else {
            instance = new Fifth();
        }
    }

    File file;
    Stack stack;

    public Fifth(File f) throws IOException{
        this.stack = new Stack(64 * 1024);
        this.file = f;
        FileReader fr = new FileReader(this.file);
        BufferedReader br = new BufferedReader(fr);
        String line;
        while((line = br.readLine()) != null){
            for(char c : line.trim().toCharArray()){
                try{
                    parse(c);
                }catch(Exception e){e.printStackTrace();}
            }
        }
        br.close();
        fr.close();
    }

    public Fifth(){
        Scanner sn = new Scanner(System.in);
        while(true){
            System.out.print("fifth" + VERSION + " >> ");
            for(char c : sn.nextLine().toCharArray()){
                try{
                    parse(c);
                }catch(Exception e){e.printStackTrace();}
            }
        }
    }

    //Variables for parsing
    StringBuilder sb;
    boolean string = false;

    public void parse(char c) throws NumberFormatException{
        if(String.valueOf(c).matches("[0-9A-Z]")){
            stack.push(Integer.parseInt(c, 36)
        }
        else if(c == '"'){
            if(string){
                String p = sb.toString();
                sb = null;
                stack.push(p);
            }else{
                sb = new StringBuilder();
                string = true;
            }
        }
        else if(string){
            sb.append(c);
        }
        else if(c == ';'){
            stack.pop();
        }
        else if(c == '.'){
            Object x = stack.pop();
            stack.push(x);
            stack.push(x);
        }
        else if(c == '\\'){
            Object x = stack.pop();
            Object y = stack.pop();
            stack.push(x);
            stack.push(y);
        }
        else if(c == '@'){
            Object x = stack.pop();
            Object y = stack.pop();
            Object z = stack.pop();
            stack.push(y);
            stack.push(x);
            stack.push(z);
        }
        else if(c == 'r'){
            stack.reverse();
        }
        else if(c == 'l'){
            stack.push(stack.length());
        }
        else if(c == 'o'){
            System.out.println(stack.pop().toString());
        }
    }

}

class Stack {
    Object[] stack;
    int i = -1;

    public Stack(int size){
        stack = new Object[size];
    }

    public void push(Object x){
        if(i >= stack.length -1) throw new ArrayIndexOutOfBoundsException("Can't push to full stack: " + x.toString());
        stack[++i] = x;
    }

    public Object pop(){
        if (i <= -1) throw new ArrayIndexOutOfBoundsException("Can't pop from empty stack! ");
        Object x = stack[i];
        stack[i] = 0;
        i--;
        return x;
    }

    public void reverse(){
        for (int left = 0, right = i; left < right; left++, right--) {
            double x = stack[left];
            stack[left] = stack[right];
            stack[right] = x;
        }
    }

    public int length(){
        return i+1;
    }

}

@@ -1281,16 +1281,175 @@
 parsing%0A
+    ArrayList%3CCodeBlock%3E codeBlocks = new ArrayList%3CCodeBlock%3E();%0A    boolean codeBlock = false;%0A    boolean blockCreate = false;%0A    StringBuilder cb = null;%0A
     Stri
@@ -1460,16 +1460,23 @@
 ilder sb
+ = null
 ;%0A    bo
@@ -1566,16 +1566,596 @@
         
+for(CodeBlock cb : codeBlocks)%7B%0A            if(cb.name == c)%7B%0A                cb.run();%0A                return;%0A            %7D%0A        %7D%0A%0A        %0A        if(c == '%7B')%7B%0A            cb = new StringBuilder();%0A            codeBlock = true;%0A        %7D%0A        else if(c == '%7D')%7B%0A            cb = null;%0A            codeBlock = false;%0A            blockCreate = true;%0A        %7D%0A        else if(blockCreate)%7B%0A            codeBlocks.add(new CodeBlock(c, cb.toString()));%0A            blockCreate = false;%0A        %7D%0A        else if(codeBlock)%7B%0A            cb.append(c);%0A        %7D%0A        else 
 if(Strin
@@ -4178,16 +4178,394 @@
 n i+1;%0A    %7D%0A%0A%7D%0A
+%0Aclass CodeBlock %7B%0A%0A    public String code;%0A    public char name;%0A%0A    public CodeBlock(String code, char name) %7B%0A        this.code = code;%0A        this.name = name;%0A    %7D%0A%0A    public void run() %7B%0A        for (char c : code.toCharArray()) %7B%0A            try %7B%0A                Fifth.instance.parse(c, true);%0A            %7Dcatch(Exception e)%7Be.printStackTrace();%7D%0A        %7D%0A    %7D%0A%7D%0A

implement code blocks