(CommonTokenStream tokens)
| 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. |