Package de.fosd.typechef

Examples of de.fosd.typechef.LexerToken


        List<LexerToken> resultTokenList = new ArrayList<LexerToken>();
        int outputLine = 1;
        try {
            // TokenFilter tokenFilter = new TokenFilter();
            for (; ; ) {
                LexerToken tok = pp.getNextToken();
                if (tok == null)
                    break;
                if (tok.isEOF())
                    break;


                if (returnTokenList && (!options.isReturnLanguageTokensOnly() || tok.isLanguageToken())) {
                    resultTokenList.add(tok);
                }

                if (output != null) {
                    if (options.isAdjustLineNumbers()) {
                        //adjust line numbers to .pi file for debugging
                        String image = tok.getText();
                        while (image.indexOf('\n') >= 0) {
                            outputLine++;
                            image = image.substring(image.indexOf('\n') + 1);
                        }
                        tok.setLine(outputLine);
                        if (options.getLexOutputFile() != null)
                            tok.setSourceName(options.getLexOutputFile());
                    }

                    //write to .pi file
                    tok.lazyPrint(output);
                }
            }
        } catch (Throwable e) {
            Preprocessor.logger.severe(e.toString());
            e.printStackTrace(System.err);
View Full Code Here


                        stack.pop();
                        stack.push(stack.peek().and(XtcPreprocessor.translate(c.presenceCondition())));
                    } else stack.pop();
                }

                LexerToken t = new XtcPreprocessor.XtcToken(s, stack.peek());
                if (t.isLanguageToken())
                    result.add(t);

                s = lexer.scan();
            }
        }
View Full Code Here

TOP

Related Classes of de.fosd.typechef.LexerToken

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.