Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
SAIL (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===String scanner=== In addition to basic string functionality, SAIL included a string scanner system as part of the basic language. {{code|SCAN}} worked on string variables, while the otherwise similar {{code|INPUT}} was used to scan strings being read from a file. Both used a system known as a "break table" which consisted of a set of characters that represented places to stop reading, examples include linefeeds, various whitespace, and punctuation. These tables were stored in special structures, and the system allowed only 54 of these, a number that is not explained in the documentation.{{sfn|Smith|1976|p=27}} To build a new table, one first called {{code|GETBREAK}} which returned the next free slot in the table, or "table number". This would be followed by a {{code|SETBREAK}}, which took the table number, a string with the break characters, another string of "omit characters" which were simply ignored during reading (as if they were not in the string) and finally the "modes", flags that indicated how the system should work. Once set, the program could then repeatedly call {{code|SCAN}} or {{code|INPUT}} and be returned complete strings.{{sfn|Smith|1976|p=28}} This included a reference parameter, normally brkchar, that contained the character that caused the break, allowing one to test, for instance, for end-of-file characters. The system is conceptually similar to C's {{code|strtok}} functionality, which is part of [[stdlib]]<ref>{{cite web |url=https://www.geeksforgeeks.org/strtok-strtok_r-functions-c-examples/ |title=strtok() and strtok_r() functions in C with examples}}</ref> as opposed to being part of the language itself as in SAIL.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)