Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pybison
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
pybison
Commits
016568a0
Commit
016568a0
authored
Nov 15, 2011
by
Sander Mathijs van Veen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added CFLAGS option and exception on dlsym crash.
parent
a8765c61
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
src/c/bisondynlib-linux.c
src/c/bisondynlib-linux.c
+6
-0
src/pyrex/bison_.pyx
src/pyrex/bison_.pyx
+7
-2
src/python/bison.py
src/python/bison.py
+3
-0
No files found.
src/c/bisondynlib-linux.c
View file @
016568a0
...
@@ -47,6 +47,12 @@ PyObject *bisondynlib_run(void *handle, PyObject *parser, void *cb, void *in, in
...
@@ -47,6 +47,12 @@ PyObject *bisondynlib_run(void *handle, PyObject *parser, void *cb, void *in, in
//printf("bisondynlib_run: looking up parser\n");
//printf("bisondynlib_run: looking up parser\n");
pparser
=
bisondynlib_lookup_parser
(
handle
);
pparser
=
bisondynlib_lookup_parser
(
handle
);
//printf("bisondynlib_run: calling parser, py_input=0x%lx\n", in);
//printf("bisondynlib_run: calling parser, py_input=0x%lx\n", in);
if
(
!
pparser
)
{
PyErr_SetString
(
PyExc_RuntimeError
,
"bisondynlib_lookup_parser() returned NULL"
);
return
NULL
;
}
(
*
pparser
)(
parser
,
cb
,
in
,
debug
);
(
*
pparser
)(
parser
,
cb
,
in
,
debug
);
//printf("bisondynlib_run: back from parser\n");
//printf("bisondynlib_run: back from parser\n");
//return result;
//return result;
...
...
src/pyrex/bison_.pyx
View file @
016568a0
...
@@ -528,7 +528,9 @@ cdef class ParserEngine:
...
@@ -528,7 +528,9 @@ cdef class ParserEngine:
# extra_preargs=['/DWIN32', '/G4', '/Gs', '/Oit', '/MT', '/nologo', '/W3', '/WX', '/Id:\python23\include'])
# extra_preargs=['/DWIN32', '/G4', '/Gs', '/Oit', '/MT', '/nologo', '/W3', '/WX', '/Id:\python23\include'])
# link 'em into a shared lib
# link 'em into a shared lib
objs
=
ccompiler
.
compile
([
parser
.
bisonCFile1
,
parser
.
flexCFile1
])
objs
=
ccompiler
.
compile
([
parser
.
bisonCFile1
,
parser
.
flexCFile1
],
extra_preargs
=
parser
.
cflags_pre
,
extra_postargs
=
parser
.
cflags_post
)
libFileName
=
parser
.
bisonEngineLibName
+
imp
.
get_suffixes
()[
0
][
0
]
libFileName
=
parser
.
bisonEngineLibName
+
imp
.
get_suffixes
()[
0
][
0
]
if
os
.
path
.
isfile
(
libFileName
+
".bak"
):
if
os
.
path
.
isfile
(
libFileName
+
".bak"
):
try
:
try
:
...
@@ -551,7 +553,10 @@ cdef class ParserEngine:
...
@@ -551,7 +553,10 @@ cdef class ParserEngine:
'bisonCFile1'
,
'bisonHFile1'
,
'flexFile'
,
'bisonCFile1'
,
'bisonHFile1'
,
'flexFile'
,
'flexCFile'
,
'flexCFile1'
,
'flexCFile'
,
'flexCFile1'
,
]
+
objs
:
]
+
objs
:
fname
=
getattr
(
parser
,
name
,
None
)
if
hasattr
(
parser
,
name
):
fname
=
getattr
(
parser
,
name
)
else
:
fname
=
None
#print "want to delete %s" % fname
#print "want to delete %s" % fname
if
fname
and
os
.
path
.
isfile
(
fname
):
if
fname
and
os
.
path
.
isfile
(
fname
):
hitlist
.
append
(
fname
)
hitlist
.
append
(
fname
)
...
...
src/python/bison.py
View file @
016568a0
...
@@ -241,6 +241,9 @@ class BisonParser(object):
...
@@ -241,6 +241,9 @@ class BisonParser(object):
flexCFile
=
"lex.yy.c"
flexCFile
=
"lex.yy.c"
flexCFile1
=
"tmp.lex.c"
# c output file from lex gets renamed to this
flexCFile1
=
"tmp.lex.c"
# c output file from lex gets renamed to this
cflags_pre
=
[
'-fPIC'
]
# = CFLAGS added before all arguments.
cflags_post
=
[
'-O3'
,
'-g'
]
# = CFLAGS added after all arguments.
verbose
=
0
verbose
=
0
...
...
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