PS-SyntaxDoc
============

A documentation generator for RemObjects PascalScript engine.

It supports various documentation modes, from a simple syntax overview,
to the SynEdit code-completion templates and XML output.

RemObjects PascalScript is a popular scripting engine solution
for Delphi developers, that is widely used and very well-rated.
You can find it here: http://www.remobjects.com/ps.aspx.

PS-SyntaxDoc is an extension for this scripting engine, that lets you generate
a full description of the syntax of your scripting interface and provide your
developers and end-users with a better overview of the possibilities of your product.


License:
--------
PS-SyntaxDoc is distributed as a FREEWARE WITH SOURCE.
The source code of PS-SyntaxDoc is given as is. The author is not responsible
for any possible damage done due to the use of this code. "psSyntaxDoc.pas" unit
can be freely used in any application.


Usage example:
--------------
PS-SyntaxDoc generator is declared as a Delphi function named "MakePSSyntaxDoc",
located in the unit "psSyntaxDoc.pas". The usage is very simple, because you only
need to call the MakePSSyntaxDoc function from within the OnBeforeOutput event
of your TPSScript component's compiler object.

1. Add "psSyntaxDoc" unit to the uses clause of your program.

2. Define the following function:

    function psCompilerBeforeOutput(Sender: TPSPascalCompiler): Boolean;
    var
      s:string;
    begin
      Result:=True;
      if MakePSSyntaxDoc(Sender, s, sdmXml) then
        with TStringList.create do
        begin
          Text := s;
          SaveToFile('C:\Temp\MySyntax.xml');
          Free;
        end;
    end;

3. Assign this function to an OnBeforeOutput event of TPSScript component's compiler:

     MyPSScript.Comp.OnBeforeOutput:=psCompilerBeforeOutput;

  
And that's all. Now the syntax documentation is generated every time
you compile your script and it is saved into the MySyntax.xml file.

Of course, you can define your own processing conditions, but the syntax
generation (performed by the MakePSSyntaxDoc function) must be executed
from within the OnBeforeOutput event.

See the parameters of MakePSSyntaxDoc function to learn more about
syntax generation options (such as documentation mode and filtering options).


Sample outputs:
---------------
A few outputs of this generator are available in a "Samples" folder of the distribution
archive. These are the outputs of documentation for product "pdScript", that is
available on our site too.

To create documentation in HTML format, use the XML output mode and transform
it by an XSLT template. The distribution package contains a sample template
"Xslt\PascalScript.xsl" (requires MSXML).


The PS-SyntaxDoc has been tested on Delphi version 2009, but it should work also on all
newer versions (and with some small modifications also on the previous versions from
Delphi 7 to 2007).

If you will have any suggestions, ideas or problems with using it,
please feel free to contact us.


Contact:
--------
Precision software & consulting
e-mail:  info@be-precision.com
www:     http://www.be-precision.com
support: www.be-precision.com/support
         support@be-precision.com
forum:   www.be-precision.com/forum
rss:     www.be-precision.com/rss_en.xml


========================================================
Copyright (c) 2008-2011  Precision software & consulting
All rights reserved.
