boolean eof = zzRefill(); { start = zzMarkedPos; addToken(Token.OPERATOR); yybegin(VALUE); { addToken(Token.IDENTIFIER); { addToken(Token.WHITESPACE); { start = zzMarkedPos; addToken(Token.OPERATOR); { addToken(Token.COMMENT_EOL); { addToken(Token.PREPROCESSOR); { addToken(Token.DATA_TYPE); switch (zzLexicalState) { case YYINITIAL: { addNullToken(); return firstToken; addNullToken(); return firstToken; zzScanError(ZZ_NO_MATCH);
/** * Returns the first token in the linked list of tokens generated * from <code>text</code>. This method must be implemented by * subclasses so they can correctly implement syntax highlighting. * * @param text The text from which to get tokens. * @param initialTokenType The token type we should start with. * @param startOffset The offset into the document at which * <code>text</code> starts. * @return The first <code>Token</code> in a linked list representing * the syntax highlighted text. */ @Override public Token getTokenList(Segment text, int initialTokenType, int startOffset) { resetTokenList(); this.offsetShift = -text.offset + startOffset; // Start off in the proper state. int state = YYINITIAL; s = text; try { yyreset(zzReader); yybegin(state); return yylex(); } catch (IOException ioe) { ioe.printStackTrace(); return new TokenImpl(); } }
/** * Pushes the specified amount of characters back into the input stream. * * They will be read again by then next call of the scanning method * * @param number the number of characters to be read again. * This number must not be greater than yylength()! */ public void yypushback(int number) { if ( number > yylength() ) zzScanError(ZZ_PUSHBACK_2BIG); zzMarkedPos -= number; }
/** * Adds the token specified to the current linked list of tokens. * * @param tokenType The token's type. */ private void addToken(int tokenType) { addToken(zzStartRead, zzMarkedPos-1, tokenType); }
private static int [] zzUnpackAction() { int [] result = new int[10]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; }
/** * Adds the token specified to the current linked list of tokens. * * @param tokenType The token's type. */ private void addToken(int start, int end, int tokenType) { int so = start + offsetShift; addToken(zzBuffer, start,end, tokenType, so); }
private static int [] zzUnpackAction() { int [] result = new int[10]; int offset = 0; offset = zzUnpackAction(ZZ_ACTION_PACKED_0, offset, result); return result; }
boolean eof = zzRefill(); { start = zzMarkedPos; addToken(Token.OPERATOR); yybegin(VALUE); { addToken(Token.IDENTIFIER); { addToken(Token.WHITESPACE); { start = zzMarkedPos; addToken(Token.OPERATOR); { addToken(Token.COMMENT_EOL); { addToken(Token.PREPROCESSOR); { addToken(Token.DATA_TYPE); switch (zzLexicalState) { case YYINITIAL: { addNullToken(); return firstToken; addNullToken(); return firstToken; zzScanError(ZZ_NO_MATCH);
/** * Returns the first token in the linked list of tokens generated * from <code>text</code>. This method must be implemented by * subclasses so they can correctly implement syntax highlighting. * * @param text The text from which to get tokens. * @param initialTokenType The token type we should start with. * @param startOffset The offset into the document at which * <code>text</code> starts. * @return The first <code>Token</code> in a linked list representing * the syntax highlighted text. */ @Override public Token getTokenList(Segment text, int initialTokenType, int startOffset) { resetTokenList(); this.offsetShift = -text.offset + startOffset; // Start off in the proper state. int state = YYINITIAL; s = text; try { yyreset(zzReader); yybegin(state); return yylex(); } catch (IOException ioe) { ioe.printStackTrace(); return new TokenImpl(); } }
/** * Pushes the specified amount of characters back into the input stream. * * They will be read again by then next call of the scanning method * * @param number the number of characters to be read again. * This number must not be greater than yylength()! */ public void yypushback(int number) { if ( number > yylength() ) zzScanError(ZZ_PUSHBACK_2BIG); zzMarkedPos -= number; }
/** * Adds the token specified to the current linked list of tokens. * * @param tokenType The token's type. */ private void addToken(int start, int end, int tokenType) { int so = start + offsetShift; addToken(zzBuffer, start,end, tokenType, so); }
/** * Adds the token specified to the current linked list of tokens. * * @param tokenType The token's type. */ private void addToken(int tokenType) { addToken(zzStartRead, zzMarkedPos-1, tokenType); }