Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Libraries AES ARC4 Array ASN.1 Bigfile Bigint Bigrat Bin32 Bin64 Bitdata Bitmapfont Bitset Bitsetof Boolean Browser Bstring Bytedata Cards Category CC config Cgi Cgi dialog Char Charsets Cipher Clib_file Color CLI Commands Complex Console Crc32 Deflate DES Dialog Dir Draw Duration Echo Editline Enable_input Enable_io Enable_output Encoding Environment External_file File File system Float Font Forloop Ftp Getf Gethttp Gethttps Graph Graph_file Gzip Hash Hashsetof Hmac Html_ent Httpserv Idxarray Image Inflate Inflate file Inifile Integer Keybd Line Listener LZW Make Math Msgdigest Null_file Osfiles Picture utility Pixmap_file Pixmapfont PKCS #1 Poll Process Progs Propertyfile Rational Reference Ref_list Scanfile Scanstri Set Shell Smtp Sockbase Socket SQL base Stdio Strifile String Stritext Subrange Tar Text Time TLS/SSL Triple DES Unicode Utf16 Utf8 Vectorfont 3D Vector Window Wrinum X.509 Xmldom Xml_ent Zip
Libraries
Scanfile Source Code
 previous   up   next 

Function Summary
void
skipComment (inout file: inFile)
Skips a possibly nested comment from a file.
string
getComment (inout file: inFile)
Reads a possibly nested comment from a file.
void
skipLineComment (inout file: inFile)
Skips a line comment from a file.
string
getLineComment (inout file: inFile)
Reads a line comment from a file.
string
getDigits (inout file: inFile)
Reads a sequence of digits from a file.
string
getInteger (inout file: inFile)
Reads a decimal integer with optional sign from a file.
string
getNumber (inout file: inFile)
Reads a numeric literal from a file.
string
getNonDigits (inout file: inFile)
Reads a sequence of non digits from a file.
string
getQuotedText (inout file: inFile)
Reads a text quoted with " or ' from a file.
void
getEscapeSequence (inout file: inFile, inout string: symbol)
Reads an escape sequence from inFile and appends it to symbol.
string
getCharLiteral (inout file: inFile)
Reads a character literal from a file.
string
getStringLiteral (inout file: inFile)
Read a string literal from a file.
string
getName (inout file: inFile)
Reads an alphanumeric name from a file.
void
skipSpace (inout file: inFile)
Skips space characters from a file.
void
skipSpaceOrTab (inout file: inFile)
Skips space and tab characters from a file.
void
skipWhiteSpace (inout file: inFile)
Skips whitespace characters from a file.
void
skipWhiteSpace (inout file: inFile, in set of char: whiteSpaceChar)
Skips characters from the set whiteSpaceChar from a file.
string
getWhiteSpace (inout file: inFile)
Reads whitespace characters from a file.
string
getWord (inout file: inFile)
Reads a white space delimited word from a file.
void
skipLine (inout file: inFile)
Skips a line from a file.
string
getLine (inout file: inFile)
Reads a line from a file.
string
getSymbolOrComment (inout file: inFile)
Reads a symbol or a comment from a file.
string
getSymbol (inout file: inFile)
Reads a symbol from a file.
string
getSymbolWithHtmlEntities (inout file: inFile)
Reads a symbol, where html entities are allowed, from a file.
string
getHtmlTagSymbolOrComment (inout file: inFile)
Reads a HTML tag, a symbol or a comment from a file.
void
skipXmlComment (inout file: inFile)
Skips a XML comment from a file.
string
getXmlTagOrContent (inout file: inFile)
Reads a XML/HTML tag or the XML/HTML content text from a file.
string
getXmlCharacterReference (inout file: inFile)
Reads a predefined XML entity from a file.
string
getXmlTagHeadOrContent (inout file: inFile)
Reads a XML/HTML tag head or a XML/HTML content from a file.
string
getSymbolInXmlTag (inout file: inFile)
Reads a symbol which can appear inside a XML/HTML tag from a file.
void
skipXmlTag (inout file: inFile)
Skips beyond a XML Tag in a file.
void
skipXmlTag (inout file: inFile, in var string: symbol)
Skips beyond a XML Tag in a file.
void
getNextXmlAttribute (inout file: inFile, inout string: attributeName, inout string: attributeValue)
Reads name and value of an attribute inside a XML tag from file.
string
getHtmlAttributeValue (inout file: inFile)
Reads a HTML tag attribute value from a file.
void
getNextHtmlAttribute (inout file: inFile, inout string: attributeName, inout string: attributeValue)
Reads name and value of an attribute inside a HTML tag from a file.
string
getSimpleSymbol (inout file: inFile)
Reads a simple symbol from a file.

Function Detail

skipComment

const proc: skipComment (inout file: inFile)

Skips a possibly nested comment from a file. The comment starts with (* and ends with *) . When the function is called it is assumed that inFile.bufferChar contains the '*' of the comment start. When the function is left the character after ')' is in inFile.bufferChar.


getComment

const func string: getComment (inout file: inFile)

Reads a possibly nested comment from a file. The comment starts with (* and ends with *) . When the function is called it is assumed that inFile.bufferChar contains the '*' of the comment start. When the function is left the character after ')' is in inFile.bufferChar.

Returns:
the content of the comment, including the introducing (* and the ending *) .

skipLineComment

const proc: skipLineComment (inout file: inFile)

Skips a line comment from a file. A line comment starts with an introducing character (like '#') and ends with the end of the line. When the function is called it is assumed that the introducing character (e.g. '#') is in inFile.bufferChar. When the function is left the line end character ('\n' or EOF) is in inFile.bufferChar.


getLineComment

const func string: getLineComment (inout file: inFile)

Reads a line comment from a file. A line comment starts with an introducing character (like '#') and ends with the end of the line. When the function is called it is assumed that the introducing character (e.g. '#') is in inFile.bufferChar. When the function is left the line end character ('\n' or EOF) is in inFile.bufferChar. A sequence of "\r\n" is interpreted as equal to '\n'.

Returns:
the content of the comment, including the start marker (e.g. '#') but without line end character ('\n', or EOF).

getDigits

const func string: getDigits (inout file: inFile)

Reads a sequence of digits from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the digits.

Returns:
the digit sequence or "" when no digit was found.

getInteger

const func string: getInteger (inout file: inFile)

Reads a decimal integer with optional sign from a file. A decimal integer accepted by getInteger consists of an optional + or - sign followed by a possibly empty sequence of digits. Because of the LL(1) approach, a sign without following digits is accepted. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the integer.

Returns:
the decimal integer string or "" when no integer was found.

getNumber

const func string: getNumber (inout file: inFile)

Reads a numeric literal from a file. When the function is called it is assumed that the introducing digit is in inFile.bufferChar. When the function is left the character after the literal is in inFile.bufferChar.

Returns:
The function returns the numeric literal.

getNonDigits

const func string: getNonDigits (inout file: inFile)

Reads a sequence of non digits from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains a digit or EOF.

Returns:
the non digit sequence or "" when a digit was found.

getQuotedText

const func string: getQuotedText (inout file: inFile)

Reads a text quoted with " or ' from a file. The introducing and the closing character ( " or ' ) of the quoted text must be identical. When the function is called it is assumed that inFile.bufferChar contains the introducing " or ' . When the function is left inFile.bufferChar contains the character after the closing character.

Returns:
the quoted text without introducing or closing characters ( " or ' ).

getEscapeSequence

const proc: getEscapeSequence (inout file: inFile, inout string: symbol)

Reads an escape sequence from inFile and appends it to symbol. The function accepts escape sequences from character and string literals. When the function is called it is assumed that the introducing \ is in inFile.bufferChar. When the function is left the character after the escape sequence is in inFile.bufferChar. The complete escape sequence including the introducing \ is appended to symbol.


getCharLiteral

const func string: getCharLiteral (inout file: inFile)

Reads a character literal from a file. When the function is called it is assumed that the introducing ' is in inFile.bufferChar. When the function is left the character after the closing ' is in inFile.bufferChar.

Returns:
the character literal including the introducing ' and the closing ' .

getStringLiteral

const func string: getStringLiteral (inout file: inFile)

Read a string literal from a file. When the function is called it is assumed that the introducing " is in inFile.bufferChar. When the function is left the character after the closing " is in inFile.bufferChar.

Returns:
the string literal including the introducing " and the closing " .

getName

const func string: getName (inout file: inFile)

Reads an alphanumeric name from a file. A name consists of a letter or underscore followed by letters, digits or underscores. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the name.

Returns:
the name or "" when no letter or underscore was found.

skipSpace

const proc: skipSpace (inout file: inFile)

Skips space characters from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar does not contain a space character.


skipSpaceOrTab

const proc: skipSpaceOrTab (inout file: inFile)

Skips space and tab characters from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the sequence of space and tab characters.


skipWhiteSpace

const proc: skipWhiteSpace (inout file: inFile)

Skips whitespace characters from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the whitespace characters.


skipWhiteSpace

const proc: skipWhiteSpace (inout file: inFile, in set of char: whiteSpaceChar)

Skips characters from the set whiteSpaceChar from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the whitespace characters.


getWhiteSpace

const func string: getWhiteSpace (inout file: inFile)

Reads whitespace characters from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the whitespace characters.

Returns:
the string of whitespace characters or "" when no whitespace character was found.

getWord

const func string: getWord (inout file: inFile)

Reads a white space delimited word from a file. Before reading the word it skips whitespace characters. A word is a sequence of characters which does not contain a whitespace character. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left inFile.bufferChar contains the character after the word.

Returns:
the word or "" when no word was found.

skipLine

const proc: skipLine (inout file: inFile)

Skips a line from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left the line end character ('\n' or EOF) is in inFile.bufferChar. When inFile.bufferChar already contains a line end character ('\n' or EOF) nothing is done.


getLine

const func string: getLine (inout file: inFile)

Reads a line from a file. When the function is called it is assumed that inFile.bufferChar contains the first character to be handled. When the function is left the line end character ('\n' or EOF) is in inFile.bufferChar. A sequence of "\r\n" is interpreted as equal to '\n'. When inFile.bufferChar already contains a line end character ('\n' or EOF) nothing is done and the function returns "" .

Returns:
the line read or "" when inFile.bufferChar contains '\n' or EOF.

getSymbolOrComment

const func string: getSymbolOrComment (inout file: inFile)

Reads a symbol or a comment from a file. Before reading the symbol or comment it skips whitespace characters. A symbol can be a literal (numeric, character or string), a name, a special symbol (sequence of special characters) or a parenthesis. A comment can be a normal comment or a line comment. When the function is called it is assumed that inFile.bufferChar contains a whitespace character or the first character of a symbol or comment. When the function is left the character after the symbol or comment is in inFile.bufferChar.

Returns:
the symbol, comment or "" when EOF was reached.

getSymbol

const func string: getSymbol (inout file: inFile)

Reads a symbol from a file. Before reading the symbol it skips whitespace characters and comments (normal comments and line comments). A symbol can be a literal (numeric, character or string), a name, a special symbol (sequence of special characters) or a parenthesis. When the function is called it is assumed that inFile.bufferChar contains a whitespace character or the first character of a symbol or comment. When the function is left the character after the symbol is in inFile.bufferChar.

Returns:
the symbol or "" when EOF was reached.

getSymbolWithHtmlEntities

const func string: getSymbolWithHtmlEntities (inout file: inFile)

Reads a symbol, where html entities are allowed, from a file. Before reading the symbol it skips whitespace characters and comments (normal comments and line comments). A symbol can be a literal (numeric, character or string), a name, a special symbol (sequence of special characters) or a parenthesis. Html entities in the file are treated as special characters. When the function is called it is assumed that inFile.bufferChar contains a whitespace character or the first character of a symbol or comment. When the function is left the character after the symbol is in inFile.bufferChar.

Returns:
the symbol or "" when EOF was reached.

getHtmlTagSymbolOrComment

const func string: getHtmlTagSymbolOrComment (inout file: inFile)

Reads a HTML tag, a symbol or a comment from a file. Before reading the HTML tag, symbol or comment it skips whitespace characters. A HTML tag starts with < and ends with > . A symbol can be a literal (numeric, character or string), a name, a special symbol (sequence of special characters) or a parenthesis. A comment can be a normal comment or a line comment. Html entities in the file are treated as special characters. When the function is called it is assumed that inFile.bufferChar contains a whitespace character, an introducing < of a HTML tag or the first character of a symbol or a comment. When the function is left the character after the HTML tag, symbol or comment is in inFile.bufferChar.

Returns:
the HTML tag, symbol, comment or "" when EOF was reached.

skipXmlComment

const proc: skipXmlComment (inout file: inFile)

Skips a XML comment from a file. The XML comment starts with <!-- and ends with --> . When the function is called it is assumed that the character in inFile.bufferChar is the last '-' of the introducing <!-- . When the function is left the character after --> is in inFile.bufferChar.


getXmlTagOrContent

const func string: getXmlTagOrContent (inout file: inFile)

Reads a XML/HTML tag or the XML/HTML content text from a file. A XML/HTML tag starts with < and ends with > . The content text starts with everything else and ends just before a < or with EOF. When the function is called it is assumed that inFile.bufferChar contains the introducing < of a XML/HTML tag or the first charater of the content text. When the function is left the character after the XML/HTML tag or the content text is in inFile.bufferChar.

Returns:
the XML/HTML tag, XML/HTML content text or "" when EOF was reached.

getXmlCharacterReference

const func string: getXmlCharacterReference (inout file: inFile)

Reads a predefined XML entity from a file.

Returns:
the predefined XML entity or "" when EOF was reached.

getXmlTagHeadOrContent

const func string: getXmlTagHeadOrContent (inout file: inFile)

Reads a XML/HTML tag head or a XML/HTML content from a file. Before reading a tag head or content it skips whitespace characters and XML comments. A XML/HTML tag head starts with < and ends before a > or a / or a whitespace character or EOF. The content text starts with a non whitespace character and ends just before a < or with EOF. When the function is called inFile.bufferChar contains either a whitespace character, the introducing < of a XML/HTML tag or the first charater of the content text. When the function is left the character after the XML/HTML tag head or the content text is in inFile.bufferChar. When a tag head starts with <-- it is interpreted as XML comment. A XML comment is ignored and getXmlTagHeadOrContent is called recursive.

Returns:
the XML/HTML tag head, XML/HTML content text or "" when EOF was reached.

getSymbolInXmlTag

const func string: getSymbolInXmlTag (inout file: inFile)

Reads a symbol which can appear inside a XML/HTML tag from a file. Before reading the symbol it skips whitespace characters. A symbol inside a XML/HTML tag can be a name, a string literal (quoted with " or ' ), the equals sign (=), the end tag sign (>), the end of empty element tag sign (/) or a special symbol (sequence of characters terminated with the character > or a whitespace character). Special symbols can only appear in HTML tags. When the function is called it is assumed that inFile.bufferChar contains a whitespace character or the first character of a symbol. When the function is left inFile.bufferChar contains the character after the XML/HTML symbol or EOF.

Returns:
the symbol or "" when EOF was reached.

skipXmlTag

const proc: skipXmlTag (inout file: inFile)

Skips beyond a XML Tag in a file. When the function is left the character after '>' is in inFile.bufferChar.


skipXmlTag

const proc: skipXmlTag (inout file: inFile, in var string: symbol)

Skips beyond a XML Tag in a file. The parameter symbol is used to provide the current symbol which possibly can be ">" or "". When the function is left the character after '>' is in inFile.bufferChar.


getNextXmlAttribute

const proc: getNextXmlAttribute (inout file: inFile, inout string: attributeName, inout string: attributeValue)

Reads name and value of an attribute inside a XML tag from file. Attribute name and value are returned in attributeName and attributeValue respectively. Surrounding single or double quotes of the attribute value are omitted. It is a syntax error when an attribute value is not quoted. XML entities in attributeValue are left as is. When no more attributes are present in the XML tag attributeName is set to "". In this case attributeValue contains the end of the XML tag (">" or "/>"). When a syntax error occurs the function skips beyond the end of the XML tag. To indicate the syntax error attributeName is set to "" and attributeValue is set to a symbol shortly before the error (this will never be ">" or "/>").


getHtmlAttributeValue

const func string: getHtmlAttributeValue (inout file: inFile)

Reads a HTML tag attribute value from a file. Before reading the value it skips whitespace characters. A HTML tag attribute value can be quoted with " or ' or it is terminated with the character > or a whitespace character. When the function is called it is assumed that inFile.bufferChar contains a whitespace character or the first character of a value. When the function is left inFile.bufferChar contains the character after the XML/HTML symbol or EOF.

Returns:
the symbol or "" when EOF was reached.

getNextHtmlAttribute

const proc: getNextHtmlAttribute (inout file: inFile, inout string: attributeName, inout string: attributeValue)

Reads name and value of an attribute inside a HTML tag from a file. The variable attributeName is set to "" when no more attributes are present in the HTML tag. When the HTML tag ends with / the function assigns "/" to attributeValue when attributeName is set to "". When the HTML tag does not end with / attributeValue and attributeName are set to "" when no more attributes are present.


getSimpleSymbol

const func string: getSimpleSymbol (inout file: inFile)

Reads a simple symbol from a file. Before reading the simple symbol it skips whitespace characters. A simple symbol can be an integer literal, a name, a special symbol (sequence of special characters) or a parenthesis. Note that string, char and float literals are not recognized as simple symbol.

Returns:
the simple symbol or "" when EOF was reached.


 previous   up   next