MCPcopy Create free account
hub / github.com/antlr/codebuff / getRealTokens

Method getRealTokens

src/org/antlr/codebuff/Trainer.java:940–951  ·  view source on GitHub ↗
(CommonTokenStream tokens)

Source from the content-addressed store, hash-verified

938 }
939
940 public static List<Token> getRealTokens(CommonTokenStream tokens) {
941 List<Token> real = new ArrayList<>();
942 for (int i=0; i<tokens.size(); i++) {
943 Token t = tokens.get(i);
944 if ( t.getType()!=Token.EOF &&
945 t.getChannel()==Lexer.DEFAULT_TOKEN_CHANNEL )
946 {
947 real.add(t);
948 }
949 }
950 return real;
951 }
952
953 /** Return the index 0..n-1 of t as child of t.parent.
954 * If t is index 0, always return 0.

Callers 3

computeFeatureVectorsMethod · 0.95
showMethod · 0.95
formatMethod · 0.45

Calls 4

sizeMethod · 0.65
getMethod · 0.65
addMethod · 0.65
getTypeMethod · 0.45

Tested by

no test coverage detected