I went to try out your stuff, but found there was no python mode in
my Emacs. Where do you get that?
Try using `semantic-lex-debug' to see if it makes sense. One thing
that needs to be enhanced in the debugger for lex is that if you have
whitespace or comments that are ignored, it highlights nothing, but
shows the last matched lexical token in the minibuffer.
Another thing to watch out for, is that after a lots of changes, it
is safest to exit emacs, run make, and restart, just to make sure
all macros have executed. I ran into many strange problems like
that, and this sometimes helped.
>>> ryk@... seems to think that:
>I updated wisent-python.el as shown by the CVS history shown below.
>After the change, the lexer seems to be working fine, but the parser
>does not work even on a simple code such as this:
> class C:
> x = 1
>I know that the parser was fine recently, because if I do this
> cd /usr/local/src/cedet; cvs up -D "2003-02-16 06:00"
>then the python parser works fine.
>Before I spend too much time on tracking this down, I thought I should
>ask first to see if I'm missing something obvious.
>Note that wisent-python.el does not refer to maximum-depth,
>token-stream, nor analysis-bounds at all.
>Also there are couple of condition-case code that could be replaced with
>I have not checked in the change that I already made, because I wanted
>to minimize the changes until I know why the new parser does not work.
>Thanks for your help.
>date: 2003/02/18 03:04:03; author: emacsman; state: Exp; lines: +7 -5
>Fixed a regexp in python-next-line so that backquotes in python code
>do not break it.
>date: 2003/02/18 01:58:23; author: emacsman; state: Exp; lines: +8 -10
>Replaced end-point and current-depth with semantic-lex-end-point and
>date: 2003/02/18 00:34:37; author: emacsman; state: Exp; lines: +17 -10
>Modified all (semantic-lex-token ...) with (semantic-lex-push-token
>(semantic-lex-token ...)) to conform to the new lexer.
>>>>>> "EL" == Eric M Ludlam <eric@...> writes:
> EL> The new lexer is now in. Here is a summary of important changes:
> EL> Adding a token to the stream now requires this:
> EL> (semantic-lex-push-token (semantic-lex-token ... ))
> EL> Any syntax that may be unterminated (strings, lists, etc) should do
> EL> this when moving across the syntax:
> EL> (semantic-lex-unterminated-syntax-protection
> EL> (movement-code)
> EL> (point))
> EL> instead of a condition-case as was used before.
> EL> Lastly, all old local variables, such as `end-point' must now instead
> EL> use these new longer-named state variables:
> EL> semantic-lex-end-point
> EL> semantic-lex-current-depth
> EL> semantic-lex-maximum-depth
> EL> semantic-lex-token-stream
> EL> semantic-lex-analysis-bounds
> EL> I've changed the following files to handle these changes:
> EL> semantic-grammar.el
> EL> semantic-c.el
> EL> semantic-make.el
> EL> semantic-skel.el
> EL> Lastly, I fixed the recursion detector so it actually works.
> EL> I also added a lexical debugger that lets you step over the decisions
> EL> the lexer is making.
> EL> Enjoy
> EL> Eric
> EL> --- Changelog
> EL> semantic-lex.el:
> EL> (semantic-lex-test): New command
> EL> (semantic-lex-debug): New variable and new command.
> EL> (semantic-lex-highlight-token): New function
> EL> (semantic-lex-debug-break): New function
> EL> (semantic-lex-end-point, semantic-lex-current-depth)
> EL> (semantic-lex-maximum-depth, semantic-lex-token-stream)
> EL> (semantic-lex-analysis-bounds): New state variables
> EL> (define-lex): Replace all local variables with references to above
> EL> new global variables.
> EL> Improved lexical hang detection.
> EL> (semantic-lex-push-token): New fcn
> EL> (semantic-lex-token): Spit out push part.
> EL> (semantic-lex-unterminated-syntax-detected): New fcn
> EL> (semantic-lex-unterminated-syntax-protection): New macro
> EL> (define-lex-analyzer): Updated doc string.
> EL> Generated fcn binds more new state variables.
> EL> (define-lex-simple-regex-analyzer, define-lex-block-analyzer)
> EL> (semantic-lex-beginning-of-line, semantic-lex-newline-as-whitespace)
> EL> (semantic-lex-symbol-or-keyword, semantic-lex-punctuation-type)
> EL> (semantic-lex-comments, semantic-lex-comments-as-whitespace)
> EL> (semantic-lex-ignore-comments): Use `semantic-lex-push-token'.
> EL> Use `semantic-lex-unterminated-syntax-protection' macro if apropriate.
> EL> Use new state variables as apropriate.
> EL> --
> EL> Eric Ludlam: zappo@..., eric@...
> EL> Home: http://www.ludlam.net Siege: http://www.siege-engine.com
> EL> Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org
> EL> -------------------------------------------------------
> EL> This sf.net email is sponsored by:ThinkGeek
> EL> Welcome to geek heaven.
> EL> http://thinkgeek.com/sf
> EL> _______________________________________________
> EL> Cedet-devel mailing list
> EL> Cedet-devel@...
> EL> https://lists.sourceforge.net/lists/listinfo/cedet-devel
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