.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

Name Description
 scanReal Scan a signed real number
 scanInteger Scan signed integer number
 scanString Scan string
 scanIdentifier Scan simple identifiers
 skipWhiteSpace Scan white space
 skipLineComments Scan comments and white space

Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f