jeudi 26 février 2015

Using core RegEx library to implement lexical analyzer generator


Say I wanted to implement a lexer generator targeting some language, like Objective C, that features some RegEx implementation in its core library, in this case NSRegularExpression. Given that they compile to DFA, the overhead given by their use would be O(1) in the generated lexer, adding only a DFA compiling phase which happens a finite number of times for any grammar. Also the generating step would be much faster, as the generator wouldn't need to generate a full DFA itself. Are there any downsides or bad practices to this I can't see?





Aucun commentaire:

Enregistrer un commentaire