public RubyCommentLexer(LexerRestartInfo<RubyCommentTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); assert (info.state() == null); // passed argument always null }
@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 CPLexer(LexerRestartInfo<CPTokenId> info) { input = info.input(); tokenFactory = info.tokenFactory(); }
SLexer ( Language language, Map<Integer,STokenId> tokenIDToType, LexerRestartInfo<STokenId> info ) { this.language = language; this.tokenFactory = info.tokenFactory (); this.tokenIDToType = tokenIDToType; this.state = info.state (); parser = language.getParser (); String outerMimeType = info.languagePath ().language (0).mimeType (); try { Language outerLanguage = LanguagesManager.getDefault (). getLanguage (outerMimeType); this.input = createInputBridge (info.input (), outerLanguage); } catch (ParseException ex) { this.input = createInputBridge (info.input (), Language.create (outerMimeType)); } }
public JspLexer(LexerRestartInfo<JspTokenId> info) { this.input = info.input(); this.inputAttributes = info.inputAttributes(); this.tokenFactory = info.tokenFactory(); if (info.state() == null) { lexerState = INIT; lexerStateBeforeEL = INIT; lexerStateBeforeScriptlet = INIT; lexerStateJspScriptlet = INIT; lexerStateCurlyNestedLevel = 0; } else { JspState state = (JspState) info.state(); lexerStateJspScriptlet = state.getLexerStateJspScriptlet(); lexerStateBeforeScriptlet = state.getLexerStateBeforeScriptlet(); lexerStateBeforeEL = state.getLexerStateBeforeEL(); lexerState = state.getLexerState(); lexerStateCurlyNestedLevel = state.getLexerStateCurlyNestedLevel(); } if(inputAttributes != null) { jspParseData = (JspParseData)inputAttributes.getValue(LanguagePath.get(JspTokenId.language()), JspParseData.class); } else { jspParseData = null; } }
public PHPDocCommentLexer(LexerRestartInfo<PHPDocCommentTokenId> info) { this.tokenFactory = info.tokenFactory(); assert (info.state() == null); // passed argument always null scanner = new DocumentorColoringScanner(info); }
CfgPropsLexer(LexerRestartInfo<CfgPropsTokenId> info) { scanner = new CfgPropsScanner(info); tokenFactory = info.tokenFactory(); }
public PHPTopColoringLexer(LexerRestartInfo<PHPTopTokenId> info, State state) { this.input = info.input(); if (state == null) { this.state = State.OUTER; } else { this.state = 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 }
@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; }
private PHPTopLexer(LexerRestartInfo<PHPTopTokenId> info) { scanner = new PHPTopColoringLexer(info, (State) info.state()); tokenFactory = info.tokenFactory(); }
private GSFPHPLexer(LexerRestartInfo<PHPTokenId> info, boolean shortTag, boolean aspTag, boolean inPHP) { scanner = new PHP5ColoringLexer(info, shortTag, aspTag, inPHP); tokenFactory = info.tokenFactory(); }
public ECMAScriptNBLexer(LexerRestartInfo<ECMAScriptTokenId> info) { this.info = info; AntlrCharStream charStream = new AntlrCharStream(info.input(), "ECMAScriptEditor"); lexer = new ECMAScriptLexer(charStream); }
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); } }
/** * A Lexer for ruby strings * @param substituting If true, handle substitution rules for double quoted strings, otherwise * single quoted strings. */ public RubyStringLexer(LexerRestartInfo<RubyStringTokenId> info, boolean substituting) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); this.substituting = substituting; assert (info.state() == null); // passed argument always null }
public PHP5ColoringLexer(LexerRestartInfo info, boolean shortTagsAllowed, boolean aspTagsAllowed, boolean inPHP) { this.input = info.input(); this.aspTagsAllowed = aspTagsAllowed; this.shortTagsAllowed = shortTagsAllowed; if (info.state() != null) { //reset state setState((LexerState) info.state()); } else { //initial state stack.pushStack(YYINITIAL); if (inPHP) { stack.pushStack(ST_PHP_IN_SCRIPTING); zzState = ST_PHP_IN_SCRIPTING; zzLexicalState = ST_PHP_IN_SCRIPTING; } else { zzState = YYINITIAL; zzLexicalState = YYINITIAL; } } }
@Override public Token<ECMAScriptTokenId> nextToken() { org.antlr.v4.runtime.Token token = lexer.nextToken(); if (token.getType() != lexer.EOF) { ECMAScriptTokenId tokenId = ECMAScriptLanguageHierarchy.getToken(token.getType()); return info.tokenFactory().createToken(tokenId); } return null; }
public RhtmlLexer(LexerRestartInfo<RhtmlTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); if (info.state() == null) { this.state = INIT; } else { state = ((Integer) info.state()).intValue(); } }