Hello again David,
David PONCE <david.ponce@...> writes:
> Hi Joseph,
>
> [...]
>> I presume that semantic-tag-expand-function is only called a single
>> time on the result of the rule? I.e., if I have a custom semantic tag
>> that embeds other custom tags, I should write my
>> semantic-tag-expand-function in such a way that it performs the full
>> expand itself (perhaps recursively)?
>
> Yes.
>
> [...]
>> cd /opt/Build/CEDET-HEAD/cedet/semantic/doc/
>> grep -nH -e EXPANDTAG *.texi
>>
>> grep finished with no matches found at Tue Feb 17 09:56:06
>>
>> Am I missing something?
>
> Oops! It seems that the wisent manual needs an update. Thanks!
> I just committed a new version updated for Semantic version 2 ;-)
Great; I'll update and have a look.
> [...]
>> But datatype is not used with an EXPAND grammar macro. I presume you
>> mean something like?:
>>
>> (EXPANDTAG (TAG "custom" 'my-tag-class :value
>> (list
>> (TYPE-TAG $1 $4 (append $7 $8 $9) nil)
>> (when $2
>> (FUNCTION-TAG $1 $1 $2))
>> (TAG $1 'datatype (append $7 $8 $9)))))
> [...]
>
> In that case, yes.
While attempting to get this to work I'm re-debugging an old
EXPANDFULL rule that used to work when I was using the early-December
Cedet sources. Now, it does not work, and I'm completely flummoxed
after a morning of debugging.
The rule is used to parse module parameters. Here are a few examples:
[a,b : int] [T : TYPE] [a : foo] [b, \/, d, =, |- : int]
[ a, B, FOObar : TYPE ] [T?_P : TYPE+]
[ z, y, x : NONEMPTY_TYPE FROM Integer ]
[t: TYPE,
subt: TYPE FROM t (IMPORTING orders[subt]) <=: (partial_order?),
c: subt,
d: fx:subt | c <= xg]
The symbols above in all-caps are keywords.
I have put in calls to Emacs's message function to get debugging
information. When I attempt to parse my set of test cases, I see all
tokens up to the first identifier proceeding a colon, then nothing,
including the final right bracket. For example, when attempting to
parse the above
[ a, B, FOObar : TYPE ]
I see in Emacs's *Message* log
calling expandfull with theoryformal_list-expandfull on "[ a, B, FOObar : TYPE ]"
[
"a",
my-theoryformal-idops = ("a")
"B",
my-theoryformal-idops = ("B" "a")
calling expandfull with theoryformal_list-expandfull on "[T?_P : TYPE+]"
Note that *no* information was emitted for a match on "FOObar : TYPE",
and what's more, there is no debug info for the final RBRACK, which
could have *only* been matched by a single case of the rule.
I have fully debugged all dependent rules (I'm working up the parse
tree) including id, opsym, typeexpr,
type_or_nonempty_type_or_type_plus, and from_typeexpr_opt.
Here is the rule:
theoryformal_list-expandfull : LBRACK
(progn
(message "[")
(setq my-theoryformal-idops nil))
| RBRACK
(progn
(message "]")
(setq my-theoryformal-idops nil))
| PAREN_BLOCK ;; (nil 'importing :importing (("id" 'include :system-flag ...) ...))
(EXPANDFULL $1 parenthesized_importing-expandfull)
| id COMMA
(progn (setq my-theoryformal-idops
(cons $1 my-theoryformal-idops))
(message "%S," $1)
(message "my-theoryformal-idops = %S" my-theoryformal-idops)
())
| opsym COMMA
(progn (setq my-theoryformal-idops
(cons $1 my-theoryformal-idops))
(message "%S," $1)
(message "my-theoryformal-idops = %S" my-theoryformal-idops)
())
| id COLON type_or_nonempty_type_or_type_plus from_typeexpr_opt
(let ((variables (cons $1 my-theoryformal-idops))
(result (VARIABLE-TAG variables $3 nil)))
(message "%S:%S %S" $1 $3 $4)
(message "variables = %S" variables)
(message "result = %S" result)
(setq my-theoryformal-idops nil)
result)
| id COLON typeexpr
(let ((variables (cons $1 my-theoryformal-idops))
(result (VARIABLE-TAG variables $3 nil)))
(message "%S:%S" $1 $3)
(message "variables = %S" variables)
(message "result = %S" result)
(setq my-theoryformal-idops nil)
result)
| opsym COLON typeexpr
(let ((variables (cons $1 my-theoryformal-idops))
(result (VARIABLE-TAG variables $3 nil)))
(message "%S:%S" $1 $3)
(message "variables = %S" variables)
(message "result = %S" result)
(setq my-theoryformal-idops nil)
result)
;
Might you guys have any idea what is going on here?
Thanks,
Joe
|