functionscanIdentifier

Scan for the next Identifier and trigger an assert if not present

Extends from Modelica.Icons.Function (Icon for functions).

Information

Syntax

             identifier = Strings.scanIdentifier(string);
(identifier, nextIndex) = Strings.scanIdentifier(string, startIndex=1, message="");

Description

Function scanIdentifier scans the string starting at index "startIndex", checks whether the next token is an Identifier and returns its value as a string, as well as the index directly after the Identifier. An assert is triggered, if the scanned string does not contain an Identifier with optional leading white space.

Inputs

TypeNameDefaultDescription
StringstringString to be scanned
IntegerstartIndex1Start scanning of identifier at character startIndex
Stringmessage""Message used in error message if scan is not successful

Outputs

TypeNameDefaultDescription
StringidentifierValue of Identifier
IntegernextIndexIndex of character after the found identifier