White space is defined as one or more of any of the characters assigned to the delimiter variable, as described in “Customizing the delimiter” on page 67. By default, the space and tab characters are assigned to the delimiter variable. That means any number of contiguous space or tab characters constitute white space in the data.
A pattern is made up of one or more pattern elements. There are many types of pattern elements. For example, keywords such as “word”, and “integer” are elements. An element can be a literal string (text surrounded by quotes). By default, ASL will ignore any white space in the data as it tries to match pattern elements. You can use the dot operator to keep ASL from ignoring white space in a pattern match, as described in “Dot operator” on page 48.
When a literal pattern element contains whitespace, ASL does not ignore it.
For example, if the pattern to match is:
"John" "Doe" integer “st” “Street”
Then ASL will match the following data equally.
John Doe 121st street JohnDoe121stStreet John Doe 121 st Street
The following script matches a word followed by an integer and another word. The dot operator is not used, so the delimiters between the words in the data are automatically skipped (if they exist). The end-of-line (eol) for each line of data is not matched, which causes the START rule to fail. Notice that the second line of input matches even though there is no delimiter between the number, 42343, and the title, Manager.
ASL Script (wspace_match.asl): START { a:{word integer word} } do { print("Matched with ".a"); } DEFAULT { ..eol } do { print("Failed match"); } Input (wspace_match.txt): Tony 25234 Employee John 42343Manager Output: $ sm_adapter --file=wspace_match.txt wspace_match.asl Matched with Tony 25234 Employee Failed match Matched with John 42343Manager Failed match