Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
1f57f40b
Commit
1f57f40b
authored
31 years ago
by
Jan Brittenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
declared yyerror before using it
From-SVN: r5439
parent
da9f42b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
gcc/bi-parser.y
+22
-21
No files found.
gcc/bi-parser.y
View file @
1f57f40b
...
...
@@ -26,20 +26,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
extern char yytext[];
extern int yyleng;
extern char *malloc();
extern char *malloc
();
/* Chain of all defs built by the parser. */
struct def *defs;
int ndefs;
static struct node *makenode();
static struct variation *makevar();
static struct def *makedef();
static struct node *makenode ();
static struct variation *makevar ();
static struct def *makedef ();
void yyerror ();
%}
%union{
%union
{
char *string;
struct def *def;
struct variation *variation;
...
...
@@ -67,7 +70,7 @@ defs:
def:
DEFOP '(' STRING ',' opt_string ',' '(' variations ')' ')'
{ $$ = makedef($3, $5, $8); }
{ $$ = makedef
($3, $5, $8); }
;
variations:
...
...
@@ -80,11 +83,11 @@ variation:
'(' opt_string ')'
{ $$ = makevar($2, (struct node *) NULL, (struct node *) NULL, (struct node *) NULL); }
| '(' opt_string ',' list ')'
{ $$ = makevar($2, $4, (struct node *) NULL, (struct node *) NULL); }
{ $$ = makevar
($2, $4, (struct node *) NULL, (struct node *) NULL); }
| '(' opt_string ',' list ',' list ')'
{ $$ = makevar($2, $4, $6, (struct node *) NULL); }
{ $$ = makevar
($2, $4, $6, (struct node *) NULL); }
| '(' opt_string ',' list ',' list ',' list ')'
{ $$ = makevar($2, $4, $6, $8); }
{ $$ = makevar
($2, $4, $6, $8); }
;
opt_string:
...
...
@@ -108,31 +111,31 @@ items:
item:
STRING
{ $$ = makenode($1); }
{ $$ = makenode
($1); }
;
%%
static struct node *
makenode(s)
makenode
(s)
char *s;
{
struct node *n;
n = (struct node *) malloc(sizeof (struct node));
n = (struct node *) malloc
(sizeof (struct node));
n->text = s;
n->next = NULL;
return n;
}
static struct variation *
makevar(name, inputs, outputs, literals)
makevar
(name, inputs, outputs, literals)
char *name;
struct node *inputs, *outputs, *literals;
{
struct variation *v;
v = (struct variation *) malloc(sizeof (struct variation));
v = (struct variation *) malloc
(sizeof (struct variation));
v->name = name;
v->code = ndefs++;
v->inputs = inputs;
...
...
@@ -143,13 +146,13 @@ makevar(name, inputs, outputs, literals)
}
static struct def *
makedef(name, template, vars)
makedef
(name, template, vars)
char *name, *template;
struct variation *vars;
{
struct def *d;
d = (struct def *) malloc(sizeof (struct def));
d = (struct def *) malloc
(sizeof (struct def));
d->basename = name;
d->template = template;
d->variations = vars;
...
...
@@ -158,11 +161,9 @@ makedef(name, template, vars)
}
void
yyerror(s)
yyerror
(s)
char *s;
{
extern int yylineno;
fprintf(stderr, "syntax error in line %d\n", yylineno);
exit(1);
fprintf (stderr, "syntax error in input");
exit (1);
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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