Full Library / Math Operator / Parser / Parse_String
Block Name: Parse_String
Code File Location: VisualSim/actor/lib/Parse_String
Block Overview
- This actor parses an incoming string at the 'string_in' port into Java String Tokens. Spaces are used to delineate the Java String Tokens.
- The Use Model is primarily bring in an incoming string, that can then be used with other blocks to create an internal 'Model_List' or 'Model_List_DS' that can be executed very fast in a simulation. The 'Parse_File' Block is similar to 'Parse_String' except it opens a file. One most likely will need to use a 'File_to_String' block to obtain the text file.
- When Parse_String receives an input in the string_in port, it converst the string into a Java String Token. When the parse_string port is activated, the string is parsed to match the list of keywords provided in the keyword parameter field. When a keyword is matched, the keyword followed by the string tokens are placed on the string_output. The keyword is sent to both the keyword port and string port, when matched. An End_Of_File marker is generated on the End-of-File output port once the entire file has been parsed. A trigger is required in the parse_file input for the next string_token to be matched and placed on the output ports
- The trigger can be any value. The strings in the file must be separated by space to indicate the next string.
string_in
public TypedIOPort string_in
- Input port with the string to be parsed. The type is general.
parse_string
public TypedIOPort parse_string
- Input port and is a trigger to parse the next Java String Token. The type is general.
string_output
public TypedIOPort string_output
- String Token output port, for each Java String Token. The type is string.
keyword_output
public TypedIOPort keyword_output
- Keyword output port, for each Java String Token that matches comma separated list of keywords, sends to this port. The type is string.
end_of_string
public TypedIOPort end_of_string
- EOF Output port, StringToken indicating end of file, which can be used to activate other blocks in the model. The type is string.
Keywords
public Parameter Keywords
- Parameter, Keywords, comma separated list of keywords. The type is string.
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation