Re: Wisent:
Eric Ludlam <[email protected]> Sun, 23 Aug 2015 22:23:47 -0400
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <CACXnnKM5u-Z0p3nv+mfHx5nZN7ciM3CU2eQy-fPJeVcahXSd1g@mail.gmail.com> |
I am on a phone so this will be brief. You can return as much as you want from a rule by packing into a list. You then need to unpack upstream to use it. If you have one rule that makes 2 tags, pack the data into one tag equivalent (passes tagp) and then implement a tag expander to break it up. The c/c++ impl does this with variables like this: int a,b; I hope this helps. Eric On Aug 23, 2015 12:39 PM, "Andrea Turso" <[email protected]> wrote: > Dear Eric, > > I have hit a blocker while writing a Wisent grammar to tag a PHP buffer, > in particular I'm using class instantiation and parameter type hinting > information to add include-tags. > > I think this should enable Semantic to load and parse all required files > to provide the appropriate completion. > > My understanding is that Wisent is only aware of tags that are yielded by > a rule, so for example if I want to push an include tag I do this: > > class_instantiation: T_NEW qualified_name > *(INCLUDE-TAG $2 nil)* > ; > > Alternatively, if I need the name of the class being instantiated I can do > > class_instantiation: T_NEW qualified_name > *(identity $2)* > ; > > I am now working in a scenario where I need the class_instantiation rule > to do both actions – push the tag and return the class name. > > In the following example I use *progn *to illustrate what I'm trying to > achieve, of course the class name is returned but the tag isn't registered: > > class_instantiation: T_NEW qualified_name > *(progn (INCLUDE-TAG $2 nil) $2)* > ; > > Is there any way to have a rule to both push a tag and return a value? > > Kind regards, > Andrea Turso > > > ------------------------------------------------------------------------------ > > _______________________________________________ > cedet-semantic mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/cedet-semantic > > ------------------------------------------------------------------------------ _______________________________________________ cedet-semantic mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cedet-semantic