private SSTemplateLexer(LexerRestartInfo<SSTemplateTokenId> info) {

    tokenFactory = info.tokenFactory();
    input = info.input();
    state =
        info.state() == null
            ? new SSTemplateLexerState()
            : new SSTemplateLexerState((SSTemplateLexerState) info.state());

    initialize();
  }
Exemple #2
0
  @Override
  public org.netbeans.api.lexer.Token<ScssTokenId> nextToken() {

    org.netbeans.api.lexer.Token<ScssTokenId> result = null;
    ScssTokenId tokenId = (ScssTokenId) ScssLanguageHierarchy.getToken(ScssLexer.WS);
    Token token = lexer.nextToken();

    if (token.getType() != ScssLexer.EOF) {
      tokenId = (ScssTokenId) ScssLanguageHierarchy.getToken(token.getType());
      if (tokenId != null) {
        result = info.tokenFactory().createToken(tokenId);
      } else {
        result =
            info.tokenFactory()
                .createToken((ScssTokenId) ScssLanguageHierarchy.getToken(ScssLexer.WS));
      }
    } else if (info.input().readLength() > 0) {
      tokenId = (ScssTokenId) ScssLanguageHierarchy.getToken(ScssLexer.WS);
      result = info.tokenFactory().createToken(tokenId, info.input().readLength(), PartType.MIDDLE);
    }

    return result;
  }
 public NbCss3Lexer(LexerRestartInfo<CssTokenId> info) {
   tokenFactory = info.tokenFactory();
   antlrLexer = new ExtCss3Lexer(new CaseInsensitiveNbLexerCHS(info));
 }
 public CoffeeScriptRegexpLexer(LexerRestartInfo<CoffeeScriptRegexpTokenId> info) {
   super(info.input(), info.tokenFactory());
   inEmbedded = info.state() instanceof Boolean ? (Boolean) info.state() : false;
 }