public ELLexer(LexerRestartInfo<ELTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); if (info.state() == null) { lexerState = INIT; conditionalOperatorCount = 0; } else { ELState current = (ELState) info.state(); lexerState = current.getState(); conditionalOperatorCount = current.getConditionalCount(); } }
public PHPDocCommentLexer(LexerRestartInfo<PHPDocCommentTokenId> info) { this.tokenFactory = info.tokenFactory(); assert (info.state() == null); // passed argument always null scanner = new DocumentorColoringScanner(info); }
private PHPTopLexer(LexerRestartInfo<PHPTopTokenId> info) { scanner = new PHPTopColoringLexer(info, (State) info.state()); tokenFactory = info.tokenFactory(); }
public RubyCommentLexer(LexerRestartInfo<RubyCommentTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); assert (info.state() == null); // passed argument always null }
/** * 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; } } }
protected CndLexer(LexerRestartInfo<CppTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); setState((Integer) info.state()); // last line in contstructor }
public DoxygenLexer(LexerRestartInfo<DoxygenTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); fromState((Integer)info.state()); }
DockerfileLexer(@NonNull final LexerRestartInfo<DockerfileTokenId> info) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); Object restoredState = info.state(); if (restoredState instanceof Integer) { state = (Integer) restoredState; } }
public CppStringLexer(LexerRestartInfo<CppStringTokenId> info, boolean doubleQuotedString, boolean raw) { this.input = info.input(); this.tokenFactory = info.tokenFactory(); this.dblQuoted = doubleQuotedString; this.rawString = raw; fromState(info.state()); // last line in contstructor }
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 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 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; } }
void restart(LexerRestartInfo<RubyTokenId> info) { inRegexp = substituting = inSymbol = inEmbedded = false; lexer.reset(); input = info.input(); tokenFactory = info.tokenFactory(); String fileName = "unknown"; Reader lexerReader = new LexerInputReader(input); // InputStream lexerInput = new LexerInputStream(input); // We don't need IDE positions during pure syntax lexing; that's only needed during // parsing for AST nodes //lexerSource = new LexerSource(fileName, lexerReader, 0, false); //lexerSource = LexerSource.getSource(fileName, lexerInput, null, null); //XXX: jruby-parser lexerSource = new ReaderLexerSource(fileName, lexerReader, 0); lexer.setSource(lexerSource); Object state = info.state(); if (state instanceof JRubyLexerRestartInfo) { ((JRubyLexerRestartInfo)state).initializeState(this); } else if (state instanceof Integer) { int stateValue = ((Integer)state).intValue(); lexer.setState(LexState.fromOrdinal(stateValue)); } }
private void restart(LexerRestartInfo<GroovyTokenId> info) { tokenFactory = info.tokenFactory(); this.lexerInput = info.input(); LexerSharedInputState inputState = null; if (lexerInput != null) { myCharBuffer = new MyCharBuffer(new LexerInputReader(lexerInput)); inputState = new LexerSharedInputState(myCharBuffer); } scanner.setInputState(inputState); if (inputState != null) { scanner.resetText(); } scanner.setState((State) info.state()); }
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)); } }