[Mono-list] Re: CS-Doc
Miguel de Icaza
miguel@ximian.com
20 Feb 2003 12:31:31 -0500
Hello,
> The non-terminal is "method_header" (line 855 in cs-parser.jay of mcs),
> and the rule is:
>
> --------------------------------------
> method_header
> : opt_attributes
> opt_modifiers
> type
> member_name
> OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
> {
> ...
> }
> | ...
> --------------------------------------
>
> The grammar is absolutely correct (obviously), but I collect the
> documentation inside { ... }, after there is "Method method = new
> Method(...)", and this creates a problem.
>
> Consider the following situation:
>
> --------------------------------------
> /// <remarks>Nothing</remarks>
> public /// <summary>How about this?</summary>
> void MyMethod()
> {
> }
> --------------------------------------
My suggestion is that the documentation should be assembled out-of-line
ignoring intermediate tokens (if this is the default Microsoft CSC
behavior).
The documentation nodes should not be reflected in the parser at all.
The only place where they matter is where the documents are consumed,
like this:
> method_header
> : opt_attributes
> opt_modifiers
> type
> member_name
> OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
> {
> $$ = new Method (....., tokenizer.PullDocs ());
> }
> | ...
> -----------
The idea behind "PullDocs" was that it would return the
documentation-so-far, and would reset the value to empty, and restart.
Miguel.