2019-07-28 23:53:15 +03:00
|
|
|
|
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
|
2015-06-01 22:15:17 +03:00
|
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
|
|
|
|
using System;
|
2015-05-14 22:35:07 +03:00
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Xml;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using PascalABCCompiler.SemanticTreeConverters;
|
|
|
|
|
|
using PascalABCCompiler.TreeRealization;
|
|
|
|
|
|
using PascalABCCompiler.TreeConverter;
|
|
|
|
|
|
|
|
|
|
|
|
namespace PascalABCCompiler
|
|
|
|
|
|
{
|
|
|
|
|
|
public class DocXmlManager
|
|
|
|
|
|
{
|
|
|
|
|
|
private XmlWriter xtw;
|
|
|
|
|
|
private CompilationUnit cu;
|
|
|
|
|
|
private bool is_assembly;
|
|
|
|
|
|
private string unit_name;
|
|
|
|
|
|
|
|
|
|
|
|
public void SaveXml(CompilationUnit cu)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
this.cu = cu;
|
Refactoring of Compiler.cs (#2984)
* Add first comments
* Finish commenting for Compile and CompileUnit
* Write TODO sections
* Add a few clarifications
* splitted some functions from compile
* Written some methods from Compile to functions
* Update variable names
* Refactor - stage 1
Refactor GetUsesSection and IsPossibleNameSpace
* Refactor - stage 2
Rename a few functions and variables
* Correct an inaccuracy
* Added comments, look through CompileUnit
* Rename a few functions and add new comments
* Split CompileUnit to Subfunctions
Add IsUnitCompiled, IsUnitInPCU, InitializeNewUnit, GetSourceCode, GenSyntaxTree, GenUnitDocumentation, CheckDLLDirectiveOnlyForLibraries, MatchErrorsToBadNodes, CheckIfUnitModule, SetUseDLLForSystemUnits,
CompileInterfaceDependencies, CompileCurrentUnitInterface, GetImplementationUsesSection, CompileImplementationDependencies, CompileCurrentUnitImplementation
* Added some TODOs
* Return uses_unit_in original name
Renaming of syntax tree nodes leads to internal compiler errors
* Extract GenerateILCode method
* Add checking if recompilation needed method
Needs to be discussed and revised
* Add functions for catch blocks in Compile
* Extract building semantic tree method
Creating main function to be moved to another class
* Rename UnitsSortedList
* Edit CompileUnitsFromDelayedList method
* Change a few variable names, make CreateRCFile function and add comments
* Make code more "user-friendly"
* Add TODOs 31.11.23
* Create PrebuildSemanticTreeActionsMethod
* Refactor semantic checks section in initialize new unit method
* Refactor Adding standard units to uses method
* Return file_name and compiler_directives original names to avoid internal compilation errors
* Refactor GetReferences Method
* Initial refactoring of IncludeNamespaces function
* Create three more methods and wrap important code in regions
* Add TODO's
* Resolve merge conflicts
* Add returned value to ConstructSyntaxTree method
* Fix UnitsSortedList NotFoundError in PCUWriter
* Workaround commit
* Update PABCSystem after tests' changes
* Rename syntax trees in some methods
* Delete CurrentSyntaxUnit variable
* Revert unnecessary project files changes
* Squashed commit of the following:
commit f4d7599f1a39252feac97bd5391f46dfdc25f6f4
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:29 2023 +0300
added links to identarranger
commit 3bd5d33e2b2969884e61a3279ff9c353013b57fe
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:03 2023 +0300
Change extension for verybasic to yavb
commit 61294c6e7d405e1c68516cc81d3a109e8a1ee295
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:33:57 2023 +0300
Change Program Example
commit 86971488341ed6bf13c39e13a513d7ac0c51c285
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:28:59 2023 +0300
Add IndentArranger to Compile
commit 2ce50bbbf9db22c4243b247b870f6935ce206d26
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 17 10:00:31 2023 +0300
Add Semicolon After Each Statement
commit 796309d340e8d8ba730ff9418fa376f34fb7fd36
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Wed Nov 15 18:49:11 2023 +0300
Add Alpha Version of Python-style If-statement
commit 5eb88f946fe8254b4f5c5a56ed0a567b3be51227
Merge: ab4ce5b0 0162b637
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:54:26 2023 +0300
Merge branch 'IndentArranger' into VeryBasicLanguage
commit ab4ce5b0e32d42004726e3dc45cc0d8a65e53f56
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:53:51 2023 +0300
Fixes from seminar
commit af74012289d0d08517c13499a2a66cb543fc06d2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 18:57:29 2023 +0300
finally working!
fully implemented compatibility
commit 58a39c313324b468d1eec207ba3f5f6eddf74ef2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 11:58:16 2023 +0300
more compatibility with pabc
Now verybasic statements translate to pascal compiler
added .bat script for autobuilding verybasic
commit 0162b6376b8fe970704f26213bf9f0f670dfb12e
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:06:14 2023 +0300
Update test.txt
commit 1b759ab1cd7ee2ffeb14afff0418ddf0f30b0399
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:05:36 2023 +0300
Add Indent and Unindent Keywords to Generated File
commit cabda7f3985651cff2a8740f1a5bdea8fe7ac892
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 10 21:25:52 2023 +0300
Add Generation of Output File
commit 306f033d0176ab559e3622b8505427dbe2e0e203
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:42:18 2023 +0300
Update IndentArranger.sln
commit 60c0ceced1aa3a7d2e33de0facb1126e295f43b5
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:41:22 2023 +0300
Add IndentArranger
commit 1f4556c4573dae154fcc167b41ff6ab9e8122136
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Mon Nov 6 22:48:36 2023 +0300
Made my own VeryBasicParser project
Copied some code from SaushkinParser
Tried to compile it and implement into Pascal
Doesn't work due to grammatik issue
* Squashed commit of the following:
commit 4e73d9ac3ffef68312f06a74dc83afffcf3ccbee
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 15:08:10 2023 +0300
Fixed GPPG (i think so at least)
commit e5cfc220828b37fb2f35e565683019716ec3f0ce
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:44:27 2023 +0300
Update Compiler.cs
commit 4698e2e75a5f3b4f523a8bc7733a50e8abb4fca1
Merge: 22aaf2b2 f4d7599f
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:54 2023 +0300
Merge branch 'IndentArrangerTemp' into VeryBasicLanguage
commit f4d7599f1a39252feac97bd5391f46dfdc25f6f4
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:29 2023 +0300
added links to identarranger
commit 3bd5d33e2b2969884e61a3279ff9c353013b57fe
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:43:03 2023 +0300
Change extension for verybasic to yavb
commit 22aaf2b2508278a9ffce525ffed52419bf72c23f
Merge: c326174f 61294c6e
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 22 11:26:36 2023 +0300
Merge branch 'IndentArrangerTemp' into VeryBasicLanguage
commit 61294c6e7d405e1c68516cc81d3a109e8a1ee295
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:33:57 2023 +0300
Change Program Example
commit 86971488341ed6bf13c39e13a513d7ac0c51c285
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Tue Nov 21 09:28:59 2023 +0300
Add IndentArranger to Compile
commit c326174ff5ecccf9c4f76d58aea4653f047af049
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 19 15:03:19 2023 +0300
Added UniversalParserHelper and GPPG
ShiftReduceParser moved to another project
UniversalParserHelper project added, most of it copied from SaushkinParser
commit 2ce50bbbf9db22c4243b247b870f6935ce206d26
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 17 10:00:31 2023 +0300
Add Semicolon After Each Statement
commit 796309d340e8d8ba730ff9418fa376f34fb7fd36
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Wed Nov 15 18:49:11 2023 +0300
Add Alpha Version of Python-style If-statement
commit 5eb88f946fe8254b4f5c5a56ed0a567b3be51227
Merge: ab4ce5b0 0162b637
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:54:26 2023 +0300
Merge branch 'IndentArranger' into VeryBasicLanguage
commit ab4ce5b0e32d42004726e3dc45cc0d8a65e53f56
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Wed Nov 15 16:53:51 2023 +0300
Fixes from seminar
commit af74012289d0d08517c13499a2a66cb543fc06d2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 18:57:29 2023 +0300
finally working!
fully implemented compatibility
commit 58a39c313324b468d1eec207ba3f5f6eddf74ef2
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Sun Nov 12 11:58:16 2023 +0300
more compatibility with pabc
Now verybasic statements translate to pascal compiler
added .bat script for autobuilding verybasic
commit 0162b6376b8fe970704f26213bf9f0f670dfb12e
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:06:14 2023 +0300
Update test.txt
commit 1b759ab1cd7ee2ffeb14afff0418ddf0f30b0399
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Sun Nov 12 10:05:36 2023 +0300
Add Indent and Unindent Keywords to Generated File
commit cabda7f3985651cff2a8740f1a5bdea8fe7ac892
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Fri Nov 10 21:25:52 2023 +0300
Add Generation of Output File
commit 306f033d0176ab559e3622b8505427dbe2e0e203
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:42:18 2023 +0300
Update IndentArranger.sln
commit 60c0ceced1aa3a7d2e33de0facb1126e295f43b5
Author: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Date: Thu Nov 9 20:41:22 2023 +0300
Add IndentArranger
commit 1f4556c4573dae154fcc167b41ff6ab9e8122136
Author: Владислав Крылов <krylov@sfedu.ru>
Date: Mon Nov 6 22:48:36 2023 +0300
Made my own VeryBasicParser project
Copied some code from SaushkinParser
Tried to compile it and implement into Pascal
Doesn't work due to grammatik issue
* Changed GPPG project NET Framework version, added .dll to gitignore
* Adding UniversalParserHelper to project, trying to include VeryBasic
* Managed dependencies and got VeryBasicLanguage to work
* Change extension of a test program
* Rebuild changes
What should be added to .gitignore?
* Fix bug related to err0524_res_unit.pas
* Rebuild Parser
* Change Indent and Unindent tokens
* Add Symbol Table to ParserABC.y
* Change Indent Space Number to 2
* Add While Loop
* Add Some Operations to Parser
* Make Initialization Node at the Beginning of a program
* Create Grammar.txt
* Test program added
* Add ELIF and SyntaxHighlight
* Fix TableSymbol
* Add Division
* Add Method Call
* Add For Loop
* Rename SPython Parser Folder
* Add documented comments for CompileUnit method
* Added Errors to SPython
Added Errors.cs
Removed link to PABCSaushkinParser
Minor fixes
* Create default constructor for SourceContext
* Move null check of currentUnit to upper level in CompileUnit
* Move CreateMainFunction method from Compiler to TreeConverter class
* Add gppg and parserhelper to visualpascalabcnet dependencies
* Updated installer files to include GPPG and UniversalParserHelper
* Rename GPPG to ShiftReduceParser
* Fix ShiftReduceParser project dependencies
* Fix ShiftReduceParserDependencies second iteration
* Workaround commit
* Update PABCSystem after tests' changes
* Refactor ConvertDirectives method
* Get rid of legacy standard modules code
* Return varBeginOffset and beginOffset calculation to Compiler class
Размещение метода в SyntaxTreeToSemanticTreeConverter не целесообразно. В комментарии видимо имелось в виду что-то другое.
* Workaround commit
* Update PABCSystem after tests' changes
* Revert SPython changes
Оставляем только изменения связанные с рефакторингом.
* Update .gitignore
Co-authored-by: Sun Serega <sunserega2@gmail.com>
* Resolve a few Sun Serega treds
* Delete comments in ParsersController.cs
* Replace specific path with path variable in Studio.bat
* Add comment in Studio.bat file and return FileName in CompilerError.cs
* Fix TreeSubsidiary.cs encoding and sectCore.nsh indents
* Return old version of TestRunner.exe
* Rename some variables and polish a few methods
* Uncomment accidentally commented code
* Replace spaces with tabs
* Changed dll name from GPPG
* Revert "Changed dll name from GPPG"
This reverts commit c485cc8cb787809b7e9dfa8a361e75f17ed39893.
* Update .gitignore
* Delete Libraries/ShiftReduceParser.dll
* Delete bin\ShiftReduceParser.dll
* Replace tabs with spaces
* Update encoding in Studio.bat
* Fix bug with PABCrtl excluded files
* Refactor StandardModule class
* Add null checks to make debuging easier
* Delete unnecessary null checks in SymTable.cs
---------
Co-authored-by: Владислав Крылов <krylov@sfedu.ru>
Co-authored-by: MovchanGitHub <92666028+MovchanGitHub@users.noreply.github.com>
Co-authored-by: Sun Serega <sunserega2@gmail.com>
2023-12-18 22:33:27 +03:00
|
|
|
|
is_assembly = cu.SyntaxTree is SyntaxTree.program_module || Compiler.IsDll(cu.SyntaxTree);
|
2015-05-14 22:35:07 +03:00
|
|
|
|
XmlWriterSettings settings = new XmlWriterSettings();
|
|
|
|
|
|
settings.Encoding = Encoding.UTF8;
|
|
|
|
|
|
settings.Indent = true;
|
2021-01-06 00:47:18 +03:00
|
|
|
|
xtw = XmlTextWriter.Create(Path.ChangeExtension(cu.UnitFileName, ".xml"), settings);
|
|
|
|
|
|
unit_name = Path.GetFileNameWithoutExtension(cu.UnitFileName);
|
2015-05-14 22:35:07 +03:00
|
|
|
|
xtw.WriteStartDocument();
|
|
|
|
|
|
xtw.WriteStartElement("doc");
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("assembly");
|
|
|
|
|
|
xtw.WriteStartElement("name");
|
2021-01-06 00:47:18 +03:00
|
|
|
|
xtw.WriteString(Path.GetFileNameWithoutExtension(cu.UnitFileName));
|
2015-05-14 22:35:07 +03:00
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("unit");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
//xtw.WriteString((cu.SemanticTree as common_unit_node).unit_name);
|
2021-01-06 00:47:18 +03:00
|
|
|
|
xtw.WriteString(Path.GetFileNameWithoutExtension(cu.UnitFileName));
|
2015-05-14 22:35:07 +03:00
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteString(cu.SemanticTree.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
SaveMembers();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.Flush();
|
|
|
|
|
|
}
|
2019-06-07 00:06:11 +03:00
|
|
|
|
catch (Exception)
|
2015-05-14 22:35:07 +03:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
if (xtw != null)
|
|
|
|
|
|
xtw.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
catch
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveMembers()
|
|
|
|
|
|
{
|
|
|
|
|
|
common_unit_node cun = cu.SemanticTree as common_unit_node;
|
|
|
|
|
|
xtw.WriteStartElement("members");
|
|
|
|
|
|
foreach(common_namespace_node cnn in cun.namespaces)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (common_type_node ctn in cnn.types)
|
|
|
|
|
|
SaveType(ctn);
|
|
|
|
|
|
foreach (type_synonym ts in cnn.type_synonyms)
|
|
|
|
|
|
SaveTypeSynonim(ts);
|
|
|
|
|
|
foreach (common_namespace_function_node cnfn in cnn.functions)
|
|
|
|
|
|
SaveFunction(cnfn);
|
|
|
|
|
|
foreach (namespace_variable nv in cnn.variables)
|
|
|
|
|
|
SaveVariable(nv);
|
|
|
|
|
|
foreach (namespace_constant_definition ncd in cnn.constants)
|
|
|
|
|
|
SaveConstant(ncd);
|
|
|
|
|
|
}
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveType(common_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(ctn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!ctn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
xtw.WriteString("T:"+get_name(ctn));
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("T:"+ctn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(ctn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+"T:"+(is_assembly?get_name(ctn):ctn.name)+"\">",ctn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
foreach (common_method_node cmn in ctn.methods)
|
|
|
|
|
|
SaveMethod(cmn);
|
|
|
|
|
|
foreach (common_property_node cmn in ctn.properties)
|
|
|
|
|
|
SaveProperty(cmn);
|
|
|
|
|
|
foreach (common_event ce in ctn.events)
|
|
|
|
|
|
SaveEvent(ce);
|
|
|
|
|
|
foreach (class_field cmn in ctn.fields)
|
|
|
|
|
|
SaveField(cmn);
|
|
|
|
|
|
foreach (class_constant_definition cmn in ctn.const_defs)
|
|
|
|
|
|
SaveClassConstant(cmn);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveTypeSynonim(type_synonym ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(ctn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!ctn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
xtw.WriteString("T:"+ctn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(ctn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+"T:"+ctn.name+"\">",ctn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveFunction(common_namespace_function_node cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
xtw.WriteString("M:"+(is_assembly?unit_name+"."+unit_name+".":"")+cfn.name+GetGenericFlag(cfn)+GetParameters(cfn));
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+"M:"+(is_assembly?unit_name+"."+unit_name+".":"")+cfn.name+GetGenericFlag(cfn)+GetParameters(cfn)+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveEvent(common_event cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
xtw.WriteString("E:"+get_name(cfn.cont_type)+"."+cfn.name);
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("E:"+cfn.cont_type.name+"."+cfn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+(is_assembly?("E:"+get_name(cfn.cont_type)+"."+cfn.name):("E:"+cfn.cont_type.name+"."+cfn.name))+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string GetGenericFlag(common_function_node cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.is_generic_function) return "";
|
|
|
|
|
|
return "``"+cfn.get_generic_params_list().Count.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveMethod(common_method_node cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.is_constructor)
|
|
|
|
|
|
xtw.WriteString("M:"+get_name(cfn.cont_type)+"."+cfn.name+GetGenericFlag(cfn)+GetParameters(cfn));
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("M:"+get_name(cfn.cont_type)+".#ctor"+GetGenericFlag(cfn)+GetParameters(cfn));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.is_constructor)
|
|
|
|
|
|
xtw.WriteString("M:"+cfn.cont_type.name+"."+cfn.name+GetGenericFlag(cfn)+GetParameters(cfn));
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("M:"+cfn.cont_type.name+".#ctor"+GetGenericFlag(cfn)+GetParameters(cfn));
|
|
|
|
|
|
}
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string descr = null;
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.is_constructor)
|
|
|
|
|
|
descr = "M:"+get_name(cfn.cont_type)+"."+cfn.name+GetGenericFlag(cfn)+GetParameters(cfn);
|
|
|
|
|
|
else
|
|
|
|
|
|
descr = "M:"+get_name(cfn.cont_type)+".#ctor"+GetGenericFlag(cfn)+GetParameters(cfn);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.is_constructor)
|
|
|
|
|
|
descr = "M:"+cfn.cont_type.name+"."+cfn.name+GetGenericFlag(cfn)+GetParameters(cfn);
|
|
|
|
|
|
else
|
|
|
|
|
|
descr = "M:"+cfn.cont_type.name+".#ctor"+GetGenericFlag(cfn)+GetParameters(cfn);
|
|
|
|
|
|
}
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+descr+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string GetParameters(common_function_node cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
if (cfn.parameters.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Append("(");
|
|
|
|
|
|
for (int i=0; i<cfn.parameters.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Append(get_name(cfn.parameters[i].type));
|
|
|
|
|
|
if (cfn.parameters[i].parameter_type == SemanticTree.parameter_type.var)
|
|
|
|
|
|
sb.Append('@');
|
|
|
|
|
|
if (i<cfn.parameters.Count-1)
|
|
|
|
|
|
sb.Append(",");
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.Append(")");
|
|
|
|
|
|
}
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_name(type_node tn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (tn is compiled_type_node)
|
|
|
|
|
|
return tn.full_name;
|
|
|
|
|
|
if (tn is common_type_node)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (tn.is_generic_type_instance)
|
|
|
|
|
|
{
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
sb.Append(tn.original_generic.full_name);
|
|
|
|
|
|
if (tn.instance_params.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Append("{");
|
|
|
|
|
|
for (int i=0; i<tn.instance_params.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Append(get_name(tn.instance_params[i]));
|
|
|
|
|
|
if (i<tn.instance_params.Count-1)
|
|
|
|
|
|
sb.Append(",");
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.Append("}");
|
|
|
|
|
|
}
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (tn.is_generic_parameter)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (tn.generic_function_container != null)
|
|
|
|
|
|
return "``"+tn.generic_param_index;
|
|
|
|
|
|
return "`"+tn.generic_param_index;
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (tn.IsDelegate)
|
|
|
|
|
|
return get_delegate_name(tn as common_type_node);
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (tn is ref_type_node)
|
|
|
|
|
|
{
|
|
|
|
|
|
return get_pointer_name(tn as ref_type_node);
|
|
|
|
|
|
}
|
|
|
|
|
|
switch (tn.type_special_kind)
|
|
|
|
|
|
{
|
|
|
|
|
|
case SemanticTree.type_special_kind.array_wrapper : return get_array_name(tn as common_type_node);
|
|
|
|
|
|
case SemanticTree.type_special_kind.set_type : return get_set_type_name(tn as common_type_node);
|
|
|
|
|
|
case SemanticTree.type_special_kind.short_string : return get_shortstring_name(tn as short_string_type_node);
|
|
|
|
|
|
case SemanticTree.type_special_kind.diap_type : return get_diap_name(tn as common_type_node);
|
|
|
|
|
|
case SemanticTree.type_special_kind.binary_file: return get_binary_file_name(tn as common_type_node);
|
|
|
|
|
|
case SemanticTree.type_special_kind.typed_file : return get_typed_file_name(tn as common_type_node);
|
|
|
|
|
|
case SemanticTree.type_special_kind.array_kind : return get_dyn_array_name(tn as common_type_node);
|
|
|
|
|
|
default : return tn.full_name;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_pointer_name(ref_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
type_node tn = ctn.pointed_type;
|
|
|
|
|
|
int i=1;
|
|
|
|
|
|
while (tn is ref_type_node)
|
|
|
|
|
|
{
|
|
|
|
|
|
i++;
|
|
|
|
|
|
tn = (tn as ref_type_node).pointed_type;
|
|
|
|
|
|
}
|
|
|
|
|
|
string s = get_name(tn);
|
|
|
|
|
|
for (int j=0; j<i; j++)
|
|
|
|
|
|
s += "*";
|
|
|
|
|
|
return s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_delegate_name(common_type_node ctn)
|
|
|
|
|
|
{
|
2017-10-23 11:21:15 +03:00
|
|
|
|
common_method_node cmn = ctn.find_first_in_type(compiler_string_consts.invoke_method_name).sym_info as common_method_node;
|
2015-05-14 22:35:07 +03:00
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
if (cmn.return_value_type != null)
|
|
|
|
|
|
sb.Append("@function");
|
|
|
|
|
|
else sb.Append("@procedure");
|
|
|
|
|
|
if (cmn.parameters.Count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Append('(');
|
|
|
|
|
|
for (int i=0; i<cmn.parameters.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.Append(get_name(cmn.parameters[i].type));
|
|
|
|
|
|
if (cmn.parameters[i].parameter_type == SemanticTree.parameter_type.var)
|
|
|
|
|
|
sb.Append('@');
|
|
|
|
|
|
if (i<cmn.parameters.Count-1)
|
|
|
|
|
|
sb.Append(',');
|
|
|
|
|
|
}
|
|
|
|
|
|
sb.Append(')');
|
|
|
|
|
|
}
|
|
|
|
|
|
if (cmn.return_value_type != null)
|
|
|
|
|
|
sb.Append(":"+get_name(cmn.return_value_type));
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_constant(constant_node cn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (cn is int_const_node) return (cn as int_const_node).constant_value.ToString();
|
|
|
|
|
|
if (cn is char_const_node) return "'"+(cn as char_const_node).constant_value.ToString()+"'";
|
|
|
|
|
|
if (cn is byte_const_node) return (cn as byte_const_node).constant_value.ToString();
|
|
|
|
|
|
if (cn is sbyte_const_node) return (cn as sbyte_const_node).constant_value.ToString();
|
|
|
|
|
|
if (cn is short_const_node) return (cn as short_const_node).constant_value.ToString();
|
|
|
|
|
|
if (cn is ushort_const_node) return (cn as ushort_const_node).constant_value.ToString();
|
|
|
|
|
|
if (cn is uint_const_node) return (cn as uint_const_node).constant_value.ToString();
|
|
|
|
|
|
if (cn is long_const_node) return (cn as long_const_node).constant_value.ToString();
|
|
|
|
|
|
if (cn is ulong_const_node) return (cn as ulong_const_node).constant_value.ToString();
|
|
|
|
|
|
return "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_dyn_array_name(common_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
type_node tn = ctn.element_type;
|
|
|
|
|
|
int i=1;
|
|
|
|
|
|
while (tn.type_special_kind == SemanticTree.type_special_kind.array_kind)
|
|
|
|
|
|
{
|
|
|
|
|
|
i++;
|
|
|
|
|
|
tn = tn.element_type;
|
|
|
|
|
|
}
|
|
|
|
|
|
string s = get_name(tn);
|
|
|
|
|
|
for (int j=0; j<i; j++)
|
|
|
|
|
|
s += "[]";
|
|
|
|
|
|
return s;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_array_name(common_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
sb.Append("@array");
|
|
|
|
|
|
bounded_array_interface bai = ctn.get_internal_interface(internal_interface_kind.bounded_array_interface) as bounded_array_interface;
|
|
|
|
|
|
sb.Append('[');
|
|
|
|
|
|
sb.Append(get_constant(bai.ordinal_type_interface.lower_value));
|
|
|
|
|
|
sb.Append("..");
|
|
|
|
|
|
sb.Append(get_constant(bai.ordinal_type_interface.upper_value));
|
|
|
|
|
|
sb.Append(']');
|
|
|
|
|
|
sb.Append("["+get_name(ctn.element_type)+"]");
|
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_typed_file_name(common_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "@fileof["+get_name(ctn.element_type)+"]";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_binary_file_name(common_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "@file";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_shortstring_name(short_string_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "@string["+ctn.Length.ToString()+"]";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_set_type_name(common_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "@set["+get_name(ctn.element_type)+"]";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private string get_diap_name(common_type_node ctn)
|
|
|
|
|
|
{
|
|
|
|
|
|
return "@diap["+get_constant(ctn.low_bound)+".."+get_constant(ctn.upper_bound)+"]";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveProperty(common_property_node cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
xtw.WriteString("P:"+get_name(cfn.comprehensive_type)+"."+cfn.name);
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("P:"+cfn.comprehensive_type.name+"."+cfn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+(is_assembly?("P:"+get_name(cfn.comprehensive_type)+"."+cfn.name):("P:"+cfn.comprehensive_type.name+"."+cfn.name))+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveField(class_field cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
xtw.WriteString("F:"+get_name(cfn.cont_type)+"."+cfn.name);
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("F:"+cfn.cont_type.name+"."+cfn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+(is_assembly?("F:"+get_name(cfn.cont_type)+"."+cfn.name):("F:"+cfn.cont_type.name+"."+cfn.name))+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveClassConstant(class_constant_definition cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
if (is_assembly)
|
|
|
|
|
|
xtw.WriteString("F:"+get_name(cfn.comperehensive_type)+"."+cfn.name);
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("F:"+cfn.comperehensive_type.name+"."+cfn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+(is_assembly?("F:"+get_name(cfn.comperehensive_type)+"."+cfn.name):("F:"+cfn.comperehensive_type.name+"."+cfn.name))+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveConstant(namespace_constant_definition cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
xtw.WriteString((is_assembly?"F:"+unit_name+"."+unit_name+".":"C:")+cfn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+(is_assembly?"F:"+unit_name+"."+unit_name+".":"C:")+cfn.name+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void SaveVariable(var_definition_node cfn)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!string.IsNullOrEmpty(cfn.documentation))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!cfn.documentation.Trim(' ','\t').StartsWith("<summary>"))
|
|
|
|
|
|
{
|
|
|
|
|
|
xtw.WriteStartElement("member");
|
|
|
|
|
|
xtw.WriteStartAttribute("name");
|
|
|
|
|
|
if (!is_assembly)
|
|
|
|
|
|
xtw.WriteString("V:"+cfn.name);
|
|
|
|
|
|
else
|
|
|
|
|
|
xtw.WriteString("F:"+unit_name+"."+unit_name+"."+cfn.name);
|
|
|
|
|
|
xtw.WriteEndAttribute();
|
|
|
|
|
|
xtw.WriteStartElement("summary");
|
|
|
|
|
|
xtw.WriteString(cfn.documentation);
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
xtw.WriteEndElement();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
string doc = string.Concat("<member name=\""+(is_assembly?"F:"+unit_name+"."+unit_name+".":"V:")+cfn.name+"\">",cfn.documentation,"</member>");
|
|
|
|
|
|
StringReader sr = new StringReader(doc);
|
|
|
|
|
|
XmlReader xr = XmlTextReader.Create(sr);
|
|
|
|
|
|
xr.Read();
|
|
|
|
|
|
xtw.WriteNode(xr.ReadSubtree(),false);
|
|
|
|
|
|
sr.Close();
|
|
|
|
|
|
xr.Close();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|