The parser actually recognizes keywords atm. We could change that so that each keyword is a token. Then you would have something like: keyword_allowed_name: KEY1 | KEY2 | KEY3 | ... | KEYN | NAME and then tweak func_def like so: func_def: DEF keyword_allowed_name parameters ':' suite I haven't pondered whether or not this would cause the DFA to fall into a degenerate case or not. Wondering where the metagrammer source file went to, Bill -----Original Message----- From: Greg Ewing [mailto:greg@cosc.canterbury.ac.nz] Sent: Wednesday, August 09, 2000 7:24 PM To: python-dev@python.org Subject: Re: [Python-Dev] Python keywords (was Lockstep iteration - eureka!) BDFL: > The parser generator will probably have to be changed to allow you to > indicate not to do a resword lookup at certain points in the grammar. Isn't it the scanner which recognises reserved words? In that case, just make it not do that for the next token after certain tokens. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+ _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://www.python.org/mailman/listinfo/python-dev
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4