Oberon || Library || Module Index || Search Engine || Definition || Module
CONST delimlen = 4; TYPE Delimiter = ARRAY delimlen OF CHAR; TYPE Syntax = POINTER TO SyntaxRec; TYPE SyntaxRec = RECORD (* comment syntax *) (Objects.ObjectRec) start: Delimiter; (* starts a comment *) inclStart: BOOLEAN; (* belongs start to the comment? *) end: Delimiter; (* ends a comment *) inclEnd: BOOLEAN; (* belongs end to the comment? *) nested: BOOLEAN; (* may comments be nested? *) END;
PROCEDURE Open(VAR s: Streams.Stream; input: Streams.Stream; commentSyntax: Syntax);
Open returns a newly opened stream s for reading which gets its input from input except that all comments are stripped off. The comment syntax is given by syntax: comments are delimited by start and end. inclStart and inclEnd determine whether the delimiters belong to the comment or not. Comments may be nested, if nested is set to TRUE.
Two Examples:
___________________________________ |_________|__Oberon___Bourne_Shell| |start | (* # | |inclStart| TRUE TRUE | |end | *) ASCII.nl | |inclEnd | TRUE FALSE | |nested | TRUE FALSE | |_________|_______________________|
Oberon || Library || Module Index || Search Engine || Definition || Module