节点文献
标记性语言解释器设计与实现
【作者】 王晶;
【导师】 吴健;
【作者基本信息】 西北工业大学 , 计算机软件与理论, 2004, 硕士
【摘要】 因特网是当前使用最广泛的系统,WWW是上面最常见的应用,随着WWW应用的快速发展,越来越多的人通过各种方式从网上获取信息。通过嵌入式系统,我们可以更加方便的浏览WWW上的信息。网络上传输的网页信息通常是使用各种形式的标记性语言组织的。本文就是在嵌入式系统的环境下,设计和实现了几种标记性语言的解释器。 文中首先介绍了课题的背景,接着介绍该嵌入式浏览器的总体设计,最后重点介绍了浏览器中的标记性语言解释器部分的设计和实现。它是浏览器实现中的重要部分。 解释器分为标记性语言的解析和对网页的显示。标记性语言的解析包括:词法分析、语法分析、语义分析三个部分。词法分析采用FLEX工具实现,简单化词法分析的容错功能的实现以及之后的程序修改问题。语法分析利用YACC工具实现。不仅可以正确的分析文档的语法结构,还充分考虑到各种可能的错误。并在语法分析过程做修改。语义分析在语法分析的过程中进行。建立一颗完整的UFO语法树。并将网页完整信息存储进去。在解析过程中,通过形式化的描述方式,很好的达到容错和纠错效果。我们将标记性语言的解析映射到具体的下规式和产生式。将错误抛出的可能性降到最低。 显示部分的设计直接影响显示的效果。本系统按照W3C相关部分规范要求,并且参考当前流行的浏览器IE和NETSCAPE的显示效果对网页信息进行美观而高效率的显示。使我们实现的浏览器不仅具有基本的显示效果而且具有自身特色。 最后讨论了正在快速发展中的XML。研究和设计了一种XML解释器。根据DTD语法,简单的对XML文档实现结构完整性和有效性检查。 最后,本文论文总结了完成的工作,并提出了方案中需要进一步研究的问题。
【Abstract】 Nowadays, the Internet is the most extensive system. And World Wide Web is the most widely used application. With the rapid development of WWW applications, more and more people want to fetch information from the Internet. Using embedded system, we can browse WWW easily. Normally, information spreaded on network is organized in various forms of Markup Languages. In this paper, we design and implement interpreters of several kinds of Markup Languages on embedded system.Firstly, we introduce the background of the project. Then clarify the general design. Finally, emphasize on the design and implementation of the browser’s Markup Language interpreters. That is the key aspect of the browser design.An interpreter can be devided into parser and presentation. And Markup Language parser includes three parts: token, syntax and semantic analyzer. We use Flex to get a Tokenizer. And then, the realization of error tolerance function and later modification problem is simplified. Further, YACC is used to get a syntax analyzer. On one hand, it can correctly analyse the syntax of a document, on the other hand, all kinds of mistakes are considered. Semantic analysis is carried out during syntax analysis. An integrated UFO_syntax_tree is built. Moreover, all imformation expressed by the page is stored in the tree.The design of presentation part affects the impact of display directly. Accroding to the specifications of W3C and references of display results of the famous browsers IE and NETSCAPE, this system displays the pages elegantly and efficiently.We also discuss the rapidly developing language XML. Design and study one kind of XML interpreter. Referring to DTD, it can check the structure integrity and validness of the XML document simply.Finally, we conclude the thesis and list the future work.
- 【网络出版投稿人】 西北工业大学 【网络出版年期】2004年 03期
- 【分类号】TP311.1
- 【被引频次】3
- 【下载频次】339