Package com.sonar.sslr.api

Examples of com.sonar.sslr.api.TokenType


  }

  @Override
  public PreprocessorAction process(List<Token> tokens) {
    Token token = tokens.get(0);
    TokenType ttype = token.getType();
    File file = getFileUnderAnalysis();
    String filePath = file == null ? token.getURI().toString() : file.getAbsolutePath();

    if (ttype == PREPROCESSOR) {
View Full Code Here


    if (state.skipping) {
      state.nestedIfdefs++;
    }
    else {
      Macro macro = macros.get(getMacroName(ast));
      TokenType tokType = ast.getToken().getType();
      if ((tokType == IFDEF && macro == null) || (tokType == IFNDEF && macro != null)) {
        LOG.trace("[{}:{}]: '{}' evaluated to false, skipping tokens that follow",
            new Object[] {filename, token.getLine(), token.getValue()});
        state.skipping = true;
      }
View Full Code Here

      // do this work to strip potential whitespace between the hash and the directive
      String identifier = word.substring(1, word.length()).trim();
      String potentialKeyword = HASH.getValue() + identifier;

      TokenType keywordType = keywordsMap.get(potentialKeyword);
      if (keywordType != null) {
        Token token = tokenBuilder
            .setType(keywordType)
            .setValueAndOriginalValue(potentialKeyword)
            .setURI(lexer.getURI())
View Full Code Here

TOP

Related Classes of com.sonar.sslr.api.TokenType

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.