Просмотр исходного кода

array syntax stuff, simpler syntax handling, pre- and postincrement syntax, functions

Kajetan Johannes Hammerle 7 лет назад
Родитель
Сommit
ca08fa3957

+ 2 - 0
.gitignore

@@ -1,3 +1,5 @@
+.DS_Store
+/nbproject
 /build
 /dist
 /todo.html

+ 1 - 6
nbproject/private/private.xml

@@ -2,11 +2,6 @@
 <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
     <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
     <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
-        <group>
-            <file>file:/home/kajetan/Dropbox/Projekte/Informatik/SnuviScript/src/me/hammerle/code/LineCompiler.java</file>
-            <file>file:/home/kajetan/Dropbox/Projekte/Informatik/SnuviScript/todo.html</file>
-            <file>file:/home/kajetan/Dropbox/Projekte/Informatik/SnuviScript/src/me/hammerle/code/SnuviParser.java</file>
-            <file>file:/home/kajetan/Dropbox/Projekte/Informatik/SnuviScript/src/me/hammerle/snuviscript/SnuviScript.java</file>
-        </group>
+        <group/>
     </open-files>
 </project-private>

+ 226 - 217
src/me/hammerle/code/Code.java

@@ -37,6 +37,7 @@ public class Code
     
     public void executeFunction(SnuviParser parser, Script sc, Stack<Object> stack)
     {
+        //System.out.println("EXE: " + this.toString());
         if(function == null)
         {
             if(value != null)
@@ -316,261 +317,269 @@ public class Code
     
     public static Code[] generate(SnuviParser parser, String scriptName, String code, HashMap<String, Integer> gotos)
     {
-        System.out.print("Starting '" + scriptName + "' ... ");
-        long startTime = System.currentTimeMillis();
-        
-        Code.scriptName = scriptName;
-        
-        StringBuilder sb = new StringBuilder(code);
-        
-        // ---------------------------------------------------------------------
-        // comments
-        // ---------------------------------------------------------------------
-        
-        removeComments(sb);
-        
-        // ---------------------------------------------------------------------
-        // replacing Strings with #... to get rid of " 
-        // ---------------------------------------------------------------------
-        
-        HashMap<String, String> strings = replaceStrings(sb);
-        
-        // ---------------------------------------------------------------------
-        // allowing labels without ;
-        // ---------------------------------------------------------------------
-        
-        formatLabels(sb);
-        
-        code = sb.toString();
-        
-        // ---------------------------------------------------------------------
-        // split code into lines
-        // ---------------------------------------------------------------------
-
-        ArrayList<String> lines = new ArrayList<>();
         int lineCounter = 1;
-        ArrayList<Integer> realCodeLine = new ArrayList<>();
-        int old = 0;
-        int pos = 0;
-        int length = code.length();
-        int counter = 0;
-        int bracketCounter = 0;
-        boolean closed = true;
-        Stack<Integer> brackets = new Stack<>();
-        while(pos < length)
-        {
-            switch(code.charAt(pos))
-            {
-                case '(':
-                    closed = false;
-                    bracketCounter++;
-                    break;
-                case ')':
-                    bracketCounter--;
-                    break;
-                case ';':
-                    if(bracketCounter != 0)
-                    {
-                        throw new PreScriptException(scriptName, lineCounter, "unbalanced ()");
-                    }
-                    lines.add(removeNonSyntax(code.substring(old, pos)));
-                    realCodeLine.add(lineCounter);
-                    old = pos + 1;
-                    closed = true;
-                    break;
-                case '{':
-                    if(bracketCounter != 0)
-                    {
-                        throw new PreScriptException(scriptName, lineCounter, "unbalanced ()");
-                    }
-                    brackets.push(lineCounter);
-                    counter++;
-                    lines.add(removeNonSyntax(code.substring(old, pos)));
-                    realCodeLine.add(lineCounter);
-                    old = pos + 1;
-                    lines.add("{");
-                    realCodeLine.add(lineCounter);
-                    break;
-                case '}':
-                    if(!closed)
-                    {
-                        throw new PreScriptException(scriptName, lineCounter, "missing ;");
-                    }
-                    else if(bracketCounter != 0)
-                    {
-                        throw new PreScriptException(scriptName, lineCounter, "unbalanced ()");
-                    }
-                    counter--;
-                    if(counter < 0)
-                    {
-                        throw new PreScriptException(scriptName, lineCounter, "unexpected }");
-                    }
-                    old = pos + 1;
-                    lines.add("}");
-                    realCodeLine.add(lineCounter);
-                    brackets.pop();
-                    break;
-                case '\n':
-                    lineCounter++;
-                    break;
-            }
-            pos++;
-        }
-        // well the second check should be useless
-        if(counter != 0 && !brackets.isEmpty())
+        try
         {
-            throw new PreScriptException(scriptName, brackets.pop(), "unbalanced {}");
-        }
-        
-        // ---------------------------------------------------------------------
-        // generating byte code
-        // ---------------------------------------------------------------------
+            //System.out.print("Starting '" + scriptName + "' ... ");
+            //long startTime = System.currentTimeMillis();
 
-        LineCompiler compiler = new LineCompiler(parser, scriptName);
-        ArrayList<Code> co = new ArrayList<>();    
-        int line;
-        byte layer = 0;
-        String s;
-        for(int i = 0; i < lines.size(); i++)
-        {
-            s = lines.get(i);
-            //System.out.println(s);
-            if(s.isEmpty() || s.equals("{"))
-            {
-                continue;
+            Code.scriptName = scriptName;
+
+            StringBuilder sb = new StringBuilder(code);
+
+            // ---------------------------------------------------------------------
+            // comments
+            // ---------------------------------------------------------------------
+
+            removeComments(sb);
+
+            // ---------------------------------------------------------------------
+            // replacing Strings with #... to get rid of " 
+            // ---------------------------------------------------------------------
+
+            HashMap<String, String> strings = replaceStrings(sb);
+
+            // ---------------------------------------------------------------------
+            // allowing labels without ;
+            // ---------------------------------------------------------------------
+
+            formatLabels(sb);
+
+            code = sb.toString();
+
+            // ---------------------------------------------------------------------
+            // split code into lines
+            // ---------------------------------------------------------------------
+
+            ArrayList<String> lines = new ArrayList<>();
+            lineCounter = 1;
+            ArrayList<Integer> realCodeLine = new ArrayList<>();
+            int old = 0;
+            int pos = 0;
+            int length = code.length();
+            int counter = 0;
+            int bracketCounter = 0;
+            boolean closed = true;
+            Stack<Integer> brackets = new Stack<>();
+            while(pos < length)
+            {
+                switch(code.charAt(pos))
+                {
+                    case '(':
+                        closed = false;
+                        bracketCounter++;
+                        break;
+                    case ')':
+                        bracketCounter--;
+                        break;
+                    case ';':
+                        if(bracketCounter != 0)
+                        {
+                            throw new PreScriptException(scriptName, lineCounter, "unbalanced ()");
+                        }
+                        lines.add(removeNonSyntax(code.substring(old, pos)));
+                        realCodeLine.add(lineCounter);
+                        old = pos + 1;
+                        closed = true;
+                        break;
+                    case '{':
+                        if(bracketCounter != 0)
+                        {
+                            throw new PreScriptException(scriptName, lineCounter, "unbalanced ()");
+                        }
+                        brackets.push(lineCounter);
+                        counter++;
+                        lines.add(removeNonSyntax(code.substring(old, pos)));
+                        realCodeLine.add(lineCounter);
+                        old = pos + 1;
+                        lines.add("{");
+                        realCodeLine.add(lineCounter);
+                        break;
+                    case '}':
+                        if(!closed)
+                        {
+                            throw new PreScriptException(scriptName, lineCounter, "missing ;");
+                        }
+                        else if(bracketCounter != 0)
+                        {
+                            throw new PreScriptException(scriptName, lineCounter, "unbalanced ()");
+                        }
+                        counter--;
+                        if(counter < 0)
+                        {
+                            throw new PreScriptException(scriptName, lineCounter, "unexpected }");
+                        }
+                        old = pos + 1;
+                        lines.add("}");
+                        realCodeLine.add(lineCounter);
+                        brackets.pop();
+                        break;
+                    case '\n':
+                        lineCounter++;
+                        break;
+                }
+                pos++;
             }
-            else if(s.equals("break") || s.equals("continue"))
+            // well the second check should be useless
+            if(counter != 0 && !brackets.isEmpty())
             {
-                co.add(new Code(s, 0, realCodeLine.get(i), layer));
-                continue;
+                throw new PreScriptException(scriptName, brackets.pop(), "unbalanced {}");
             }
-            else if(lines.get(Math.min(i + 1, lines.size() - 1)).equals("{"))
-            {
-                layer++;
-                if(s.equals("try") || s.equals("catch") || s.equals("else"))
+
+            // ---------------------------------------------------------------------
+            // generating byte code
+            // ---------------------------------------------------------------------
+
+            LineCompiler compiler = new LineCompiler(parser, scriptName);
+            ArrayList<Code> co = new ArrayList<>();    
+            int line;
+            byte layer = 0;
+            String s;
+            for(int i = 0; i < lines.size(); i++)
+            {
+                s = lines.get(i);
+                //System.out.println(s);
+                if(s.isEmpty() || s.equals("{"))
                 {
-                    co.add(new Code(s, 0, realCodeLine.get(i), layer));
                     continue;
                 }
-            }
-            else if(s.equals("}"))
-            {
-                layer--;
-                co.add(new Code("gotoline", 0, realCodeLine.get(i), layer));
-                continue;
-            }
-            else if(s.charAt(0) == '@')
-            {
-                gotos.put(s.substring(1), co.size());
-                continue;
-            }
-            line = realCodeLine.get(i);
-            compiler.reset(line, layer, s);
-            compiler.compile(co, strings);
-            co.get(co.size() - 1).stackPush = false;
-        }
-        
-        // ---------------------------------------------------------------------
-        // generating gotos of key words
-        // ---------------------------------------------------------------------
-        
-        Code[] c = co.toArray(new Code[co.size()]);
-        //java.util.Arrays.stream(c).forEach(cod -> System.out.println(cod.toString()));
-        
-        //System.exit(0);
-        int oldLayer = 0;
-        int newLayer;
-        for(int i = 0; i < c.length; i++)
-        {
-            newLayer = c[i].layer;
-            if(oldLayer < newLayer)
-            {
-                int j = findKeyWord(i, c);
-                if(j == 0)
+                else if(s.equals("break") || s.equals("continue") || s.equals("return"))
                 {
-                    //java.util.Arrays.stream(c).forEach(cod -> System.out.println(cod.toString()));
-                    throw new PreScriptException(scriptName, c[i].realLine, "well, fuck this, this should never happen");
+                    co.add(new Code(s, 0, realCodeLine.get(i), layer));
+                    continue;
                 }
-                boolean jumpBack = j < 0;
-                j = Math.abs(j);
-                int k;
-                for(k = j; k < c.length; k++)
+                else if(lines.get(Math.min(i + 1, lines.size() - 1)).equals("{"))
                 {
-                    if(c[k].layer < newLayer)
+                    layer++;
+                    if(s.equals("try") || s.equals("catch") || s.equals("else"))
                     {
-                        break;
+                        co.add(new Code(s, 0, realCodeLine.get(i), layer));
+                        continue;
                     }
                 }
-                c[j].value = k - j;
-                if(jumpBack)
+                else if(s.equals("}"))
                 {
-                    c[k].value = i - k - 1;
+                    layer--;
+                    co.add(new Code("gotoline", 0, realCodeLine.get(i), layer));
+                    continue;
                 }
-                else
+                else if(s.charAt(0) == '@')
                 {
-                    c[k].value = 0;
+                    gotos.put(s.substring(1), co.size());
+                    continue;
                 }
+                line = realCodeLine.get(i);
+                compiler.reset(line, layer, s);
+                compiler.compile(co, strings);
+                co.get(co.size() - 1).stackPush = false;
             }
-            oldLayer = newLayer;
-        }
-        
-        // ---------------------------------------------------------------------
-        // generating break and continue
-        // ---------------------------------------------------------------------
 
-        String f;
-        Code data;
-        for(int i = 0; i < c.length; i++)
-        {
-            f = c[i].function;
-            if(f != null)
+            // ---------------------------------------------------------------------
+            // generating gotos of key words
+            // ---------------------------------------------------------------------
+
+            Code[] c = co.toArray(new Code[co.size()]);
+            //java.util.Arrays.stream(c).forEach(cod -> System.out.println(cod.toString()));
+
+            //System.exit(0);
+            int oldLayer = 0;
+            int newLayer;
+            for(int i = 0; i < c.length; i++)
             {
-                if(f.equals("break"))
+                newLayer = c[i].layer;
+                if(oldLayer < newLayer)
                 {
-                    for(int j = i; j < c.length; j++)
+                    int j = findKeyWord(i, c);
+                    if(j == 0)
+                    {
+                        //java.util.Arrays.stream(c).forEach(cod -> System.out.println(cod.toString()));
+                        throw new PreScriptException(scriptName, c[i].realLine, "well, fuck this, this should never happen");
+                    }
+                    boolean jumpBack = j < 0;
+                    j = Math.abs(j);
+                    int k;
+                    for(k = j; k < c.length; k++)
                     {
-                        data = c[j];
-                        if("gotoline".equals(data.function) && data.value != null && (int) data.value != 0)
+                        if(c[k].layer < newLayer)
                         {
-                            c[i].value = j - i;
-                            j += (int) data.value + 1;
-                            for(; j < c.length; j++)
+                            break;
+                        }
+                    }
+                    c[j].value = k - j;
+                    if(jumpBack)
+                    {
+                        c[k].value = i - k - 1;
+                    }
+                    else
+                    {
+                        c[k].value = 0;
+                    }
+                }
+                oldLayer = newLayer;
+            }
+
+            // ---------------------------------------------------------------------
+            // generating break and continue
+            // ---------------------------------------------------------------------
+
+            String f;
+            Code data;
+            for(int i = 0; i < c.length; i++)
+            {
+                f = c[i].function;
+                if(f != null)
+                {
+                    if(f.equals("break"))
+                    {
+                        for(int j = i; j < c.length; j++)
+                        {
+                            data = c[j];
+                            if("gotoline".equals(data.function) && data.value != null && (int) data.value != 0)
                             {
-                                if("while".equals(c[j].function))
-                                {
-                                    break;
-                                }
-                                else if("for".equals(c[j].function))
+                                c[i].value = j - i;
+                                j += (int) data.value + 1;
+                                for(; j < c.length; j++)
                                 {
-                                    c[i] = new Code("breakreset", 0, c[i].value, c[i].realLine, c[i].layer);
+                                    if("while".equals(c[j].function))
+                                    {
+                                        break;
+                                    }
+                                    else if("for".equals(c[j].function))
+                                    {
+                                        c[i] = new Code("breakreset", 0, c[i].value, c[i].realLine, c[i].layer);
+                                    }
                                 }
+                                break;
                             }
-                            break;
                         }
                     }
-                }
-                else if(f.equals("continue"))
-                {
-                    for(int j = i; j < c.length; j++)
+                    else if(f.equals("continue"))
                     {
-                        data = c[j];
-                        if("gotoline".equals(data.function) && data.value != null && (int) data.value != 0)
+                        for(int j = i; j < c.length; j++)
                         {
-                            c[i].value = j - i + (int) data.value;
-                            break;
+                            data = c[j];
+                            if("gotoline".equals(data.function) && data.value != null && (int) data.value != 0)
+                            {
+                                c[i].value = j - i + (int) data.value;
+                                break;
+                            }
                         }
                     }
+
                 }
-                
             }
-        }
 
-        // end
-        System.out.println((System.currentTimeMillis() - startTime) + " ms");  
-        //java.util.Arrays.stream(c).forEach(cod -> System.out.println(cod.toString()));
-        //gotos.forEach((k, v) -> System.out.println("Lable " + k + "   " + v));   
-        //System.exit(0);
-        return c;
+            // end
+            //System.out.println((System.currentTimeMillis() - startTime) + " ms");  
+            //java.util.Arrays.stream(c).forEach(cod -> System.out.println(cod.toString()));
+            //gotos.forEach((k, v) -> System.out.println("Lable " + k + "   " + v));   
+            //System.exit(0);
+            return c;
+        }
+        catch(IndexOutOfBoundsException ex)
+        {
+            throw new PreScriptException(scriptName, lineCounter, "unbalanced {}");
+        }
     }     
     
     private static int findKeyWord(int start, Code[] c)

+ 1 - 7
src/me/hammerle/code/LineCompiler.java

@@ -3,7 +3,6 @@ package me.hammerle.code;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Stack;
-import me.hammerle.exceptions.NoSuchMethodException;
 import me.hammerle.exceptions.PreScriptException;
 import me.hammerle.math.Fraction;
 
@@ -416,12 +415,7 @@ public class LineCompiler
                             j--;
                         }
                         j++;
-                        String functionName = line.substring(j, old).toLowerCase();
-                        if(!parser.isRegisteredFunction(functionName))
-                        {
-                            throw new NoSuchMethodException(scriptName, realLine, functionName);
-                        }
-                        co.add(new Code(functionName, commas, realLine, layer));
+                        co.add(new Code(line.substring(j, old).toLowerCase(), commas, realLine, layer));
                         lastSpecial.push(j);
                     }
                 }

+ 46 - 6
src/me/hammerle/code/Script.java

@@ -25,6 +25,7 @@ public class Script
     private final HashMap<String, Integer> gotos;
     private final HashSet<String> events;
     private final Stack<Object> valueStack;
+    private final Stack<Object> functionStack;
     private final Stack<Integer> returnStack;
     private final TreeMap<Integer, Fraction> forMap;
     
@@ -52,6 +53,7 @@ public class Script
         gotos = new HashMap<>();
         events = new HashSet<>();
         valueStack = new Stack<>();
+        functionStack = new Stack<>();
         returnStack = new Stack<>();
         forMap = new TreeMap<>();
         
@@ -86,6 +88,7 @@ public class Script
     {       
         gotos.clear();
         valueStack.clear();
+        functionStack.clear();
         returnStack.clear();
         forMap.clear();
         this.code = Code.generate(parser, name, code, gotos);
@@ -291,8 +294,7 @@ public class Script
         if(loopCounter > 50)
         {
             resetLoopCounter();
-            parser.logger.printException(new CodeTooLongException(), null, this, getActiveRealCodeLine());
-            throw new HoldCodeException();
+            throw new CodeTooLongException();
         }
     }
     
@@ -301,8 +303,7 @@ public class Script
         Integer i = gotos.get(label);
         if(i == null)
         {
-            parser.logger.printException(new GotoLabelNotFoundException(label), "goto", this, getActiveRealCodeLine());
-            throw new HoldCodeException();
+            throw new GotoLabelNotFoundException(label);
         }
         forMap.clear();
         incLoopCounter();
@@ -371,9 +372,9 @@ public class Script
         return tryJumpLine; 
     }
     
-    // -----------------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     // for
-    // -----------------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     
     public boolean repeatFinished(Fraction value, Fraction step, Fraction border)
     {
@@ -402,4 +403,43 @@ public class Script
     {
         forMap.pollLastEntry();
     }
+    
+    // -------------------------------------------------------------------------
+    // push, pop stuff for functions
+    // -------------------------------------------------------------------------
+    
+    public void pushFunctionInput(Object[] o)
+    {
+        for(Object ob : o) 
+        {
+            valueStack.push(ob);
+        }
+    }
+    
+    public void pushFunctionInput(Object[] o, Fraction f)
+    {
+        pushFunctionInput(o);
+        valueStack.push(f);
+    }
+    
+    public Object popFunctionInput()
+    {
+        return valueStack.pop();
+    }
+    
+    public void push(int start, Object... o)
+    {
+        for(int i = start; i < o.length; i++)
+        {
+            functionStack.push(o[i]);
+        }
+    }
+    
+    public void pop(Object... o)
+    {
+        for(int i = o.length - 1; i >= 0; i--)
+        {
+            setVar(o[i].toString(), functionStack.pop());
+        }
+    }
 }

+ 38 - 2
src/me/hammerle/code/SnuviParser.java

@@ -25,6 +25,7 @@ import java.util.function.Consumer;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
 import me.hammerle.exceptions.FileIOException;
+import me.hammerle.exceptions.GotoLabelNotFoundException;
 import me.hammerle.exceptions.PreScriptException;
 import me.hammerle.math.Fraction;
 
@@ -535,12 +536,25 @@ public class SnuviParser
                 sc.resetLoopCounter());
         registerConsumer("wait", (args, sc) -> 
                 { sc.resetLoopCounter(); throw new HoldCodeException(); });
+        
+        // branching
         registerConsumer("goto", (args, sc) -> 
                 sc.gotoLabel(args[0].toString(), false));
         registerConsumer("sgoto", (args, sc) -> 
                 scheduleGoto(args, sc));
         registerConsumer("gosub", (args, sc) -> 
                 sc.gotoLabelWithReturn(args[0].toString()));
+        // push / pop values for functions
+        registerConsumer("pusharg", (args, sc) -> 
+                sc.pushFunctionInput(args));
+        registerFunction("poparg", (args, sc) -> 
+                sc.popFunctionInput());
+        // push / pop values for saving
+        registerConsumer("push", (args, sc) -> 
+                sc.push(0, args));
+        registerConsumer("pop", (args, sc) -> 
+                sc.pop(args));
+        
         registerConsumer("return", (args, sc) -> 
                 sc.doReturn());
         registerConsumer("try", (args, sc) -> 
@@ -613,7 +627,21 @@ public class SnuviParser
     {
         try
         {
-            return functions.get(function).apply(args, sc);
+            BiFunction<Object[], Script, Object> bif = functions.get(function);
+            if(bif == null)
+            {
+                try
+                {
+                    sc.gotoLabelWithReturn(function);
+                    sc.pushFunctionInput(args, new Fraction(args.length));
+                    return Void.TYPE;
+                }
+                catch(GotoLabelNotFoundException ex)
+                {
+                    throw new NoSuchMethodException(function);
+                }
+            }
+            return bif.apply(args, sc);
         }
         catch(HoldCodeException ex)
         {
@@ -719,7 +747,15 @@ public class SnuviParser
     
     public Script startScript(String scriptName, String code)
     { 
-        return startScript(new Script(this, idCounter, scriptName, code));
+        try
+        { 
+            return startScript(new Script(this, idCounter, scriptName, code));
+        }
+        catch(PreScriptException ex)
+        {
+            logger.printException(ex, null, scriptName, ex.getLine());
+            return null;
+        }
     }
     
     public <T extends Script> T startScript(Class<T> c, String scriptName, String code, boolean b, Object... o)

+ 0 - 9
src/me/hammerle/exceptions/NoSuchMethodException.java

@@ -1,9 +0,0 @@
-package me.hammerle.exceptions;
-
-public class NoSuchMethodException extends PreScriptException
-{
-    public NoSuchMethodException(String scriptName, int line, String error) 
-    {
-        super(scriptName, line, error);
-    }
-}

+ 8 - 8
src/me/hammerle/snuviscript/SnuviScript.java

@@ -54,8 +54,7 @@ public class SnuviScript
                 return 0;
             }
         });
-        parser.registerConsumer("debug", (o, sc) -> System.out.println(o[0]));
-        parser.registerConsumer("deb.ug", (o, sc) -> System.out.println(o[0]));
+        parser.registerConsumer("print", (o, sc) -> System.out.println(o[0]));
         //parser.registerFunction("ggv", (o, sc) -> o[0]);
         //parser.registerFunction("read.item", (o, sc) -> o[0]);
              
@@ -109,12 +108,13 @@ public class SnuviScript
             //String s = "wusi = 3; wusi /= 2; debug(wusi);";
             // array.set("wusi", 1, arrays.get("wusi", 1) + 4)
             //String s = "debug(wusi[1]);";
-            String s = "for(\"i\", 4, 10, 1)\n" +
-"{\n" +
-"    debug(i);\n" +
-//"    goto(\"wusi\");\n" +
-"    @wusi;\n" +
-"} ";
+            String s = "print(\"wusi\");\n" +
+"print(hallo(1, 3, 5));\n" +
+"term();\n" +
+"\n" +
+"@hallo;\n" +
+"pushArg(popArg() + popArg() + popArg() + popArg());\n" +
+"return;";
             //String s = "i = 0; while(i++ < 10) { debug(i);}";
             //String s = "error(); debug(1+1);";
             //System.out.println(s);