mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
Bro script documentation framework checkpoint
* New bro runtime options: -Z or --doc-scripts enables documentation mode * New BroDoc, BroBifDoc, and BroDocObj interfaces to support script documentation * Modifications to the bro scanner (scan.l) to get it to keep track of which script is being scanned/parsed and which document is being generated * Modifications to scan.l and the bro parser (parse.y) to produce/consume script comments denoted with "##" * Documentation is currently generated for the following ** Script author ** Script summary ** @load's ** capture_filters ** modules (namespaces) Most of the remaining framework/infrastructure work should be in extracting the interesting BroObj objects as the parser sees them and better formatting the reST documents.
This commit is contained in:
parent
4b77164e04
commit
30209b56bb
10 changed files with 644 additions and 3 deletions
17
src/parse.y
17
src/parse.y
|
@ -73,6 +73,15 @@
|
|||
#include "DNS.h"
|
||||
#include "RE.h"
|
||||
#include "Scope.h"
|
||||
#include "BroDoc.h"
|
||||
#include "BroDocObj.h"
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
||||
extern BroDoc* current_reST_doc;
|
||||
extern int generate_documentation;
|
||||
extern std::list<std::string>* reST_doc_comments;
|
||||
|
||||
YYLTYPE GetCurrentLocation();
|
||||
extern int yyerror(const char[]);
|
||||
|
@ -785,7 +794,13 @@ formal_args_decl:
|
|||
|
||||
decl:
|
||||
TOK_MODULE TOK_ID ';'
|
||||
{ current_module = $2; }
|
||||
{
|
||||
current_module = $2;
|
||||
if ( generate_documentation )
|
||||
{
|
||||
current_reST_doc->AddModule(current_module);
|
||||
}
|
||||
}
|
||||
|
||||
| TOK_EXPORT '{' { is_export = true; } decl_list '}'
|
||||
{ is_export = false; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue