@Override
  public ASTNode parseContents(final ASTNode chameleon) {
    if (JavaParserDefinition.USE_NEW_PARSER) {
      final PsiBuilder builder = JavaParserUtil.createBuilder(chameleon);
      doParse(builder);
      return builder.getTreeBuilt().getFirstChildNode();
    }

    FileElement node = (FileElement) chameleon;
    final CharSequence seq = node.getChars();

    final PsiManager manager = node.getManager();
    final JavaLexer lexer = new JavaLexer(PsiUtil.getLanguageLevel(node.getPsi()));
    return FileTextParsing.parseFileText(manager, lexer, seq, 0, seq.length(), node.getCharTable());
  }
 @Override
 public FlyweightCapableTreeStructure<LighterASTNode> parseContentsLight(final ASTNode chameleon) {
   final PsiBuilder builder = JavaParserUtil.createBuilder(chameleon);
   doParse(builder);
   return builder.getLightTree();
 }