Re: expandfull macro

"Martin Stein" <[email protected]> Wed, 28 Jan 2015 07:43:54 +0100
Newsgroups gmane.emacs.cedet
Message-ID <trinity-a722bb16-136e-4291-bad3-67e2ec24bcff-1422427434284@3capp-gmx-bs54>
Hi Eric,
 

>> My solution to this problem is to avoid EXPANDFULL and use my own
>> expandfull function. A grammar action line would then look like
>> :members (semantic-f90-expandfull $5 'one-specification)
>>
>> Would that be a viable solution?
> If you had some lexical token that could act as the parens ( ) that
> would be best, but I don't see those in your example. I think in
> python, there is an INDENT and DETEND lexical token that is used to
> create a INDENT_BLOCK which shows up as the semantic-list. I'm not
> sure how your lexer is set up, but you will need the lexer to generate a
> START and END type token for your custom lists (even if it is just
> whitespace) so that when you recurse it will peel them apart at the
> right level.
I used python.el/wy to get started with the wisent parser a couple weeks ago, that help a lot. There INDENT/DETEND tokens are a nice solution. Meanwhile after having worked for some weeks with wisent/semantic I think that using an expandfull0 macro (=EXPANDFULL with depth=0 instead of 1 in the call to semantic-parse-region) is just the right thing to do. Standard routines and macros are rather designed for C-like languages, which is fine as those are the big majority, and the overloading mechanism is a nice design to cater to differently structured languages like python or Fortran. But nevertheless being new to cedet this got me a bit confused. (By now I have also discovered that declare-macro allows to declare language specific macro...)

>> However, I could not figure out how to add my own tok_something token,
>> which is not bound to some string or regular expression. Is there a way
>> to do that? Would that be reasonable?
> You can create any kind of custom lexer token you like.
> Thanks to python.wy I figured out that one.

>I hope this helps.
Thanks for the support. I am almost there, I still like to have some basic support for formatting/summarising, completion and importing from other files.
Martin

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/