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
660b43c8
Commit
660b43c8
authored
May 06, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rewrite attribute parsing; update the expected conflicts and state
numbers. From-SVN: r7252
parent
bad1b4ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
66 deletions
+60
-66
gcc/c-parse.in
+60
-66
No files found.
gcc/c-parse.in
View file @
660b43c8
...
@@ -27,22 +27,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
...
@@ -27,22 +27,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
written by AT&T, but I have never seen it. */
written by AT&T, but I have never seen it. */
ifobjc
ifobjc
%
expect
2
0
%
expect
2
2
end
ifobjc
end
ifobjc
ifc
ifc
%
expect
8
%
expect
10
/* These are the
8
conflicts you should get in parse.output;
/* These are the
10
conflicts you should get in parse.output;
the state numbers may vary if minor changes in the grammar are made.
the state numbers may vary if minor changes in the grammar are made.
State 41 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 41 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 92 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 97 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 99 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 104 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 103 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 108 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 119 contains 1 shift/reduce conflict. (See comment at component_decl.)
State 124 contains 1 shift/reduce conflict. (See comment at component_decl.)
State 183 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 191 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 193 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 204 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 199 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 210 contains 1 shift/reduce conflict. (Two ways to recover from error.)
State 449 contains 2 shift/reduce conflicts. (Four ways to parse this.)
*/
*/
end
ifc
end
ifc
...
@@ -178,7 +179,8 @@ void yyerror ();
...
@@ -178,7 +179,8 @@ void yyerror ();
%
type
<
ttype
>
initdecls
notype_initdecls
initdcl
notype_initdcl
%
type
<
ttype
>
initdecls
notype_initdecls
initdcl
notype_initdcl
%
type
<
ttype
>
init
maybeasm
%
type
<
ttype
>
init
maybeasm
%
type
<
ttype
>
asm_operands
nonnull_asm_operands
asm_operand
asm_clobbers
%
type
<
ttype
>
asm_operands
nonnull_asm_operands
asm_operand
asm_clobbers
%
type
<
ttype
>
maybe_attribute
attribute_list
attrib
%
type
<
ttype
>
maybe_attribute
attributes
attribute
attribute_list
attrib
%
type
<
ttype
>
any_word
%
type
<
ttype
>
compstmt
%
type
<
ttype
>
compstmt
...
@@ -1048,63 +1050,55 @@ notype_initdcl:
...
@@ -1048,63 +1050,55 @@ notype_initdcl:
/* the * rules are dummies to accept the Apollo extended syntax
/* the * rules are dummies to accept the Apollo extended syntax
so that the header files compile. */
so that the header files compile. */
maybe_attribute
:
maybe_attribute
:
/* empty */
{
$$
=
NULL_TREE
;
}
|
attributes
{
$$
=
$
1
;
}
;
attributes
:
attribute
{
$$
=
$
1
;
}
|
attributes
attribute
{
$$
=
chainon
(
$
1
,
$
2
);
}
;
attribute
:
ATTRIBUTE
'('
'('
attribute_list
')'
')'
{
$$
=
$
4
;
}
;
attribute_list
:
attrib
{
$$
=
build_tree_list
(
NULL_TREE
,
$
1
);
}
|
attribute_list
','
attrib
{
$$
=
chainon
(
$
1
,
build_tree_list
(
NULL_TREE
,
$
3
));
}
;
attrib
:
/* empty */
/* empty */
{
$$
=
NULL_TREE
;
}
{
$$
=
NULL_TREE
;
}
|
maybe_attribute
ATTRIBUTE
'('
'('
attribute_list
')'
')'
|
any_word
{
$$
=
chainon
(
$
5
,
$
1
);
}
{
$$
=
$
1
;
}
;
|
any_word
'('
IDENTIFIER
')'
{
$$
=
tree_cons
(
$
1
,
NULL_TREE
,
attribute_list
build_tree_list
(
NULL_TREE
,
$
3
));
}
:
attrib
|
any_word
'('
IDENTIFIER
','
nonnull_exprlist
')'
{
$$
=
tree_cons
(
NULL_TREE
,
$
1
,
NULL_TREE
);
}
{
$$
=
tree_cons
(
$
1
,
NULL_TREE
,
|
attribute_list
','
attrib
tree_cons
(
NULL_TREE
,
$
3
,
$
5
));
}
{
$$
=
tree_cons
(
NULL_TREE
,
$
3
,
$
1
);
}
|
any_word
'('
nonnull_exprlist
')'
;
{
$$
=
tree_cons
(
$
1
,
NULL_TREE
,
$
3
);
}
;
attrib
:
identifier
/* This still leaves out most reserved keywords,
{
if
(
strcmp
(
IDENTIFIER_POINTER
(
$
1
),
"packed"
)
shouldn't we include them? */
&&
strcmp
(
IDENTIFIER_POINTER
(
$
1
),
"noreturn"
))
warning
(
"`%s' attribute directive ignored"
,
any_word
:
IDENTIFIER_POINTER
(
$
1
));
identifier
$$
=
$
1
;
}
|
SCSPEC
|
TYPE_QUAL
|
TYPESPEC
|
identifier
'('
expr_no_commas
')'
|
TYPE_QUAL
{
/* If not aligned(n) or section(name), then issue warning */
;
if
(
strcmp
(
IDENTIFIER_POINTER
(
$
1
),
"section"
)
==
0
||
strcmp
(
IDENTIFIER_POINTER
(
$
1
),
"mode"
)
==
0
)
{
if
(
TREE_CODE
(
$
3
)
!=
STRING_CST
)
{
error
(
"invalid argument in `%s' attribute"
,
IDENTIFIER_POINTER
(
$
1
));
$$
=
$
1
;
}
$$
=
tree_cons
(
$
1
,
$
3
,
NULL_TREE
);
}
else
if
(
strcmp
(
IDENTIFIER_POINTER
(
$
1
),
"aligned"
)
!=
0
)
{
warning
(
"`%s' attribute directive ignored"
,
IDENTIFIER_POINTER
(
$
1
));
$$
=
$
1
;
}
else
$$
=
tree_cons
(
$
1
,
$
3
,
NULL_TREE
);
}
|
identifier
'('
IDENTIFIER
','
expr_no_commas
','
expr_no_commas
')'
{
/* if not "format(...)", then issue warning */
if
(
strcmp
(
IDENTIFIER_POINTER
(
$
1
),
"format"
)
!=
0
)
{
warning
(
"`%s' attribute directive ignored"
,
IDENTIFIER_POINTER
(
$
1
));
$$
=
$
1
;
}
else
$$
=
tree_cons
(
$
1
,
tree_cons
(
$
3
,
tree_cons
(
$
5
,
$
7
,
NULL_TREE
),
NULL_TREE
),
NULL_TREE
);
}
;
/* Initializers. `init' is the entry point. */
/* Initializers. `init' is the entry point. */
...
...
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