文本编辑器理论 [英] Text editor theory

查看:45
本文介绍了文本编辑器理论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我总是对现有的编辑器不满意,所以我一直想开始的一个项目是我自己的文本编辑器.然而,进行文本编辑是一项严肃的工作.

As I'm always dissatisfied with existing editors, a project I always wanted to start is my own text editor. However doing text editing is serious business.

除了分析现有文本编辑器的源代码外,是否有关于此主题的书籍或其他资源(如学术作品)?我对教授如何处理内存和如何管理文本插入的东西特别感兴趣(如果你有一个 100 MB 的文件并且想在 x 位置添加一个字符,你不能只是 memmove 巨大的文本块...).

Besides analyzing the source code of existing text editors, is there any book or other resource (like academic work) about this topic? I'm interested especially in something that teaches how to handle memory and how to manage text insertion (if you have a 100 MB file and want to add a char at x position, you can't just memmove the huge text block...).

推荐答案

看看 Rob Pike 对他的 Sam 文本编辑器.请务必浏览高级概述和命令语言.他在论文后面描述了解析、内存管理和数据结构.

Take a look at Rob Pike's description of his Sam text editor. Be sure to browse past the high-level overview and command language. He describes parsing, memory management, and data structures later in the paper.

另外,看看 Russ Cox 的简单的正则表达式实现.它很容易遵循,并且可能会在现有正则表达式库之外打开一些大门.

In addition, take a look at Russ Cox's simple regular expression implementation. It's easy to follow and may open some doors outside existing regular expression libraries.

这篇关于文本编辑器理论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆