Package org.jvnet.sorcerer.impl

Examples of org.jvnet.sorcerer.impl.JavaLexer


     */
    protected void configure(final CompilationUnitTree cu, final AstGenerator gen) throws IOException {
        final LineMap lineMap = cu.getLineMap();

        // add lexical markers
        JavaLexer lexer = new JavaLexer(new CharSequenceReader(gen.sourceFile));
        lexer.setTabSize(tabWidth);
        try {
            Stack<Long> openBraces = new Stack<Long>();

            while(true) {
                Token token = lexer.nextToken();
                int type = token.getType();
                if(type == JavaTokenTypes.EOF)
                    break;
                if(type == JavaTokenTypes.IDENT && ReservedWords.LIST.contains(token.getText()))
                    gen.add(new Tag.ReservedWord(lineMap,token));
View Full Code Here


            pos = pss.getSourcePositions().getEndPosition(compUnit, t);
        else
            pos = pss.getSourcePositions().getStartPosition(compUnit, t);

        if(pos<0)   return null;
        JavaLexer lexer = new JavaLexer(new CharSequenceReader(sourceFile.subSequence((int)pos, sourceFile.length())));
        lexer.setTabSize(pss.getTabWidth());
        try {
            while(true) {
                Token token = lexer.nextToken();
                int type = token.getType();
                if(type == JavaTokenTypes.EOF)
                    break;
                if(type == JavaTokenTypes.IDENT) {
                    if(id!=null && !token.getText().equals(id))
View Full Code Here

TOP

Related Classes of org.jvnet.sorcerer.impl.JavaLexer

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.