.Modelica.Utilities.Strings.Advanced

Information

Library content

Package Strings.Advanced contains basic scanning functions. These functions should be not called directly, because it is much simpler to utilize the higher level functions "Strings.scanXXX". The functions of the "Strings.Advanced" library provide the basic interface in order to implement the higher level functions in package "Strings".

Library "Advanced" provides the following functions:

(nextIndex, realNumber)    = scanReal        (string, startIndex, unsigned=false);
(nextIndex, integerNumber) = scanInteger     (string, startIndex, unsigned=false);
(nextIndex, string2)       = scanString      (string, startIndex);
(nextIndex, identifier)    = scanIdentifier  (string, startIndex);
 nextIndex                 = skipWhiteSpace  (string, startIndex);
 nextIndex                 = skipLineComments(string, startIndex);

All functions perform the following actions:

  1. Scanning starts at character position "startIndex" of "string" (startIndex has a default of 1).
  2. First, white space is skipped, such as blanks (" "), tabs ("\t"), or newline ("\n")
  3. Afterwards, the required token is scanned.
  4. If successful, on return nextIndex = index of character directly after the found token and the token value is returned as second output argument.
    If not successful, on return nextIndex = startIndex.

The following additional rules apply for the scanning:

Contents

NameDescription
 scanRealScan a signed real number
 scanIntegerScan signed integer number
 scanStringScan string
 scanIdentifierScan simple identifiers
 skipWhiteSpaceScan white space
 skipLineCommentsScan comments and white space

Generated at 2024-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos