boolean eof = zzRefill(); { addToken(Token.IDENTIFIER); { addToken(Token.FUNCTION); { addToken(Token.WHITESPACE); addToken(temp, temp+5, Token.RESERVED_WORD); addToken(temp+6, temp+6, Token.SEPARATOR); addToken(temp+7, zzMarkedPos-2, Token.RESERVED_WORD); addToken(zzMarkedPos-1, zzMarkedPos-1, Token.SEPARATOR); { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_EOL); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_EOL); start = zzMarkedPos; { start = zzMarkedPos-1; yybegin(EOL_COMMENT); addToken(temp, temp+3, Token.RESERVED_WORD); addToken(temp+4, temp+4, Token.SEPARATOR); addToken(temp+5, zzMarkedPos-2, Token.RESERVED_WORD); addToken(zzMarkedPos-1, zzMarkedPos-1, Token.SEPARATOR); { addNullToken(); return firstToken; { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; addToken(temp, temp, Token.SEPARATOR); addToken(temp + 1, temp + 1, Token.IDENTIFIER);
/** * 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 = Token.NULL; 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. * @see #addHyperlinkToken(int, int, int) */ private void addToken(int start, int end, int tokenType) { int so = start + offsetShift; addToken(zzBuffer, start,end, tokenType, so, false); }
/** * Adds the token specified to the current linked list of tokens. * * @param tokenType The token's type. * @see #addToken(int, int, int) */ private void addHyperlinkToken(int start, int end, int tokenType) { int so = start + offsetShift; addToken(zzBuffer, start,end, tokenType, so, true); }
boolean eof = zzRefill(); { addToken(Token.IDENTIFIER); { addToken(Token.FUNCTION); { addToken(Token.WHITESPACE); addToken(temp, temp+5, Token.RESERVED_WORD); addToken(temp+6, temp+6, Token.SEPARATOR); addToken(temp+7, zzMarkedPos-2, Token.RESERVED_WORD); addToken(zzMarkedPos-1, zzMarkedPos-1, Token.SEPARATOR); { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_EOL); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_EOL); start = zzMarkedPos; { start = zzMarkedPos-1; yybegin(EOL_COMMENT); addToken(temp, temp+3, Token.RESERVED_WORD); addToken(temp+4, temp+4, Token.SEPARATOR); addToken(temp+5, zzMarkedPos-2, Token.RESERVED_WORD); addToken(zzMarkedPos-1, zzMarkedPos-1, Token.SEPARATOR); { addNullToken(); return firstToken; { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; addToken(temp, temp, Token.SEPARATOR); addToken(temp + 1, temp + 1, Token.IDENTIFIER);
/** * 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 = Token.NULL; 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); }
/** * Adds the token specified to the current linked list of tokens. * * @param tokenType The token's type. * @see #addToken(int, int, int) */ private void addHyperlinkToken(int start, int end, int tokenType) { int so = start + offsetShift; addToken(zzBuffer, start,end, tokenType, so, true); }
/** * Adds the token specified to the current linked list of tokens. * * @param tokenType The token's type. * @see #addHyperlinkToken(int, int, int) */ private void addToken(int start, int end, int tokenType) { int so = start + offsetShift; addToken(zzBuffer, start,end, tokenType, so, false); }
/** * 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); }