Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Franck Pommereau
/
cct
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Wiki
Network
Create a new issue
Commits
Authored by
Franck Pommereau
2018-04-20 16:40:10 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1d59a46d3f306f136d1e3cfbba8168d654224503
1d59a46d
1 parent
75ec9cdd
cosmetic changes
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
cctlib/cparse.py
cctlib/cttc.py
cctlib/parsetab.py
cctlib/cparse.py
View file @
1d59a46
...
...
@@ -448,7 +448,6 @@ precedence = (
class
ParseError
(
Exception
):
"Exception raised whenever a parsing error occurs."
pass
def
p_translation_unit_01
(
t
):
...
...
cctlib/cttc.py
View file @
1d59a46
...
...
@@ -178,14 +178,21 @@ class CodeGenVisitor (Visitor) :
"# Franck Pommereau (2018)
\n
"
"# Adapted from Atul Varma's c.py (Spring 2004)
\n
"
)
for
c
in
chunks
:
outfile
.
write
(
"
\n
# code from file
%
r
\n
"
%
c
.
path
)
outfile
.
write
(
c
.
curr_str
.
getvalue
())
s
=
c
.
curr_str
.
getvalue
()
if
s
.
strip
()
:
outfile
.
write
(
"
\n
###
\n
### code from file
%
r
\n
###
\n
"
%
c
.
path
)
outfile
.
write
(
s
)
for
c
in
chunks
:
outfile
.
write
(
"
\n
# globals from file
%
r
\n\n
"
%
c
.
path
)
outfile
.
write
(
c
.
globals_str
.
getvalue
())
s
=
c
.
globals_str
.
getvalue
()
if
s
.
strip
()
:
outfile
.
write
(
"
\n
###
\n
### globals from file
%
r
\n
###
\n\n
"
%
c
.
path
)
outfile
.
write
(
s
)
for
c
in
chunks
:
outfile
.
write
(
"
\n
# string literals from file
%
r
\n\n
"
%
c
.
path
)
outfile
.
write
(
c
.
str_literal_str
.
getvalue
())
s
=
c
.
str_literal_str
.
getvalue
()
if
s
.
strip
()
:
outfile
.
write
(
"
\n
###
\n
### string literals from file
%
r
\n
###
\n\n
"
%
c
.
path
)
outfile
.
write
(
s
)
def
_calc_function_var_addrs
(
self
,
symtab
,
last_fp_loc
):
self
.
_calc_function_arg_addrs
(
symtab
)
...
...
cctlib/parsetab.py
View file @
1d59a46
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment