[csdoc-patches] CVS: csdoc/src/csdoc cs-parser.jay,1.6,1.7 cs-tokenizer.cs,1.7,1.8 ChangeLog,1.15,1.
Status: Planning
Brought to you by:
mastergaurav
|
From: Gaurav V. <mas...@us...> - 2003-03-27 17:50:59
|
Update of /cvsroot/csdoc/csdoc/src/csdoc
In directory sc8-pr-cvs1:/tmp/cvs-serv11438
Modified Files:
cs-parser.jay cs-tokenizer.cs ChangeLog
Log Message:
2003-03-27
* cs-parser.jay : Modified the attribute rule.
Now collects documents after parsing attributes.
* cs-tokenizer.cs : Hmmm... I was losing all docs.
Index: cs-parser.jay
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/cs-parser.jay,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- cs-parser.jay 24 Feb 2003 08:33:50 -0000 1.6
+++ cs-parser.jay 27 Mar 2003 17:50:51 -0000 1.7
@@ -422,8 +422,8 @@
//
opt_attributes
- : /* empty */ { lexer.StopCollectngDocs(); }
- | { lexer.StopCollectngDocs(); } attribute_sections { $$ = $2; }
+ : /* empty */ { lexer.StopCollectingDocs(); }
+ | attribute_sections { lexer.StopCollectingDocs(); $$ = $1; }
;
attribute_sections
@@ -651,7 +651,7 @@
current_container.Namespace = current_namespace;
RootContext.Tree.RecordDecl (full_struct_name, new_struct);
new_struct.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
opt_class_base
struct_body
@@ -717,7 +717,7 @@
(Attributes) $1, l);
CheckDef (current_container.AddConstant (c), c.Name, l);
c.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
}
;
@@ -763,7 +763,7 @@
CheckDef (current_container.AddField (field), field.Name, l);
field.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
}
;
@@ -874,7 +874,7 @@
//System.Console.WriteLine("LexerLocation : " + lexer.Location.Row);
//System.Console.WriteLine("MethodLocation: " + method.Location.Row);
method.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
current_local_parameters = (Parameters) $6;
$$ = method;
@@ -889,7 +889,7 @@
(Parameters) $6, (Attributes) $1, lexer.Location);
method.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
current_local_parameters = (Parameters) $6;
$$ = method;
}
@@ -1008,7 +1008,7 @@
CheckDef (current_container.AddProperty (prop), prop.Name, loc);
prop.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
implicit_value_parameter_type = null;
}
;
@@ -1113,7 +1113,7 @@
new_interface.Namespace = current_namespace;
RootContext.Tree.RecordDecl (full_interface_name, new_interface);
new_interface.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
opt_interface_base
interface_body opt_semicolon
@@ -1211,7 +1211,7 @@
(Parameters) $6, (Attributes) $1, lexer.Location);
im.Documentation = lexer.GetDocs();
$$ = im;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
| opt_attributes opt_new VOID IDENTIFIER
OPEN_PARENS opt_formal_parameter_list CLOSE_PARENS
@@ -1222,7 +1222,7 @@
(Attributes) $1, lexer.Location);
im.Documentation = lexer.GetDocs();
$$ = im;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1243,7 +1243,7 @@
lexer.Location);
ip.Documentation = lexer.GetDocs();
$$ = ip;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1263,7 +1263,7 @@
lexer.Location);
ie.Documentation = lexer.GetDocs();
$$ = ie;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1285,7 +1285,7 @@
(bool) $2, (Attributes) $1, lexer.Location);
ii.Documentation = lexer.GetDocs();
$$ = ii;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1300,7 +1300,7 @@
// Note again, checking is done in semantic analysis
current_container.AddOperator (op);
op.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
current_local_parameters = null;
}
@@ -1476,7 +1476,7 @@
Constructor ctor = new Constructor ((string) $1, (Parameters) $3, (ConstructorInitializer) $6, l);
ctor.Documentation = lexer.GetDocs();
$$ = ctor;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1524,7 +1524,7 @@
d.Block = (Block) $6;
CheckDef (current_container.AddMethod (d), d.Name, d.Location);
d.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
}
;
@@ -1543,7 +1543,7 @@
CheckDef (current_container.AddEvent (e), e.Name, e.Location);
e.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
}
| opt_attributes
@@ -1575,7 +1575,7 @@
Event e = new Event ((Expression) $4, (string) $5, null, (int) $2, add_accessor, rem_accessor,
(Attributes) $1, loc);
e.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
CheckDef (current_container.AddEvent (e), e.Name, loc);
implicit_value_parameter_type = null;
@@ -1675,7 +1675,7 @@
implicit_value_parameter_type = null;
indexer_parameters = null;
indexer.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1733,7 +1733,7 @@
CheckDef (current_container.AddEnum (e), full_name, enum_location);
RootContext.Tree.RecordDecl (full_name, e);
e.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1779,7 +1779,7 @@
VariableDeclaration vd = new VariableDeclaration ((string) $2, null, lexer.Location, (Attributes) $1);
vd.Documentation = lexer.GetDocs();
$$ = vd;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
| opt_attributes IDENTIFIER
{
@@ -1790,7 +1790,7 @@
VariableDeclaration vd = new VariableDeclaration ((string) $2, $5, lexer.Location, (Attributes) $1);
vd.Documentation = lexer.GetDocs();
$$ = vd;
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -1811,7 +1811,7 @@
del.Namespace = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
del.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
| opt_attributes
opt_modifiers
@@ -1830,7 +1830,7 @@
del.Namespace = current_namespace;
CheckDef (current_container.AddDelegate (del), del.Name, l);
del.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
}
;
@@ -2656,7 +2656,7 @@
new_class = new Class (current_container, name, (int) $2,
(Attributes) $1, lexer.Location);
new_class.Documentation = lexer.GetDocs();
- lexer.SaveDocument();
+ //lexer.SaveDocument();
current_container = new_class;
current_container.Namespace = current_namespace;
RootContext.Tree.RecordDecl (name, new_class);
Index: cs-tokenizer.cs
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/cs-tokenizer.cs,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cs-tokenizer.cs 24 Feb 2003 08:33:50 -0000 1.7
+++ cs-tokenizer.cs 27 Mar 2003 17:50:52 -0000 1.8
@@ -67,14 +67,16 @@
isCollectingDocs = true;
}
- public void StopCollectngDocs()
+ public void StopCollectingDocs()
{
isCollectingDocs = false;
}
public string GetDocs()
{
- return commentString;
+ string retVal = commentString;
+ SaveDocument();
+ return retVal;
}
private static Hashtable TokenValueName
@@ -1640,20 +1642,26 @@
}
afterComment = peekChar();
if(afterComment == '\r' || afterComment=='\n')
+ {
+ //Console.WriteLine("Delimiting // comment. \n\"" + commentString + "\"");
commentString = "";
+ }
any_token_seen |= tokens_seen;
tokens_seen = false;
continue;
} else if (d == '*'){
- getChar ();
+ getChar();
if(isCollectingDocs)
commentString += "/*";
- while ((d = getChar ()) != -1){
- if (d == '*' && peekChar () == '/'){
+ while ((d = getChar()) != -1){
+ if (d == '*' && peekChar() == '/'){
if(isCollectingDocs)
+ {
+ //Console.WriteLine("Stop of /**/ comment. \n\"" + commentString + "\"");
commentString += "*/";
- getChar ();
+ }
+ getChar();
col++;
break;
}
@@ -1666,9 +1674,14 @@
any_token_seen |= tokens_seen;
tokens_seen = false;
}
+ /*
afterComment = peekChar();
if(afterComment == '\r' || afterComment=='\n')
+ {
+ Console.WriteLine("Delimiting /* comment. \n\"" + commentString + "\"");
commentString = "";
+ }
+ */
}
continue;
}
Index: ChangeLog
===================================================================
RCS file: /cvsroot/csdoc/csdoc/src/csdoc/ChangeLog,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ChangeLog 25 Feb 2003 14:21:44 -0000 1.15
+++ ChangeLog 27 Mar 2003 17:50:53 -0000 1.16
@@ -1,4 +1,10 @@
+2003-03-27 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
+
+ * cs-parser.jay : Modified the attribute rule.
+ Now collects documents after parsing attributes.
+ * cs-tokenizer.cs : Hmmm... I was losing all docs.
+
2003-02-25 Gaurav Vaish <mastergaurav AT users DOT sf DOT net>
* gen-il.cs, gen-treedump.cs : Removed.
|