The correct way to do what you ask is to create a parser for picolisp.
At this time, I think the scheme one is closest, but you (or someone)
will need to understand some basics in Emacs Lisp and Semantic to
convert something like Scheme over to pico lisp.
To make the Scheme thing work you need scheme.by, and semantic-scm.el.
In the picolisp version, look at the token DEFINE. change it to be
"de", plus the same for the help. If there other such features, add
those. Then look at scheme-in-list, and change any other syntax there.
The syntax is in the semantic manual. At a most basic level:
scheme-in-list: DEFINE symbol expression
(VARIABLE-TAG $2 nil $3 )
;
where "scheme-in-list" is the name of a defined rule. DEFINE is a
token, which is earlier defined as "define". The sequence
DEFINE symbol expression
means to match the word define, then any kind of valid symbol, then any
one expression. Because scheme-in-list is only used in an expanded
list, you don't need to match the parens.
The part:
(VARIABLE-TAG $2 nil $3 )
is the action, and the action runs when there is a match. In this case,
the VARIABLE-TAG is a function call that expands out to creating a new
valid uncooked semantic tag.
Using these basics, you can create matches for all the picolisp valid
syntax you care about, most likely all in this single rule.
In semantic-scm.el, you can find the lexer. This has a matcher in it
called semantic-lex-ignore-comments. comments are derived from the
major mode, so if picolisp correctly defines your comment style, this
should work as is.
You may need to change semantic-lex-scheme-symbol to include any
characters valid in a picolisp symbol if it is different.
The other overrides might work as is. You would have to try them out to
know for sure.
Eric
On 06/24/2011 05:35 AM, Henrik Sarvell wrote:
> Seems like we can forget what I said about the Scheme template in my
> last post.
>
> Methods probably showed in ECB due to some old caching.
>
> When I opened new files no methods showed until switched back to the
> elisp version/template.
>
> What I really would like is simply for all words that match "foo" in
> "(de foo " to show up in the method window. What is the easiest way to
> accomplish this?
>
>
>
> On Fri, Jun 24, 2011 at 12:27 PM, Henrik Sarvell <hsarvell@...
> <mailto:hsarvell@...>> wrote:
>
> You ar correct Eric, sorry for the confusion, I had added your hook
> statement to my config but forgetting to delete the PicoLisp parser,
> after doing that it stopped working as you suspected.
>
> You posted a fix earlier that I used to replace the corresponding
> old code in my PicoLisp copy of semantic-scm.el, and it worked!
>
> I am now at the same place I was when using elisp as a template but
> with Scheme instead, the definitions are showing up properly except
> for functions containing semi-colons.
>
> Problem is of course that Scheme also uses ; for commenting (I
> suppose?) and I can't see anywhere in the Scheme files (scheme.by
> <http://scheme.by> / semantic-scm.el) that this character is defined
> as being used for comments, so no easy fix, but now maybe it is
> possible to fix at least?
>
> I've also checked for instance make.by <http://make.by> and
> semantic-make.el but couldn't see any comment handling there either.
>
> From this I suppose you could infer that semantic somehow picks up
> stuff from the coding mode, in this case picolisp-mode which
> definitely handles # as comments with proper colors and all, however
> this is not happening in the PicoLisp case.
>
>
>
>
> On Thu, Jun 23, 2011 at 5:12 AM, Eric M. Ludlam
> <ericludlam@... <mailto:ericludlam@...>> wrote:
>
> Hi,
>
>
> On 06/20/2011 02:54 AM, Henrik Sarvell wrote:
>
> Hi again, forget the earlier question, it just works which
> is great.
>
>
> This now surprises me, since your last email about functions
> being created with 'de' instead of 'defun'.
>
>
> Just one snag, PicoLisp uses # for commenting, not ;.
>
> In fact PicoLisp uses ; as a getter function to get values
> of object
> attributes.
>
> The problem is that as soon as a function contains ; it will
> disappear
> from the ECB list.
>
> I.e the following works and shows upp:
>
> (de Test1 (Obj)
> (print Obj))
>
> But not this:
>
> (de Test2 (Obj)
> (print (; Obj name)))
>
> Commented lines are handled properly by picolisp-mode but in
> this case
> the semantic parser won't pick that up.
>
> Any ideas how I can remedy this?
>
>
> This is because the elisp parser uses Emacs' 'read' function,
> which has ; built-in as a comment character. I'd assume that it
> is not possible to fix that state.
>
> That, combined with me not yet understanding why the elisp
> parser works makes me think your best bet is to start with the
> Scheme parser. That parser is quite simple (scheme.by
> <http://scheme.by>) and could be updated for picolisp definition
> symbols. semantic-scm.el has customizations which will then fix
> the comment syntax by obeying the syntax table for picolisp.
>
> Eric
>
>
>
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense..
> http://p.sf.net/sfu/splunk-d2d-c1
>
>
>
> _______________________________________________
> Cedet-devel mailing list
> Cedet-devel@...
> https://lists.sourceforge.net/lists/listinfo/cedet-devel
|