The new lexer is now in. Here is a summary of important changes:
Adding a token to the stream now requires this:
(semantic-lex-push-token (semantic-lex-token ... ))
Any syntax that may be unterminated (strings, lists, etc) should do
this when moving across the syntax:
(semantic-lex-unterminated-syntax-protection
(movement-code)
(point))
instead of a condition-case as was used before.
Lastly, all old local variables, such as `end-point' must now instead
use these new longer-named state variables:
semantic-lex-end-point
semantic-lex-current-depth
semantic-lex-maximum-depth
semantic-lex-token-stream
semantic-lex-analysis-bounds
I've changed the following files to handle these changes:
semantic-grammar.el
semantic-c.el
semantic-make.el
semantic-skel.el
Lastly, I fixed the recursion detector so it actually works.
I also added a lexical debugger that lets you step over the decisions
the lexer is making.
Enjoy
Eric
--- Changelog
semantic-lex.el:
(semantic-lex-test): New command
(semantic-lex-debug): New variable and new command.
(semantic-lex-highlight-token): New function
(semantic-lex-debug-break): New function
(semantic-lex-end-point, semantic-lex-current-depth)
(semantic-lex-maximum-depth, semantic-lex-token-stream)
(semantic-lex-analysis-bounds): New state variables
(define-lex): Replace all local variables with references to above
new global variables.
Improved lexical hang detection.
(semantic-lex-push-token): New fcn
(semantic-lex-token): Spit out push part.
(semantic-lex-unterminated-syntax-detected): New fcn
(semantic-lex-unterminated-syntax-protection): New macro
(define-lex-analyzer): Updated doc string.
Generated fcn binds more new state variables.
(define-lex-simple-regex-analyzer, define-lex-block-analyzer)
(semantic-lex-beginning-of-line, semantic-lex-newline-as-whitespace)
(semantic-lex-symbol-or-keyword, semantic-lex-punctuation-type)
(semantic-lex-comments, semantic-lex-comments-as-whitespace)
(semantic-lex-ignore-comments): Use `semantic-lex-push-token'.
Use `semantic-lex-unterminated-syntax-protection' macro if apropriate.
Use new state variables as apropriate.
--
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
|