>>> Daniel Debertin <airboss+ecb@...> seems to think that:
>"Eric M. Ludlam" <eric@...> writes:
>> Knowing more about the language you are parsing and what semantic
>> features you have overridden would assist in better answering your question.
>I neglected to mention it -- the language I'm parsing is Ruby. At
>present I haven't defined any overrides; I'm still at the stage of
>getting the grammar and lexer working properly. This is the sort of
>code I'm parsing:
> class FooClass
> def thingy()
> class BarClass < FooClass # '<' denotes inheritance
> def foo(arg)
>(I'm using TYPE-TAG for both modules and classes.)
>Oddly enough, if I remove the module definition (comment out "module
>FooMod" and the last "end"), the parent-tag in the methods-buffer
>works as expected. I don't even know where to start on this one, so
>any hints you may have would be welcome.
[ ... ]
For debugging your language, I recommend using `bovinate' as a basic
way to see exactly the structure your parser generates for a given
buffer. This may reveal clues as to why the 'parent' is not jumpable.
Another useful tool is `global-semantic-show-unmatched-syntax-mode'
which wll let you know when text is not being parsed.
For the lexer, there is `semantic-lex-debug' to help you identify
The ruby module looks to be similar to the C++ namespace. The C++
namespace is treated as a datatype in semantic, so that if you get it
by name, you get a tag with all the child classes and whatnot inside.
You could also just strip out the module alltogether, putting all
sub-classes into the global space. This would be similar to the C++
extern "C" notation in the c.by parser.
If you are treating the ruby module as something else, you will need
to override some basic features of how tags are treated, such as using
`semantic-tag-expand-function' which is useful for breaking up
compound statements. The override method
`semantic-tag-components-with-overlays' is vital if you make custom
Once you get the output of your parser to conform it should be
accepted by all the other various tools. If you don't want it to
conform, that's ok too. (Just as the html parser doesn't conform to
C++ type tags) You just need to override lots of methods to get
things to do what you want.
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