Re: [cedet-semantic] Context Analysis, types, and tags
Brought to you by:
zappo
From: David V. <dve...@gu...> - 2010-07-14 00:35:47
|
Ok, I see that FUNCTION-TAG must be a "Grammar Macro" as described in File: grammar-fw.info, Node: Grammar Macros, Next: BY grammars, Prev: Auto-generation of lexical rules, Up: Working with grammars *Note (grammar-fw)Top:: > *Note Working with grammars:: > Grammar Macros I can probably figure out what all the macros are just by inspecting one of the existing grammar files. Thanks! Best, David > -----Original Message----- > From: David Ventimiglia > Sent: Tuesday, July 13, 2010 8:53 AM > To: 'Eric M. Ludlam' > Cc: ced...@li... > Subject: RE: [cedet-semantic] Context Analysis, types, and tags > > Ok, thanks, that helps, though I've a few more questions. First, > what's an uncooked tag? Second, what's FUNCTION-TAG? I see that it's > in the action component of the production rule for method_header, and > it looks like a macro, but I couldn't find it in the CEDET info manual. > The closest I got was the set of elisp functions for creating tags, > documented in : > > File: semantic-appdev.info, Node: Creating Tags, Next: Copying Tags, > Prev: Tag Overlay Internals, Up: Tag Internals > *Note (semantic-appdev)Top:: > *Note Semantic Tags:: > *Note Tag > Internals:: > Creating Tags > > Thanks! > Best, > David > > > -----Original Message----- > > From: Eric M. Ludlam [mailto:er...@si...] > > Sent: Monday, July 12, 2010 7:13 PM > > To: David Ventimiglia > > Cc: ced...@li... > > Subject: Re: [cedet-semantic] Context Analysis, types, and tags > > > > On 07/12/2010 05:32 PM, David Ventimiglia wrote: > > > Hi! > > > > > > When making a parser for a new language, how does the :type > attribute > > of > > > a tag get filled in? Presumably, if I were using an external > parser, > > it > > > would provide that info, but what if I'm trying to make a parser > > using > > > the Wisent parser generator? > > > > Hi, > > > > Depending on your language, you can set the :type to be nil, a > string, > > or an "uncooked" tag. I suppose you can put any kind of data there, > > but > > typed language extensions expect one of those three things. In > general > > nil means there is no type, a string might be "int" or some simple > > name. > > If you know the type is the name of a class, you might create a new > > TYPE-TAG specifying that extra detail. > > > > If you instead are asking how to get something into the :type > attribute > > of a tag, that is an argument to one of the tag constructors. Here > is > > an example from the java parser for a method: > > > > method_header > > : modifiers_opt type method_declarator throws_opt > > `(FUNCTION-TAG ',(car $3) ',$2 ',(cdr $3) > > :typemodifiers ',$1 > > :throws ',$4) > > > > Here ,(car $3) is the NAME of the new function tag. $3 is actually > the > > core bits of the declaration in tag form, so (car $3) is the name. > > > > $2 will become the :type part of the new function you can see it is > > also > > derived from the "type" rule. > > > > Good Luck > > Eric |