Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Duncan White
C-datadec
Commits
3b7ed377
Commit
3b7ed377
authored
Nov 24, 1989
by
dcw
Browse files
fixed print list and print item stuff.
parent
c21a9cd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
parser.c
View file @
3b7ed377
...
...
@@ -13,10 +13,10 @@
* declns = ne-list( decln ) tEOF
* decln = tID tEQ shapes tSEMI
* shapes = ne-sep-list( shape, tOR )
*
shape = tID [ tOPENBR params tCLOSEBR ]
[ list( printitem ) ]
*
shape = tID [ tOPENBR params tCLOSEBR ]
printlist
* params = ne-sep-list( param, tCOMMA )
* param = tID tID
* print
item =
tSTR | tNUM
* print
list = list(
tSTR | tNUM
)
*/
...
...
@@ -108,7 +108,7 @@ static BOOL parse_shapes( sp ) shapelist *sp;
}
/* shape = tID [ tOPENBR params tCLOSEBR ]
[
printlist
]
*/
/* shape = tID [ tOPENBR params tCLOSEBR ] printlist */
static
BOOL
parse_shape
(
tagname
,
pl
,
print
)
char
**
tagname
;
paramlist
*
pl
;
printlist
*
print
;
{
...
...
@@ -118,19 +118,17 @@ static BOOL parse_shape( tagname, pl, print ) char **tagname; paramlist *pl; pri
MUSTBE
(
tID
,
"shape name"
);
COPYOF
(
*
tagname
,
lexidval
);
if
(
nexttok
()
!=
tOPENBR
)
if
(
nexttok
()
==
tOPENBR
)
{
if
(
!
parse_params
(
pl
)
)
return
FALSE
;
MUSTBE
(
tCLOSEBR
,
"')'"
);
}
else
{
ungettok
();
return
TRUE
;
}
if
(
!
parse_params
(
pl
)
)
return
FALSE
;
MUSTBE
(
tCLOSEBR
,
"')'"
);
if
(
!
parse_printlist
(
print
)
)
return
FALSE
;
return
TRUE
;
return
parse_printlist
(
print
);
}
...
...
@@ -174,9 +172,12 @@ static BOOL parse_printlist( pp ) printlist *pp;
static
BOOL
parse_printitem
(
item
)
printitem
*
item
;
{
char
*
temp
;
switch
(
nexttok
()
)
{
case
tSTR
:
*
item
=
build_printitem_str
(
lexidval
);
COPYOF
(
temp
,
lexidval
);
*
item
=
build_printitem_str
(
temp
);
return
TRUE
;
case
tNUM
:
*
item
=
build_printitem_num
(
lexintval
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment