[Python-Dev] Python keywords (was Lockstep iteration (original) (raw)
Guido van Rossum guido@beopen.com
Wed, 09 Aug 2000 23:44:45 -0500
- Previous message: [Python-Dev] Python keywords (was Lockstep iteration - eureka !)
- Next message: [Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Lib mailbox.py,1.20,1.21
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
The parser actually recognizes keywords atm.
We could change that so that each keyword is a token. Then you would have something like: keywordallowedname: KEY1 | KEY2 | KEY3 | ... | KEYN | NAME and then tweak funcdef like so: funcdef: DEF keywordallowedname parameters ':' suite I haven't pondered whether or not this would cause the DFA to fall into a degenerate case or not.
This would be a good and simple approach.
Wondering where the metagrammer source file went to,
It may not have existed; I may have handcrafted the metagrammar.c file.
I believe the metagrammar was something like this:
MSTART: RULE* RULE: NAME ':' RHS RHS: ITEM ('|' ITEM)* ITEM: (ATOM ['*' | '?'])+ ATOM: NAME | STRING | '(' RHS ')' | '[' RHS ']'
--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)
- Previous message: [Python-Dev] Python keywords (was Lockstep iteration - eureka !)
- Next message: [Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Lib mailbox.py,1.20,1.21
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]