Token token = tokens.get(i); if (token.getChannel() == smaliParser.HIDDEN) { continue;
private int startPos(int tkPosition) { if (tkPosition == -1) return 0; Token tk = tokens.get(tkPosition); if (tk instanceof CommonToken) return ((CommonToken)tk).getStartIndex(); return 0; }
Token token = tokens.get(i); if (token.getChannel() == smaliParser.HIDDEN) { continue;
private int stopPos(int tkPosition) { if (tkPosition == -1) return 0; Token tk = tokens.get(tkPosition); if (tk instanceof CommonToken) return ((CommonToken)tk).getStopIndex(); return 0; } }
Token token = tokens.get(i); if (token.getChannel() == smaliParser.HIDDEN) { continue;
/** scan backwards from current point in this.tokens list * looking for the start of the rule or subrule. * Return token or null if for some reason we can't find the start. */ public Token getRuleOrSubruleStartToken() { if ( tokens==null ) return null; int i = tokens.index(); int n = tokens.size(); if ( i>=n ) i = n-1; // seems index == n as we lex while ( i>=0 && i<n) { int ttype = tokens.get(i).getType(); if ( ttype == LPAREN || ttype == TOKEN_REF || ttype == RULE_REF ) { return tokens.get(i); } i--; } return null; }
Token token = tokens.get(i); if (token.getChannel() == smaliParser.HIDDEN) { continue;
/** scan backwards from current point in this.tokens list * looking for the start of the rule or subrule. * Return token or null if for some reason we can't find the start. */ public Token getRuleOrSubruleStartToken() { if ( tokens==null ) return null; int i = tokens.index(); int n = tokens.size(); if ( i>=n ) i = n-1; // seems index == n as we lex while ( i>=0 && i<n) { int ttype = tokens.get(i).getType(); if ( ttype == LPAREN || ttype == TOKEN_REF || ttype == RULE_REF ) { return tokens.get(i); } i--; } return null; }
Token token = tokens.get(i); if (token.getChannel() == smaliParser.HIDDEN) { continue;
/** scan backwards from current point in this.tokens list * looking for the start of the rule or subrule. * Return token or null if for some reason we can't find the start. */ public Token getRuleOrSubruleStartToken() { if ( tokens==null ) return null; int i = tokens.index(); int n = tokens.size(); if ( i>=n ) i = n-1; // seems index == n as we lex while ( i>=0 && i<n) { int ttype = tokens.get(i).getType(); if ( ttype == LPAREN || ttype == TOKEN_REF || ttype == RULE_REF ) { return tokens.get(i); } i--; } return null; }
Token token = tokens.get(i); if (token.getChannel() == smaliParser.HIDDEN) { continue;
/** scan backwards from current point in this.tokens list * looking for the start of the rule or subrule. * Return token or null if for some reason we can't find the start. */ public Token getRuleOrSubruleStartToken() { if ( tokens==null ) return null; int i = tokens.index(); int n = tokens.size(); if ( i>=n ) i = n-1; // seems index == n as we lex while ( i>=0 && i<n) { int ttype = tokens.get(i).getType(); if ( ttype == LPAREN || ttype == TOKEN_REF || ttype == RULE_REF ) { return tokens.get(i); } i--; } return null; }
Token token = tokens.get(i); if (token.getChannel() == smaliParser.HIDDEN) { continue;
/** scan backwards from current point in this.tokens list * looking for the start of the rule or subrule. * Return token or null if for some reason we can't find the start. */ public Token getRuleOrSubruleStartToken() { if ( tokens==null ) return null; int i = tokens.index(); int n = tokens.size(); if ( i>=n ) i = n-1; // seems index == n as we lex while ( i>=0 && i<n) { int ttype = tokens.get(i).getType(); if ( ttype == LPAREN || ttype == TOKEN_REF || ttype == RULE_REF ) { return tokens.get(i); } i--; } return null; }
public int getLineLength(int start) { int lineLength; Token token; lineLength = 0; // this will not give you a FortranLexer.EOF, so may need to // add a T_EOS token when creating the packed list if the file // ended w/o a T_EOS (now new line at end of the file). do { token = super.get(start+lineLength); lineLength++; } while((start+lineLength) < super.tokens.size() && (token.getChannel() == 99/*lexer.getIgnoreChannelNumber()*/ || token.getType() != FortranLexer.T_EOS && token.getType() != FortranLexer.EOF)); return lineLength; }// end getLineLength()
private String getDoc(CommonTree ast, String prefix) { CommonTokenStream ts = ((TarsRoot) ast.getAncestor(TarsParser.TARS_ROOT)).getTokenStream(); Token t = ts.get(ast.getTokenStartIndex() - 1); if (t != null && t.getChannel() == Token.HIDDEN_CHANNEL) { return prefix + t.getText().replaceAll("\n\\s*\\*", "\n" + prefix + " *"); } else { return ""; } }
i++) CommonToken t = (CommonToken)tokenBuffer.get(i);
i++) CommonToken t = (CommonToken)tokenBuffer.get(i);