Re: [CEDET-devel] Auto-generation of lexical analyzer (next step)
Brought to you by:
zappo
From: David P. <dav...@wa...> - 2004-01-16 14:25:06
|
[...] > Yes, I can imagine just a few: > > %type <symbol> > %type <punctuation> > > to build a default analyzer. I will look at that as soon as possible ;-) > I assume the order of the %type specifiers controls the order of > placement in the constructed lexer? This will be an important > feature that must be documented. [...] For now only the basic analyzers are generated. The developer is responsible of putting them together in a lexer in the relevant order. There are examples in the epilogue code in wisent-java.wy and wisent-java-tags.wy. Perhaps in the future we could imagine a new declarative statement that defines the lexer itself. Something like: %lexer { ignore-whitespace ignore-newline ignore-comments <number> <string> ;; Must detect keywords before other symbols <keyword> <symbol> <punctuation> <block> default-action } <type> items would be replaced by corresponding generated analyzers and other items like ignore-whitespace would be replaced by a corresponding `semantic-lex-ignore-whitespace'. However I am not sure that it will be worth implementing that compared to the simplicity of doing the same thing in Lisp. David |