Package org.apache.felix.gogo.runtime

Examples of org.apache.felix.gogo.runtime.Tokenizer


    }

    // hello world
    private void testHello(CharSequence text) throws Exception
    {
        Tokenizer t = new Tokenizer(text);
        assertEquals(Type.WORD, t.next());
        assertEquals("hello", t.value().toString());
        assertEquals(Type.WORD, t.next());
        assertEquals("world", t.value().toString());
        assertEquals(Type.NEWLINE, t.next());
        assertEquals(Type.EOT, t.next());
    }
View Full Code Here


    }

    // 'single quote' "double quote"
    private void testString(CharSequence text) throws Exception
    {
        Tokenizer t = new Tokenizer(text);
        assertEquals(Type.WORD, t.next());
        assertEquals("'single $quote'", t.value().toString());
        assertEquals(Type.WORD, t.next());
        assertEquals("\"double $quote\"", t.value().toString());
        assertEquals(Type.NEWLINE, t.next());
        assertEquals(Type.EOT, t.next());
    }
View Full Code Here

    /*
     * x = {echo $args};
     */
    private void testClosure2(CharSequence text) throws Exception
    {
        Tokenizer t = new Tokenizer(text);
        assertEquals(Type.WORD, t.next());
        assertEquals("x", t.value().toString());
        assertEquals(Type.ASSIGN, t.next());
        assertEquals(Type.CLOSURE, t.next());
        assertEquals(" echo '}' $args //comment's\n", t.value().toString());
        assertEquals(Type.NEWLINE, t.next());
        assertEquals(Type.EOT, t.next());
    }
View Full Code Here

        assertEquals(Type.EOT, t.next());
    }

    private Type token1(CharSequence text) throws Exception
    {
        Tokenizer t = new Tokenizer(text);
        Type type = t.next();
        assertEquals(Type.EOT, t.next());
        return type;
    }
View Full Code Here

TOP

Related Classes of org.apache.felix.gogo.runtime.Tokenizer

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.