[csdoc-patches] CVS: csdoc/src/mcs cs-parser.jay,1.1,1.2 cs-tokenizer.cs,1.1,1.2
Status: Planning
Brought to you by:
mastergaurav
From: Gaurav V. <mas...@us...> - 2003-02-18 11:39:24
|
Update of /cvsroot/csdoc/csdoc/src/mcs In directory sc8-pr-cvs1:/tmp/cvs-serv32530 Modified Files: cs-parser.jay cs-tokenizer.cs Log Message: 2003-02-18 * First tweaks to get in the comments. Index: cs-parser.jay =================================================================== RCS file: /cvsroot/csdoc/csdoc/src/mcs/cs-parser.jay,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- cs-parser.jay 18 Feb 2003 07:36:40 -0000 1.1 +++ cs-parser.jay 18 Feb 2003 11:39:21 -0000 1.2 @@ -1488,6 +1488,7 @@ } ; +// Added by Gaurav Vaish event_declaration : opt_attributes opt_modifiers @@ -1499,6 +1500,7 @@ var.expression_or_array_initializer, (int) $2, null, null, (Attributes) $1, lexer.Location); + lexer.SaveDocumentFor(e); CheckDef (current_container.AddEvent (e), e.Name, e.Location); } @@ -1531,6 +1533,7 @@ Event e = new Event ((Expression) $4, (string) $5, null, (int) $2, add_accessor, rem_accessor, (Attributes) $1, loc); + lexer.SaveDocumentFor(e); CheckDef (current_container.AddEvent (e), e.Name, loc); implicit_value_parameter_type = null; @@ -2577,6 +2580,8 @@ // // 10 classes +// Adding support for documentation. +// Modified by Gaurav Vaish. // class_declaration : opt_attributes @@ -2590,6 +2595,7 @@ new_class = new Class (current_container, name, (int) $2, (Attributes) $1, lexer.Location); + lexer.SaveDocumentFor(new_class); current_container = new_class; current_container.Namespace = current_namespace; RootContext.Tree.RecordDecl (name, new_class); @@ -2599,6 +2605,7 @@ opt_semicolon { Class new_class = (Class) current_container; + lexer.SaveDocumentFor(new_class); if ($6 != null) new_class.Bases = (ArrayList) $6; Index: cs-tokenizer.cs =================================================================== RCS file: /cvsroot/csdoc/csdoc/src/mcs/cs-tokenizer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- cs-tokenizer.cs 18 Feb 2003 07:36:40 -0000 1.1 +++ cs-tokenizer.cs 18 Feb 2003 11:39:21 -0000 1.2 @@ -54,6 +54,19 @@ bool any_token_seen = false; static Hashtable tokenValues; + // Adding support for documentation. + // Modified by Gaurav Vaish + + private Hashtable documentationStrings = new Hashtable(); + private string commentString = ""; + + public void SaveDocumentFor(object new_class) + { + documentationStrings[new_class] = commentString; + System.Console.WriteLine("Document for {0}:\n\n{1}", new_class.ToString(), commentString); + commentString = ""; + } + private static Hashtable TokenValueName { get { @@ -1599,8 +1612,12 @@ if (d == '/'){ getChar (); + // Modified by Gaurav Vaish while ((d = getChar ()) != -1 && (d != '\n') && d != '\r') + { + commentString += (char)d; col++; + } if (d == '\n'){ line++; ref_line++; @@ -1618,6 +1635,7 @@ col++; break; } + commentString += (char)d; if (d == '\n'){ line++; ref_line++; |