[csdoc-patches] CVS: csdoc/src/csdoc ChangeLog,1.10,1.11 class.cs,1.2,1.3 cs-parser.jay,1.5,1.6 cs-t
Status: Planning
Brought to you by:
mastergaurav
|
From: Gaurav V. <mas...@us...> - 2003-02-24 08:33:59
|
Update of /cvsroot/csdoc/csdoc/src/csdoc
In directory sc8-pr-cvs1:/tmp/cvs-serv3287
Modified Files:
ChangeLog class.cs cs-parser.jay cs-tokenizer.cs decl.cs
ecore.cs interface.cs makefile parameter.cs
Log Message:
2003-02-24
* cs-parser.jay : Using SaveDocument() and
<type>::Documentation
* cs-tokenizer.cs : SaveDocument() - Added
: Hashtable Documentation { get; }
- Removed
: GetDocs() - Added
* decl.cs, interface.cs, ecore.cs
: string Documentation
- Added.
* makefile : doc - Added target
clean - Remove *.dll
* decl.cs, class.cs, parameter.cs
: Some fixes on doc-comments.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/ChangeLog,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ChangeLog 23 Feb 2003 16:39:01 -0000 1.10
+++ ChangeLog 24 Feb 2003 08:33:49 -0000 1.11
@@ -1,4 +1,20 @@
+2003-02-24 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+
+ * cs-parser.jay : Using SaveDocument() and
+ <type>::Documentation
+ * cs-tokenizer.cs : SaveDocument() - Added
+ : Hashtable Documentation { get; }
+ - Removed
+ : GetDocs() - Added
+ * decl.cs, interface.cs, ecore.cs
+ : string Documentation
+ - Added.
+ * makefile : doc - Added target
+ clean - Remove *.dll
+ * decl.cs, class.cs, parameter.cs
+ : Some fixes on doc-comments.
+
2003-02-23 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
* cs-parser.jay : Collect docs for Indexer.
Index: class.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/class.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- class.cs 21 Feb 2003 11:29:55 -0000 1.2
+++ class.cs 24 Feb 2003 08:33:50 -0000 1.3
@@ -3828,7 +3828,7 @@
}
}
- /// </summary>
+ /// <summary>
/// Gigantic workaround for lameness in SRE follows :
/// This class derives from EventInfo and attempts to basically
/// wrap around the EventBuilder so that FindMembers can quickly
Index: cs-parser.jay
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/cs-parser.jay,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- cs-parser.jay 23 Feb 2003 16:39:02 -0000 1.5
+++ cs-parser.jay 24 Feb 2003 08:33:50 -0000 1.6
@@ -650,7 +650,8 @@
current_container = new_struct;
current_container.Namespace = current_namespace;
RootContext.Tree.RecordDecl (full_struct_name, new_struct);
- lexer.SaveDocumentFor(new_struct);
+ new_struct.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
opt_class_base
struct_body
@@ -715,7 +716,8 @@
(Expression) constant.expression_or_array_initializer, (int) $2,
(Attributes) $1, l);
CheckDef (current_container.AddConstant (c), c.Name, l);
- lexer.SaveDocumentFor(c);
+ c.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
}
;
@@ -760,7 +762,8 @@
(Attributes) $1, l);
CheckDef (current_container.AddField (field), field.Name, l);
- lexer.SaveDocumentFor(field);
+ field.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
}
;
@@ -870,7 +873,8 @@
//System.Console.WriteLine("MethodName : " + method.Name);
//System.Console.WriteLine("LexerLocation : " + lexer.Location.Row);
//System.Console.WriteLine("MethodLocation: " + method.Location.Row);
- lexer.SaveDocumentFor(method);
+ method.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
current_local_parameters = (Parameters) $6;
$$ = method;
@@ -884,7 +888,8 @@
Method method = new Method (TypeManager.system_void_expr, (int) $2, (string) $4,
(Parameters) $6, (Attributes) $1, lexer.Location);
- lexer.SaveDocumentFor(method);
+ method.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
current_local_parameters = (Parameters) $6;
$$ = method;
}
@@ -1002,7 +1007,8 @@
(Attributes) $1, loc);
CheckDef (current_container.AddProperty (prop), prop.Name, loc);
- lexer.SaveDocumentFor(prop);
+ prop.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
implicit_value_parameter_type = null;
}
;
@@ -1106,7 +1112,8 @@
current_interface = new_interface;
new_interface.Namespace = current_namespace;
RootContext.Tree.RecordDecl (full_interface_name, new_interface);
- lexer.SaveDocumentFor(new_interface);
+ new_interface.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
opt_interface_base
interface_body opt_semicolon
@@ -1200,18 +1207,22 @@
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
SEMICOLON
{
- $$ = new InterfaceMethod ((Expression) $3, (string) $4, (bool) $2,
+ InterfaceMethod im = new InterfaceMethod ((Expression) $3, (string) $4, (bool) $2,
(Parameters) $6, (Attributes) $1, lexer.Location);
- lexer.SaveDocumentFor((InterfaceMethod)$$);
+ im.Documentation = lexer.GetDocs();
+ $$ = im;
+ lexer.SaveDocument();
}
| opt_attributes opt_new VOID IDENTIFIER
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
SEMICOLON
{
- $$ = new InterfaceMethod (
+ InterfaceMethod im = new InterfaceMethod (
TypeManager.system_void_expr, (string) $4, (bool) $2, (Parameters) $6,
(Attributes) $1, lexer.Location);
- lexer.SaveDocumentFor($$);
+ im.Documentation = lexer.GetDocs();
+ $$ = im;
+ lexer.SaveDocument();
}
;
@@ -1227,10 +1238,12 @@
{
int gs = (int) $7;
- $$ = new InterfaceProperty ((Expression) $3, (string) $4, (bool) $2,
+ InterfaceProperty ip = new InterfaceProperty ((Expression) $3, (string) $4, (bool) $2,
(gs & 1) == 1, (gs & 2) == 2, (Attributes) $1,
lexer.Location);
- lexer.SaveDocumentFor($$);
+ ip.Documentation = lexer.GetDocs();
+ $$ = ip;
+ lexer.SaveDocument();
}
;
@@ -1246,9 +1259,11 @@
interface_event_declaration
: opt_attributes opt_new EVENT type IDENTIFIER SEMICOLON
{
- $$ = new InterfaceEvent ((Expression) $4, (string) $5, (bool) $2, (Attributes) $1,
+ InterfaceEvent ie = new InterfaceEvent ((Expression) $4, (string) $5, (bool) $2, (Attributes) $1,
lexer.Location);
- lexer.SaveDocumentFor((InterfaceEvent)$$);
+ ie.Documentation = lexer.GetDocs();
+ $$ = ie;
+ lexer.SaveDocument();
}
;
@@ -1266,9 +1281,11 @@
bool do_get = (a_flags & 1) == 1;
bool do_set = (a_flags & 2) == 2;
- $$ = new InterfaceIndexer ((Expression) $3, (Parameters) $6, do_get, do_set,
+ InterfaceIndexer ii = new InterfaceIndexer ((Expression) $3, (Parameters) $6, do_get, do_set,
(bool) $2, (Attributes) $1, lexer.Location);
- lexer.SaveDocumentFor((InterfaceIndexer)$$);
+ ii.Documentation = lexer.GetDocs();
+ $$ = ii;
+ lexer.SaveDocument();
}
;
@@ -1282,7 +1299,8 @@
// Note again, checking is done in semantic analysis
current_container.AddOperator (op);
- lexer.SaveDocumentFor(op);
+ op.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
current_local_parameters = null;
}
@@ -1455,8 +1473,10 @@
opt_constructor_initializer
{
Location l = (Location) oob_stack.Pop ();
- $$ = new Constructor ((string) $1, (Parameters) $3, (ConstructorInitializer) $6, l);
- lexer.SaveDocumentFor($$);
+ Constructor ctor = new Constructor ((string) $1, (Parameters) $3, (ConstructorInitializer) $6, l);
+ ctor.Documentation = lexer.GetDocs();
+ $$ = ctor;
+ lexer.SaveDocument();
}
;
@@ -1503,7 +1523,8 @@
d.Block = (Block) $6;
CheckDef (current_container.AddMethod (d), d.Name, d.Location);
- lexer.SaveDocumentFor(d);
+ d.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
}
;
@@ -1521,7 +1542,8 @@
(int) $2, null, null, (Attributes) $1, lexer.Location);
CheckDef (current_container.AddEvent (e), e.Name, e.Location);
- lexer.SaveDocumentFor(e);
+ e.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
}
| opt_attributes
@@ -1552,7 +1574,8 @@
Event e = new Event ((Expression) $4, (string) $5, null, (int) $2, add_accessor, rem_accessor,
(Attributes) $1, loc);
- lexer.SaveDocumentFor(e);
+ e.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
CheckDef (current_container.AddEvent (e), e.Name, loc);
implicit_value_parameter_type = null;
@@ -1651,7 +1674,8 @@
current_local_parameters = null;
implicit_value_parameter_type = null;
indexer_parameters = null;
- lexer.SaveDocumentFor(indexer);
+ indexer.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
;
@@ -1665,7 +1689,8 @@
}
$$ = new IndexerDeclaration ((Expression) $1, null, pars);
- lexer.SaveDocumentFor((IndexerDeclaration)$$);
+ //$$.Documentation = lexer.GetDocs();
+ //lexer.SaveDocument();
}
| type qualified_identifier DOT THIS OPEN_BRACKET opt_formal_parameter_list CLOSE_BRACKET
{
@@ -1675,7 +1700,8 @@
Report.Error (1551, lexer.Location, "Indexers must have at least one parameter");
}
$$ = new IndexerDeclaration ((Expression) $1, (string) $2, pars);
- lexer.SaveDocumentFor((IndexerDeclaration)$$);
+ //$$.Documentation = lexer.GetDocs();
+ //lexer.SaveDocument();
}
;
@@ -1706,7 +1732,8 @@
CheckDef (current_container.AddEnum (e), full_name, enum_location);
RootContext.Tree.RecordDecl (full_name, e);
- lexer.SaveDocumentFor(e);
+ e.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
;
@@ -1749,8 +1776,10 @@
enum_member_declaration
: opt_attributes IDENTIFIER
{
- $$ = new VariableDeclaration ((string) $2, null, lexer.Location, (Attributes) $1);
- lexer.SaveDocumentFor($$);
+ VariableDeclaration vd = new VariableDeclaration ((string) $2, null, lexer.Location, (Attributes) $1);
+ vd.Documentation = lexer.GetDocs();
+ $$ = vd;
+ lexer.SaveDocument();
}
| opt_attributes IDENTIFIER
{
@@ -1758,8 +1787,10 @@
}
ASSIGN expression
{
- $$ = new VariableDeclaration ((string) $2, $5, lexer.Location, (Attributes) $1);
- lexer.SaveDocumentFor($$);
+ VariableDeclaration vd = new VariableDeclaration ((string) $2, $5, lexer.Location, (Attributes) $1);
+ vd.Documentation = lexer.GetDocs();
+ $$ = vd;
+ lexer.SaveDocument();
}
;
@@ -1779,7 +1810,8 @@
del.Namespace = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
- lexer.SaveDocumentFor(del);
+ del.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
| opt_attributes
opt_modifiers
@@ -1797,7 +1829,8 @@
del.Namespace = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
- lexer.SaveDocumentFor(del);
+ del.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
}
;
@@ -2622,7 +2655,8 @@
new_class = new Class (current_container, name, (int) $2,
(Attributes) $1, lexer.Location);
- lexer.SaveDocumentFor(new_class);
+ new_class.Documentation = lexer.GetDocs();
+ lexer.SaveDocument();
current_container = new_class;
current_container.Namespace = current_namespace;
RootContext.Tree.RecordDecl (name, new_class);
@@ -2632,7 +2666,6 @@
opt_semicolon
{
Class new_class = (Class) current_container;
- //lexer.SaveDocumentFor(new_class);
if ($6 != null)
new_class.Bases = (ArrayList) $6;
@@ -3621,6 +3654,11 @@
public object expression_or_array_initializer;
public Location Location;
public Attributes OptAttributes;
+
+ /// <summary>
+ /// Holds the documentation string.
+ /// </summary>
+ public string Documentation;
public VariableDeclaration (string id, object eoai, Location l, Attributes opt_attrs)
{
Index: cs-tokenizer.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/cs-tokenizer.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- cs-tokenizer.cs 21 Feb 2003 11:29:55 -0000 1.6
+++ cs-tokenizer.cs 24 Feb 2003 08:33:50 -0000 1.7
@@ -58,15 +58,11 @@
// Adding support for documentation.
// Modified by Gaurav Vaish
- private Hashtable documentationStrings = new Hashtable();
private string commentString = "";
private bool isCollectingDocs = true;
- public void SaveDocumentFor(object new_class)
+ public void SaveDocument()
{
- //if(!documentationStrings.ContainsKey(new_class))
- documentationStrings[new_class] = commentString;
- //System.Console.WriteLine("Document for {0}:\n\n{1}", new_class.ToString(), commentString);
commentString = "";
isCollectingDocs = true;
}
@@ -76,12 +72,9 @@
isCollectingDocs = false;
}
- public Hashtable Documentation
+ public string GetDocs()
{
- get
- {
- return documentationStrings;
- }
+ return commentString;
}
private static Hashtable TokenValueName
Index: decl.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/decl.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- decl.cs 19 Feb 2003 05:50:12 -0000 1.1
+++ decl.cs 24 Feb 2003 08:33:51 -0000 1.2
@@ -37,6 +37,11 @@
/// </summary>
public readonly Location Location;
+ /// <summary>
+ /// Holds the doc-comments.
+ /// </summary>
+ public string Documentation;
+
public MemberCore (string name, Location loc)
{
//if(name != "")
@@ -412,7 +417,7 @@
/// <remarks>
/// Should be overriten by the appropriate declaration space
- /// <remarks>
+ /// </remarks>
public abstract TypeBuilder DefineType ();
/// <summary>
Index: ecore.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/ecore.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ecore.cs 19 Feb 2003 05:50:12 -0000 1.1
+++ ecore.cs 24 Feb 2003 08:33:51 -0000 1.2
@@ -190,6 +190,11 @@
protected Type type;
protected Location loc;
+ /// <summary>
+ /// Holds the doc-comments.
+ /// </summary>
+ public string Documentation;
+
public Type Type {
get {
return type;
Index: interface.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/interface.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- interface.cs 19 Feb 2003 05:50:12 -0000 1.1
+++ interface.cs 24 Feb 2003 08:33:51 -0000 1.2
@@ -972,6 +972,11 @@
public readonly bool IsNew;
public Attributes OptAttributes;
+ /// <summary>
+ /// Holds the doc-comments.
+ /// </summary>
+ public string Documentation;
+
public InterfaceMemberBase (string name, bool is_new, Attributes attrs)
{
Name = name;
Index: makefile
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/makefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- makefile 23 Feb 2003 16:13:05 -0000 1.2
+++ makefile 24 Feb 2003 08:33:51 -0000 1.3
@@ -58,8 +58,14 @@
cs-parser.cs: cs-parser.jay
../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay > cs-parser.cs
+mcsdoc: $(BINARY)
+ ./$(BINARY) $(COMPILER_SOURCES)
+
+doc: cs-parser.cs $(COMPILER_SOURCES)
+ $(CSC) $(CSCFLAGS) /nowarn:1591 /doc:mcsdoc.xml $(COMPILER_SOURCES)
+
#pn:
# ../jay/jay -ctv < ../jay/skeleton.cs cs-parser.jay | grep -v '#line' > cs-parser.cs
clean:
- rm -f *.exe cs-parser.cs y.output *.pdb *~ .*~ mcs.log response
+ rm -f *.exe cs-parser.cs y.output *.pdb *~ .*~ mcs.log response *.dll
Index: parameter.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/parameter.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- parameter.cs 19 Feb 2003 05:50:12 -0000 1.1
+++ parameter.cs 24 Feb 2003 08:33:51 -0000 1.2
@@ -371,7 +371,7 @@
/// boolean whether this is an out or ref parameter.
///
/// Note that the returned type will not contain any dereference in this
- /// case (ie, you get "int" for a ref int instead of "int&"
+ /// case (ie, you get "int" for a ref int instead of "int&")
/// </summary>
public Type GetParameterInfo (DeclSpace ds, int idx, out Parameter.Modifier mod)
{
|