Full Library / Math Operator / Parser / Parse_Keyword
Block Name: Parse_Keyword
Code File Location: VisualSim/actor/lib/Parse_keyword
Block Overview
- This block converts an input string token, to one of the three outputs, based on the parameter keywords, and incoming keyword. If a keyword arrives, then all subsequent StringTokens will be sent to the same keyword output. The keyword will not be sent out of the block and acts as switch for incoming StringTokens. No output is generated till the first keyword arrives.
- The Use Model is to detect sub-sequences from the 'Parse_File' or 'Parse_String' Blocks and to redirect seqences of Data Structures from a single file, or StringToken, into Model_List or Model_List_DS Blocks.
- For example a file containing the following would be parsed as in the parathenses:
Header text .... ; name1 type1 value1 (';' is keyword 1, values directed to 'keyword_1_out') : name2 type2 value2 (':' is keyword 2, values directed to 'keyword_2_out') ; name3 type3 value3 (';' is keyword 1, again, values directed to 'keyword_1_out')
string_in
public TypedIOPort string_in
- Input port, for String Token to be directed by keyword currently active. The type is string.
keyword_in
public TypedIOPort keyword_in
- Input port, for keyword. The type is general.
keyword_1_out
public TypedIOPort keyword_1_out
- Output port for the string token following a input keyword that matches the Keyword_1. The type is string.
keyword_2_out
public TypedIOPort keyword_2_out
- Output port for the string token following a input keyword that matches the Keyword_2. The type is string.
keyword_3_out
public TypedIOPort keyword_3_out
- Output port for the string token following a input keyword that matches the Keyword_3. The type is string.
Keyword_1
public Parameter Keyword_1
Keyword_2
public Parameter Keyword_2
Keyword_3
public Parameter Keyword_3
Created with the Personal Edition of HelpNDoc: Free help authoring environment