Hello,
I've swapped home servers a couple days ago. I think things are
settling out now.
>>> David PONCE <david.ponce@...> seems to think that:
>Hi Eric,
>
>I prepared a NEWS update for the new auto-generated single analyzer
>feature. You will find a patch at end.
>
>Before committing it I would appreciate if you could review it. I am
>not sure my English is correct and clear enough ;-)
>
>Concerning the "single lexical analyzer" terminology, I find it a little
>confusing with "lexical analyzer". The former actually indicates a
>lexer matching rule, whereas the latter indicates the actual lexical
>analyzer.
I guess that makes sense. I noticed that same difficulty when
attempting to write doc for it a week or so ago.
>What do you thing of adopting the "lexical rule" terminology already
>used by Flex, instead of "single lexical analyzer"? Here is an
>excerpt of what the Flex manual says:
Using that terminology is probably a good idea.
>To enforce adoption of the "lexical rule" terminology we could rename
>these macros like this:
>
>define-lex-analyzer -> define-lex-rule
>define-lex-regex-analyzer -> define-lex-regex-rule
[ ... ]
>
>Any opinion?
Good Idea.
As you delve deeper in lexical rule and analyzer construction, do you
think it may be time to create a semantic lex input file?
>Index: NEWS
>===================================================================
>RCS file: /cvsroot/cedet/cedet/semantic/NEWS,v
>retrieving revision 1.15
>diff -c -r1.15 NEWS
>*** NEWS 9 Jan 2004 03:08:18 -0000 1.15
>--- NEWS 20 Jan 2004 10:29:19 -0000
>***************
>*** 265,270 ****
>--- 265,290 ----
> Language specific human written code must call the automatically
> generated setup function.
>
>+ *** Auto-generation of single lexical analyzers
>+
>+ The new %type statement combined with the use of %token statements
>+ permit to respectively declare a lexical type and associate to it
permits the declaration of a lexical type and associates it with
>+ patterns that define how to match lexical tokens of that type.
>+
>+ The grammar construction process can take benefit of %type and %token
The grammar construction process can benefit from the %type and %token
>+ declarations to automatically generate the definition of a single
>+ lexical analyzer for each explicitly declared lexical type.
Perhaps mention %keyword in the above 2 paragraphs also?
>+ Useful default values are provided for usual well known types like
Default values are provided for well known types like
>+ <keyword>, <symbol>, <string>, <number>, <punctuation>, and <block>.
>+ So for those types, assuming that the correct patterns are provided by
Those types assume that the correct patterns are provided by
>+ %token statements, a simple "%type <type>" declaration should
>+ generally suffice to auto-generate a suitable single analyzer.
Is that true? I thought the correct patterns were provided by the
syntax table, and the %token statements just specified a subset of
matched entities.
>+ It is then easy to put predefined and auto-generated single analyzers
>+ together to build ad-hoc lexical analyzers. Examples are available
>+ among the grammars included in the distribution.
Excellent new news. After you rename things and update this, it will
probably also get a home as the intro for writing lexical analyers.
Thanks
Eric
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org
|