Package org.antlr.v4.runtime.tree

Examples of org.antlr.v4.runtime.tree.ParseTree


                      "b=6";
        String expected = "2 0 MSTORE 6 32 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();
View Full Code Here


                      "c=b";
        String expected = "2 0 MSTORE 6 32 MSTORE 32 MLOAD 64 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();
View Full Code Here

                      "a=c";
        String expected = "2 0 MSTORE 6 32 MSTORE 32 MLOAD 64 MSTORE 64 MLOAD 0 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();
View Full Code Here

                "a=c\n" +
                "a=d";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        new SerpentToAssemblyCompiler().visit(tree);
        fail("No exception was thrown");
    }
View Full Code Here

        String code = "a = 2 * 2";
        String expected = "2 2 MUL 0 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();

View Full Code Here

        String code = "a = 2 * 2 xor 2 * 2";
        String expected = "2 2 MUL 2 2 MUL XOR 0 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();

View Full Code Here

        String code = "a = 2 | 2 xor 2 * 2";
        String expected = "2 2 MUL 2 XOR 2 OR 0 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();

View Full Code Here

        String code = "a = (2 | 2) xor (2 * 2)";
        String expected = "2 2 MUL 2 2 OR XOR 0 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();

View Full Code Here

        String code = "a = !(2 | 2 xor 2 * 2)";
        String expected = "2 2 MUL 2 XOR 2 OR NOT 0 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();

View Full Code Here

        String code = "a = 2 + 2 * 2 + 2";
        String expected = "2 2 2 MUL 2 ADD ADD 0 MSTORE";

    SerpentParser parser = ParserUtils.getParser(SerpentLexer.class,
        SerpentParser.class, code);
        ParseTree tree = parser.parse();

        String result = new SerpentToAssemblyCompiler().visit(tree);
        result = result.replaceAll("\\s+", " ");
        result = result.trim();

View Full Code Here

TOP

Related Classes of org.antlr.v4.runtime.tree.ParseTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.