Package cz.juzna.latte.lexer

Source Code of cz.juzna.latte.lexer.Test

package cz.juzna.latte.lexer;


import com.intellij.lexer.Lexer;
import com.intellij.psi.tree.IElementType;

public class Test {
   
    public static void main(String[] args) throws Exception {
        String str = "Ahoj {* tady bude jmeno *} {$jmeno} :) <a href=\"{link Dashboard:signal!, id => $id}\" n:href=\"Novak:detail!\" title=\"lol\">novak</a> {* a tady je konec *}";
        System.out.println(str);

        IElementType el;

        Lexer merge = new LatteLexer();
        merge.start(str);

        while((el = merge.getTokenType()) != null) {
            System.out.printf("%s: %d %d '%s'\n", el.toString(), merge.getTokenStart(), merge.getTokenEnd(), str.substring(merge.getTokenStart(), merge.getTokenEnd()));
            merge.advance();
        }
    }
}
TOP

Related Classes of cz.juzna.latte.lexer.Test

TOP
Copyright © 2018 www.massapi.com. 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.