tcldoc_scanner.tcl
@author
,
@return
, etc) and formats them suitably for the file's
annotation page. Also identifies one-line summary for the item and
adds it to the global summary table. This file is parsed by fickle to create the actual scanner.
Procedure Summary |
add_file_annotation { header } Given the file-level comment (with //# markings removed) scans it for tags. |
add_proc_annotation { header procname procargs procline } Given a procedure-level comment scans it for tags. |
BEGIN { new_state {prefix yy} } BEGIN followed by the name of a start condition places the scanner in the corresponding start condition. |
ECHO { {s {}} } ECHO copies yytext to the scanner's output if no arguments are given. |
get_summary { text } Determines the summary line given the file/procedure information. |
input { } input() reads the next character from the input stream. |
interp_link { text tag } Helper function to the scanner that takes the arguments to a @link or the third form of @see and splits it into its component parts. |
new_annotation { dest basename annothtmlname docroot } Flushes internal tables in preparation for writing a new annotation file. |
unput { c } unput(c) puts the character c back onto the input stream. |
write_annotation { } Actually writes the annotation file to disk at the location specified in a previous call to new_annotation. |
YY_FLUSH_BUFFER { } YY_FLUSH_BUFFER flushes the scanner's internal buffer so that the next time the scanner attempts to match a token, it will first refill the buffer using YY_INPUT. |
YY_INPUT { buf result max_size } The nature of how it gets its input can be controlled by defining the YY_INPUT macro. |
yy_pop_state { } Pops off the top of the state stack; if the stack is now empty, then pushes the state "INITIAL". |
yy_push_state { new_state } Pushes the current start condition onto the top of the start condition stack and switches to new_state as though you had used BEGIN new_state. |
yy_scan_string { str } yy_scan_string sets up input buffers for scanning in-memory strings instead of files. |
yy_top_state { } Returns the top of the stack without altering the stack's contents. |
yyless { n } Returns all but the first n characters of the current token back to the input stream, where they will be rescanned when the scanner looks for the next match. |
yylex { } Whenever yylex() is called, it scans tokens from the global input file yyin (which defaults to stdin). |
yyrestart { new_file } yyrestart(new_file) may be called to point yyin at the new input file. |
yywrap { } If yywrap() returns false (zero), then it is assumed that the function has gone ahead and set up yyin to point to another input file, and scanning continues. |
Procedure Detail |
proc add_file_annotation { header }
//#
markings
removed) scans it for tags. Generates the HTML code suitable for
writing to the file's annotation page. Adds a one-line summary for
the file to the global summary table.header
- a contiguous block of comments sans hash marks
proc add_proc_annotation { header procname procargs procline }
header
- a contiguous block of comments sans hash marks
procname
- name of the procedure being scanned
procargs
- a flattened list of arguments
to the procedure
procline
- line number for procedure declaration within its
source file
proc BEGIN { new_state {prefix yy} }
proc ECHO { {s {}} }
proc get_summary { text }
text
- Text from a comment block (either file or procedure
level) from which to determine summary.
proc input { }
proc interp_link { text tag }
@link
or the third form of @see
and splits
it into its component parts. For the name portion attempts to
resolve the procedure name as per the rules described in the Tcldoc manual. Checks if there is an optional label;
if not then set the label equal to the name. Finally adds the
results of the interpretation to the current tag being scanned.text
- tag text to scan
tag
- name of tag being scanned.
proc new_annotation { dest basename annothtmlname docroot }
dest
- I/O channel to write annotations
basename
- name of source Tcl file being annotate
annothtmlname
- name of file to where annotations are being
written
docroot
- documents root directory
proc unput { c }
proc write_annotation { }
new_annotation
has not been called yet then behavior is
undetermined.proc YY_FLUSH_BUFFER { }
proc YY_INPUT { buf result max_size }
proc yy_pop_state { }
proc yy_push_state { new_state }
proc yy_scan_string { str }
proc yy_top_state { }
proc yyless { n }
proc yylex { }
proc yyrestart { new_file }
proc yywrap { }