static char sccsid
[] = "@(#)scanner.c 3.7 %G%";
if (cx
.x_bol
&& c
!= EOF
) {
return *cx
.x_bufp
++ & 0xff;
return ungetc(c
, cx
.x_fp
);
if (cx
.x_bufp
> cx
.x_buf
)
case 'a': case 'b': case 'c': case 'd': case 'e':
case 'f': case 'g': case 'h': case 'i': case 'j':
case 'k': case 'l': case 'm': case 'n': case 'o':
case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y':
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
case 'K': case 'L': case 'M': case 'N': case 'O':
case 'P': case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X': case 'Y':
switch (c
= s_gettok1()) {
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
cx
.x_val
.v_num
= c
- '0';
if (c
== '\n' || c
== EOF
) {
case 2: /* unquoted string */
case 'a': case 'b': case 'c': case 'd': case 'e':
case 'f': case 'g': case 'h': case 'i': case 'j':
case 'k': case 'l': case 'm': case 'n': case 'o':
case 'p': case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x': case 'y':
case 'A': case 'B': case 'C': case 'D': case 'E':
case 'F': case 'G': case 'H': case 'I': case 'J':
case 'K': case 'L': case 'M': case 'N': case 'O':
case 'P': case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X': case 'Y':
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
if (p
< buf
+ sizeof buf
- 1)
switch (c
= s_gettok1()) {
if (p
< buf
+ sizeof buf
- 1)
if (buf
[1] == 'f' && buf
[2] == 0)
if (buf
[1] == 'h' && buf
[2] == 'e'
&& buf
[3] == 'n' && buf
[4] == 0)
if (buf
[1] == 'n' && buf
[2] == 'd'
&& buf
[3] == 'i' && buf
[4] == 'f'
else if (buf
[1] == 'l' && buf
[2] == 's')
if (buf
[3] == 'i' && buf
[4] == 'f'
else if (buf
[3] == 'e' && buf
[4] == 0)
&& (cx
.x_val
.v_str
= str_cpy(buf
)) == 0) {
case 3: /* " quoted string */
switch (c
= s_gettok1()) {
case -2: /* newlines are invisible */
if (p
< buf
+ sizeof buf
- 1)
if (p
< buf
+ sizeof buf
- 1)
case 4: /* ' quoted string */
switch (c
= s_gettok1()) {
case -2: /* newlines are invisible */
if (p
< buf
+ sizeof buf
- 1)
if (p
< buf
+ sizeof buf
- 1)
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
cx
.x_val
.v_num
= c
- '0';
cx
.x_val
.v_num
= c
- '0';
case 11: /* decimal number */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
cx
.x_val
.v_num
= cx
.x_val
.v_num
* 10 + c
- '0';
case 12: /* hex number */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
cx
.x_val
.v_num
= cx
.x_val
.v_num
* 16 + c
- '0';
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
cx
.x_val
.v_num
= cx
.x_val
.v_num
* 16 + c
- 'a' + 10;
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
cx
.x_val
.v_num
= cx
.x_val
.v_num
* 16 + c
- 'A' + 10;
case 13: /* octal number */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
cx
.x_val
.v_num
= cx
.x_val
.v_num
* 8 + c
- '0';
c
= s_getc(); /* got \ */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
c
= s_getc(); /* got \[0-7] */
if (c
< '0' || c
> '7') {
c
= s_getc(); /* got \[0-7][0-7] */
if (c
< '0' || c
> '7') {