首页>
外国专利>
Optimising a compilation parser by identifying a subset of grammar productions
Optimising a compilation parser by identifying a subset of grammar productions
展开▼
机译:通过识别语法产生的子集来优化编译解析器
展开▼
页面导航
摘要
著录项
相似文献
摘要
A first parser (107, fig.1) is created for parsing a programming language in accordance with a first grammar (105, fig. 1). The grammar comprises a first set of grammar productions (106, fig. 1) as represented by production rules (108, fig.1) in the parser. The first parser is run against a first sample of the language 206 and a subset of the first set is identified of the productions used in parsing the sample. A second parser 205, 107' is generated for parsing the language in accordance with a second grammar 105' which is of reduced scope relative to the first grammar. The second grammar comprises the identified subset of the first set of productions with, preferably, the unused productions removed. The first or second parser may similarly be run against a second language sample to generate a third parser in accordance with a third grammar of reduced scope relative to the respective first or second grammar. If the scope of the grammar of the second or third parser is inadequate for processing the programming language then parsing may be reverted to the respective first or second parser having grammar of greater scope. The parsers may be instrumented (109, fig.1).
展开▼