Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
C-datadec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Duncan White
C-datadec
Commits
3b7ed377
Commit
3b7ed377
authored
35 years ago
by
dcw
Browse files
Options
Downloads
Patches
Plain Diff
fixed print list and print item stuff.
parent
c21a9cd3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser.c
+14
-13
14 additions, 13 deletions
parser.c
with
14 additions
and
13 deletions
parser.c
+
14
−
13
View file @
3b7ed377
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
* declns = ne-list( decln ) tEOF
* declns = ne-list( decln ) tEOF
* decln = tID tEQ shapes tSEMI
* decln = tID tEQ shapes tSEMI
* shapes = ne-sep-list( shape, tOR )
* 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 )
* params = ne-sep-list( param, tCOMMA )
* param = tID tID
* param = tID tID
* print
item =
tSTR | tNUM
* print
list = list(
tSTR | tNUM
)
*/
*/
...
@@ -108,7 +108,7 @@ static BOOL parse_shapes( sp ) shapelist *sp;
...
@@ -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
;
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
...
@@ -118,19 +118,17 @@ static BOOL parse_shape( tagname, pl, print ) char **tagname; paramlist *pl; pri
MUSTBE
(
tID
,
"shape name"
);
MUSTBE
(
tID
,
"shape name"
);
COPYOF
(
*
tagname
,
lexidval
);
COPYOF
(
*
tagname
,
lexidval
);
if
(
nexttok
()
!=
tOPENBR
)
if
(
nexttok
()
==
tOPENBR
)
{
if
(
!
parse_params
(
pl
)
)
return
FALSE
;
MUSTBE
(
tCLOSEBR
,
"')'"
);
}
else
{
{
ungettok
();
ungettok
();
return
TRUE
;
}
}
if
(
!
parse_params
(
pl
)
)
return
FALSE
;
return
parse_printlist
(
print
);
MUSTBE
(
tCLOSEBR
,
"')'"
);
if
(
!
parse_printlist
(
print
)
)
return
FALSE
;
return
TRUE
;
}
}
...
@@ -174,9 +172,12 @@ static BOOL parse_printlist( pp ) printlist *pp;
...
@@ -174,9 +172,12 @@ static BOOL parse_printlist( pp ) printlist *pp;
static
BOOL
parse_printitem
(
item
)
printitem
*
item
;
static
BOOL
parse_printitem
(
item
)
printitem
*
item
;
{
{
char
*
temp
;
switch
(
nexttok
()
)
{
switch
(
nexttok
()
)
{
case
tSTR
:
case
tSTR
:
*
item
=
build_printitem_str
(
lexidval
);
COPYOF
(
temp
,
lexidval
);
*
item
=
build_printitem_str
(
temp
);
return
TRUE
;
return
TRUE
;
case
tNUM
:
case
tNUM
:
*
item
=
build_printitem_num
(
lexintval
);
*
item
=
build_printitem_num
(
lexintval
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment