"a-zA-Z_"
{
0=c;
while +c in ["a-zA-Z0-9_"] do 0+c;
>_ident>0
}
#1..#32
{ while +c in [#1..#32] do ;}
inline parser_real_e
if (c = 'E') or (c = 'e') then
0+c;
if (+c <> '+') and (not (c in ["0-9"])) then
>(error)syntax_error_in_real_number!
}
0+c;
while +c in ["0-9"] do 0+c;
>_real_num>(float)0!
}
end
"0-9"
{
0=c;
while +c in ["0-9"] do 0+c;
if (c = '.') then
if (+c = '.') then
>num>(int)0-!
}
0+c;
while +c in ["0-9"] do 0+c;
<parser_real_e
>_real_num>(float)0!
}
<parser_real_e
>_num>(int)0!
}
'$'
{
0=c;
while +c in ["0-9A-Fa-f"] do 0+c;
>_hex_num>(int)0!
}
'{'
{
if +c = '$' then
>_open_brace_dollar+!
}
while c <> '}' do +c;
+c;
}
'/'
{
if +c = '/' then
while (c <> #13) and (c <> #10) do +c;
^
}else{
>_whack!
}
}
inline after_char(@char, @push, @sec_char, @sec_push)
@char
{
if +c = @sec_char then
>@sec_push+!
}
>@push!
}
end
<after_char("'*'", '_star', "')'", '_star_close_parenthesis')
<after_char("':'", '_colon', "'='", '_colon_equals')
<after_char("'<'", '_less', "'='", '_less_equals')
<after_char("'>'", '_greater', "'='", '_greater_equals')
<after_char("'.'", '_dot', "'.'", '_double_dot')
'}':{>_close_brace+!}
'+':{>_plus+!}
'-':{>_minus+!}
'@':{>_at+!}
';':{>_semicolon+!}
',':{>_comma+!}
'[':{>_open_bracket+!}
']':{>_close_bracket+!}
'=':{>_equals+!}
')':{>_close_parenthesis+!}
'^':{>_caret+!}
#0:{>_eof!} inline parse_sharp
1nil;
if +c = '$' then
1+c;
if +c in ["0-9a-fA-F"] then
1+c;
}else{
>(error)constant_expression_expected>(char)!
}
while +c in ["0-9a-fA-F"] do 1+c;
if |1 > 3 then
0+'?';
}else{
0+chr(int(1s));
}
}else{
if c in ["0-9"] then
1+c;
}else{
>(error)constant_expression_expected>(char)!
}
while +c in ["0-9"] do 1+c;
if |1 > 4 then
0+'?';
}else{
0i = int(1s);
if 0i > $FF then
0+'?';
}else{
0+chr(0i);
}
}
}
end
"'#"
{
0nil;
repeat
if c = "'" then
while (+c <> "'") and (not (c in [#13, #10])) do 0+c;
if c in [#13, #10] then
>(error)unterminated_string!
}
+c;
}
case c of
'#': <parse_sharp
"'": {
0+"'";
^
}
}
until (c <> "'") and (c <> '#');
>(str)0!
}
'('
{
if +c = '*' then
if +c = '$' then
>_open_parenthesis_star_dollar+!
}
repeat
while c <> '*' do +c;
until +c = ')';
+c;
}else{
>_open_parenthesis!
}
}
else
{
>(error)unknown_char>(char)+!
}