首页>
外国专利>
A method and apparatus for validating labelled, ordered parse trees according to a context-free grammar specification
A method and apparatus for validating labelled, ordered parse trees according to a context-free grammar specification
展开▼
机译:一种根据无上下文语法规范来验证标记的,有序的解析树的方法和设备
展开▼
页面导航
摘要
著录项
相似文献
摘要
Some document languages such as the Standard Generalized Markup Language (SGML) represent documents as trees (Fig. 1) with each node of the tree labelled with a tag and each node's immediate descendants taken in order having tags that satisfy a production corresponding to the parent's tag. Thus, a document is represented as a complete parse tree satisfying the production rules of a grammar. To simplify maintaining a valid document/parse tree at all stages, an efficient check is made whether a document is valid or can be extended to a valid document and furthermore to show how a document could be changed to be valid. A document can be extended to a valid document if is equal to a valid document with possibly some nodes deleted. External (leaf) nodes can just be deleted. Internal nodes are deleted by replacing the arc from the parent with multiple arcs (in the same order) from the parent to each of the children of the deleted node. A grammar is constructed from the given grammar that includes those documents that can be completed to a valid document and is called a gapped grammar. This invention teaches how a gapped grammar can be constructed from a grammar, and how a parser/checker is efficiently implemented.
展开▼