Package org.anarres.cpp

Examples of org.anarres.cpp.Token


  public void run(String file) {
    try {
      pp.addInput(new FileLexerSource(new File(file)));

      for (;;) {
        Token tok = pp.token();
        if (tok == null)
          break;
        if (tok.getType() == Token.EOF)
          break;

        if (Token.getTokenName(tok.getType()).equals("{"))
          pl.incLevel();
        else if (Token.getTokenName(tok.getType()).equals("}"))
          pl.decLevel();

        if (tok.getType() != Token.P_LINE)
          pl.getCurrent().write(tok.getText().getBytes());
      }
    } catch (Exception e) {
      e.printStackTrace(System.err);
      logger.error("Preprocessor error.");
      // System.exit(1);
View Full Code Here

TOP

Related Classes of org.anarres.cpp.Token

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.