摘要
SAQ系统是一个进行软件规约获取、检验和复用的实验系统,其中以上下文无关文法表示的概念是规约的一部分.SAQ要求将概念的词法和句法定义结合在一个上下文无关文法中.如果用常规的上下文无关文法描述诸如程序设计语言和自然语言等一些复杂概念的语法,则需要把诸如空格和回车等没有实质意义的分隔符包含到语法中去(这种描述方法称为朴素表示法),使得语法描述很累赘.为此,作者设计了一种特殊的上下文无关文法,它把通常上下文无关文法定义中的非终极符集合和终极符集合进行细化.用这种文法可以相对简洁地描述程序语言和自然语言等复杂概念的完整定义,而且,其相应的语法分析效率较朴素表示法有所提高.同时,给出相应于这种特殊的上下文无关文法的语法分析和语法树生成算法.这些算法分别由在通用上下文无关语法的Earley分析算法及其相应的语法树生成算法的基础上改进而得到.
SAQ is an experimental system to perform acquisition, verification and reusing of formal specification, in which the lexical and syntactic definitions of one concept should be integrated into one context free grammar. If employed conventional context free grammars to describe the overall definitions of complicated concepts such as natural languages and programming languages, separators such as spaces and carrier returns should be included and the definitions should be very messy. To solve this problem, a special kind of context free grammars is presented. The grammars are obtained by dividing the set of non terminals and the set of terminals of conventional context free grammars into two respectively. As a result, the grammatical definitions of complicated concepts are relatively neat; at the same time, lexical analysis and syntax analysis can be integrated into one parsing process. In addition, the authors present the corresponding parsing and derivation tree construction algorithms, which are obtained on the basis of the general parsing method of Earley and its corresponding algorithm of construction of rightmost derivation respectively.
出处
《软件学报》
EI
CSCD
北大核心
1998年第12期904-910,共7页
Journal of Software
基金
国家自然科学基金
国家863高科技项目基金
国家"九五"攻关计划基金