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
4627dc07
Commit
4627dc07
authored
Dec 29, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(yylex, parse_c_expression, main): Likewise.
From-SVN: r10904
parent
b71c5c9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
gcc/cexp.y
+6
-6
No files found.
gcc/cexp.y
View file @
4627dc07
...
...
@@ -525,13 +525,12 @@ yylex ()
}
switch (c) {
case
0
:
case
'\n'
:
return 0;
case ' ':
case '\t':
case '\r':
case '\n':
lexptr++;
goto retry;
...
...
@@ -927,6 +926,8 @@ right_shift (a, b)
/* Parse STRING as an expression, and complain if this fails
to use up all of the contents of STRING. */
/* STRING may contain '\0' bytes; it is terminated by the first '\n'
outside a string constant, so that we can diagnose '\0' properly. */
/* We do not support C comments. They should be removed before
this function is called. */
...
...
@@ -950,7 +951,7 @@ parse_c_expression (string)
if (yyparse ())
return 0; /* actually this is never reached
the way things stand. */
if (*lexptr)
if (*lexptr
!= '\n'
)
error ("Junk after end of expression.");
return expression_value; /* set by yyparse () */
...
...
@@ -974,11 +975,10 @@ main ()
for (;;) {
printf ("enter expression: ");
n = 0;
while ((buf[n] =
getchar ()) != '\n' && buf[n]
!= EOF)
while ((buf[n] =
c = getchar ()) != '\n' && c
!= EOF)
n++;
if (
buf[n]
== EOF)
if (
c
== EOF)
break;
buf[n] = '\0';
printf ("parser returned %ld\n", parse_c_expression (buf));
}
...
...
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