home *** CD-ROM | disk | FTP | other *** search
- TABLE OF CONTENTS
-
- scanlib.library/MountScanner
- scanlib.library/StartScanner
- scanlib.library/CloseScanner
- scanlib.library/FlushScanner
- scanlib.library/SetupScanner
- scanlib.library/BriefScanner
- scanlib.library/ParseLine
- scanlib.library/UnparseLines
- scablib.library/ParseSection
-
- scanlib.library/MountScanner scanlib.library/MountScanner
-
- NAME
- MountScanner - Provide scanner description
-
- SYNOPSIS
- parserdata = MountScanner()
- D0
-
- struct ParserData *MountScanner(void);
-
- FUNCTION
- This function is called by the editor before first usage of a
- scanner. The scanner is supposed to return a description of its
- abilities or NULL.
-
- INPUTS
-
- RESULTS
- Parser description or NULL on error.
-
- SEE ALSO
- ParseLine
-
- BUGS
-
- scanlib.library/StartScanner scanlib.library/StartScanner
-
- NAME
- StartScanner - Announce new text buffer
-
- SYNOPSIS
- scanID = StartScanner(globalConfigPtr, editConfigPtr, syntaxStack)
- D0 A0 A1 D0
-
- ULONG scanID = StartScanner(struct GlobalConfig *, struct EditConfig *, struct SyntaxChunk *);
-
- FUNCTION
- This function is called by the editor after a new text buffer has been
- created (eg. after loading a file). The scanner is encouraged to
- allocate private buffer-related data and return an non-NULL ID code
- (NULL indicates a failure). The ID code is passed to the scanner
- during subsequent parser calls. A syntax stack (SyntaxChunk array) is
- provided by the editor. The scanner is encouraged to fill this array
- during subsequent parser calls depending on the contents of the line
- to be parsed. The array is guaranteed to be of sufficient size. Syntax
- scanners shouldn't (pre)parse any text lines during this call.
-
- INPUTS
- globalConfigPtr - a pointer to global preferences of the editor
- editConfigPtr - a pointer to a new text buffer
- syntaxStack - syntax stack provided by the editor
-
- RESULTS
- NULL or ID code (usage depends on scanner)
-
- SEE ALSO
- CloseScanner, FlushScanner
-
- BUGS
-
- scanlib.library/CloseScanner scanlib.library/CloseScanner
-
- NAME
- failure = CloseScanner - Announce removal of a text buffer
-
- SYNOPSIS
- failure = CloseScanner(scanID)
- D0 D0
-
- ULONG failure = CloseScanner(ULONG);
-
- FUNCTION
- This function is called if a text buffer is about to be closed. The
- scanner is supposed to free global data related to the buffer. The
- scanner is not supposed to unparse lines - there will be additional
- UnparseLines() calls if there are lines to be unparsed (these calls
- may arrive after the scanner has been closed already due to the
- asynchronous design of the editor).
-
- INPUTS
- scanID - buffer ID code as obtained during StartScanner()
-
- RESULTS
- failure - return code. Non-NULL values signal error.
-
- SEE ALSO
- StartScanner, FlushScanner
-
- BUGS
-
- scanlib.library/FlushScanner scanlib.library/FlushScanner
-
- NAME
- FlushScanner - Flush local data
-
- SYNOPSIS
- FlushScanner(scanID)
-
- void FlushScanner(ULONG)
- D0
- FUNCTION
- This function is called to make the scanner free as much memory as
- possible without affecting parsing (e.g. flush caches)
-
- INPUTS
- scanID - buffer ID code as obtained during StartScanner()
-
- RESULTS
-
- SEE ALSO
- StartScanner, CloseScanner
-
- BUGS
-
- scanlib.library/SetupScanner scanlib.library/SetupScanner
-
- NAME
- SetupScanner - Set scanner preferences
-
- SYNOPSIS
- SetupScanner(globalConfigPtr)
-
- void SetupScanner(struct GlobalConfig *)
- A0
- FUNCTION
- This function is called if the user wants to set the scanner's preferences.
- Suggested action is to open a config window on the editor's screen.
-
- INPUTS
- globalConfigPtr - A pointer to global preferences of the editor
-
- RESULTS
-
- SEE ALSO
-
- BUGS
-
- scanlib.library/BriefScanner scanlib.library/BriefScanner
-
- NAME
- BriefScanner - Notify scanner
-
- SYNOPSIS
- refreshrequest = BriefScanner(scanID, notify)
-
- struct RefreshRequest *BriefScanner(ULONG, struct ScannerNotify *)
- D0 D0 A0
-
- FUNCTION
- This function is called by the editor after a text has been modified.
- UnparseLines() has already been called for all lines in the damage
- area. The editor is going to refresh the damage area. We are supposed
- to check whether the last operation has affected syntax highlighting
- of lines beyond the damage area (e.g. if the first line of a comment
- has been deleted). We are expected to unparse affected lines beyond
- the damage area on our own. Besides, we will have to request a
- display refresh for those lines (if any). This function supports
- development of context scanners, i.e. scanners beeing able to
- recognize syntax elements consisting of multiple lines. The scanner
- should return a display refresh request or NULL if a standard damage
- area refresh is sufficient. The editor will refresh (a) the damage
- region and (b) the region described by the display refresh. The
- regions may overlap.
-
- INPUTS
- scanID - buffer ID code as obtained during StartScanner()
- notify - scanner notification:
-
- sn_Class = SCANNER_NOTIFY_MODIFIED:
- sn_Line = line number of first modification
- sn_Lines = number of modified lines still visible
- sn_Removed = number of lines deleted during operation
-
- Class description: a block of lines has been modified. Lines
- have been deleted, inserted or replaced.
-
-
- RESULTS
- refreshrequest - display refresh request
-
- SEE ALSO
- UnparseLines
-
- BUGS
-
-
- scanlib.library/ParseLine scanlib.library/ParseLine
-
- NAME
- ParseLine - Parse a line
-
- SYNOPSIS
- syntaxStack = ParseLine(scanID, line, lineNode)
-
- struct SyntaxStack *ParseLine(ULONG, struct LineNode *, line);
- D0 D0 A0 D1
-
- FUNCTION
- This function is called if a line has to be parsed. The editor will
- call this function for each line during a display refresh, so it
- better be fast. The scanner is expected to return a syntax
- description. The scanner may write the description to the syntax
- stack obtained during a prior StartScanner() call or to a private
- memory area. A syntax stack is a 0-terminated array of structures
- describing start, length and level of syntax elements within the
- line. Non-NULL levels are tanslated into colors by the editor
- according to syntax highlighting preferences. Sections of a line not
- described by a syntax scanner default to be displayed as standard
- text (syntax level 0).
-
- Restrictions:
-
- 1. A stack may not contain level 0 elements (0 terminates stack)
- 2. Parsers may not set a level for leading spaces
- 3. Parsers may not set a level for trailing spaces
- 4. Parsers may not set a level for sections beyond the end of line
- 5. Parsers may not parse fold headers
- 6. Syntax elements have to be sorted according to the start position
-
- This function is expected to return a syntax stack pointer if syntax
- levels above 0 (ie. non-standard text) have been detected within the
- line. Usage of a syntax cache is suggested to speed up output: each
- line node containes a user data slot reserved for usage by a syntax
- scanner. A scanner might use this slot to buffer the results of a
- prior parser pass. Or to remember whether syntax elements have been
- found at all and thus speed up future parser calls related to the
- same line. The scanner is notified before and after lines are/have
- been changed or removed to keep the cache up-to-date and valid
- (UnparseLines, BriefScanner). The Scanner is notified before a
- display refresh (ParseSection).
-
- INPUTS
- scanID - buffer ID code as obtained during StartScanner()
- line - line number
- lineNode - line data: lineNode->Text, lineNode->Len
-
- RESULTS
- syntaxStack - pointer to syntax stack or NULL (no highlighted elements)
-
- SEE ALSO
- UnparseLines, ParseSection, BriefScanner, ParseSection
-
- BUGS
-
-
- scanlib.library/UnparseLines scanlib.library/UnparseLines
-
- NAME
- UnparseLines - Unparse lines
-
- SYNOPSIS
- UnparseLines(lineNode, lines)
-
- void UnparseLines(struct LineNode *, ULONG)
- A0 D0
-
- FUNCTION
- This function is called before lines are deleted or modified. The
- scanner is supposed to free private data attached to the UserData
- slot of the lines (e.g. results of a prior parser pass if a caching
- algorithm is used). UserData HAS TO BE SET TO NULL. Folded blocks
- have to be unparsed, too. The scanner may not reparse any lines,
- parsing should be restricted to BriefScanner() calls.
-
- INPUTS
- lineNode - line data of first line
- lines - number of lines to be unparsed
-
- RESULTS
-
- SEE ALSO
- ParseLine, BriefScanner
-
- BUGS
-
- scanlib.library/ParseSection scanlib.library/ParseSection
-
- NAME
- ParseSection - Display refresh notification
-
- SYNOPSIS
- syntaxStack = ParseSection(scanID, lineNode, lines)
-
- void ParseSection(ULONG, struct LineNode *, ULONG);
- D0 A0 D1
-
- FUNCTION
- This function is called before a display refresh if more than one line
- is to be displayed. Syntax scanners may or may not preparse the lines
- to be displayed and attach private data to the UserData field of the
- text lines. A scanner might use this data during subsequent
- ParseLine() calls to speed up syntax processing, thus implementing a
- "syntax chache".
-
- INPUTS
- scanID - buffer ID code as obtained during StartScanner()
- lineNode - line data: lineNode->Text, lineNode->Len
- lines - lines to be displayed
-
- RESULTS
-
- SEE ALSO
- ParseLine
-
- BUGS
-