Token ::= regular expression
sascangen will then generate to stdout a sather class which when given an
a character iterator which conforms to $ELT{CHAR} will have an iterator
scan!:INT
which iterates over the tokens scanned from the
$ELT{CHAR}. SCANNER has several user accessable members.
token:FSTR
the text contained within the current tokenline_number:INT
the current line numberchar_number:INT
the current char number within the current linecreate(elt:$ELT{CHAR}):SAME
is the basic constructortoken_to_str(t:INT):STR
will convert a token to its string
representation. this is mainly useful for debugging.scan!:INT
the main scanner iteratorIgnore
' will be ignored in the resultant scanner and not returned
to the application. this may be used for whitespace and comments.
Error
' will be returned for any text that does not match one of
the given regular expressions.
CharClass ::= '[' (('\\' _)|[^\]\n\r\\])+ ']' String ::= "'" ( '\\' _ | [^\n\\\r'])+ "'" String ::= '"' ( '\\' _ | [^\n\\\r"])+ '"' Ignore ::= "--" [^\n] * Ignore ::= [ \n]+ Semicolon ::= ';' LParen ::= '(' RParen ::= ')' Star ::= '*' Plus ::= '+' Option ::= '?' Equals ::= "::=" UnderScore ::= '_' Ident ::= [A-Za-z_]+ Pipe ::= '|'
Copyright (c) 1999 John Meacham Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The originator of this code may not be misrepresented, any derivative works must be clearly marked as such. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.