@SuppressWarnings("unchecked") public CppLexer(Filter<CppTokenId> defaultFilter, LexerRestartInfo<CppTokenId> info) { super(info); Filter<CppTokenId> filter = (Filter<CppTokenId>) info.getAttributeValue(CndLexerUtilities.LEXER_FILTER); // NOI18N this.lexerFilter = filter != null ? filter : defaultFilter; }
@SuppressWarnings("unchecked") public FortranLexer(Filter<FortranTokenId> defaultFilter, LexerRestartInfo<FortranTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); Filter<FortranTokenId> filter = (Filter<FortranTokenId>) info.getAttributeValue(CndLexerUtilities.LEXER_FILTER); // NOI18N this.lexerFilter = filter != null ? filter : defaultFilter; Object o = info.getAttributeValue(CndLexerUtilities.FORTRAN_MAXIMUM_TEXT_WIDTH); if(o != null) { this.maximumTextWidth = (Integer) o; } o = info.getAttributeValue(CndLexerUtilities.FORTRAN_FREE_FORMAT); if(o != null) { if (o == FortranFormat.UNDEFINED) { } this.fortranFreeFormat = o == FortranFormat.FREE; } setState((State) info.state()); }
public PreprocLexer(Filter<CppTokenId> defaultFilter, LexerRestartInfo<CppTokenId> info) { super(info); this.preprocFilter = CndLexerUtilities.getPreprocFilter(); this.ompFilter = CndLexerUtilities.getOmpFilter(); @SuppressWarnings("unchecked") Filter<CppTokenId> filter = (Filter<CppTokenId>) info.getAttributeValue(CndLexerUtilities.LEXER_FILTER); this.keywordsFilter = filter != null ? filter : defaultFilter; fromState((Integer) info.state()); // last line in contstructor }
public static GSFPHPLexer create(LexerRestartInfo<PHPTokenId> info, boolean inPHP) { PhpLanguageProperties languageProperties; FileObject fileObject = (FileObject) info.getAttributeValue(FileObject.class); if (fileObject != null) { languageProperties = PhpLanguageProperties.forFileObject(fileObject); } else { languageProperties = PhpLanguageProperties.getDefault(); } boolean aspTag = languageProperties.areAspTagsEnabled(); boolean shortTag = languageProperties.areShortTagsEnabled(); synchronized (GSFPHPLexer.class) { return new GSFPHPLexer(info, shortTag, aspTag, inPHP); } }