Package org.antlr.v4.runtime.tree

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


        String code = "a = 2 / 1 * 2 + 2";
        String expected = "2 2 1 2 DIV MUL 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


        String code = "a = 2 - 0x1a * 5 + 0xA";
        String expected = "10 5 26 MUL 2 SUB 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

        String code = "a = 1 > 2 > 3 > 4";
        String expected = "4 3 2 1 GT GT GT 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 =     !(   1    + 2     *    9 | 8 == 2)";
        String expected = "2 8 EQ 9 2 MUL 1 ADD 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

            LABEL_1 LABEL_0

          */
        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

          */

    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

            LABEL_0
         */

    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

            LABEL_0
         */

    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

            LABEL_0
         */

    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

         */

    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.