Comments (7)
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pycparserext.ext_c_parser import GnuCParser
>>> parser = GnuCParser()
>>> import pycparser
>>> pycparser.__version__
'2.19'
>>>
2.19 is current AFAICT. I guess you're installing for the package index, which is ancient (2016-ish). I've just uploaded a new release. Let me know if that works for you.
from pycparserext.
Thanks, closing.
from pycparserext.
I can't reproduce your issue. Also, the tests get run weekly against current versions of ply and pycparserext.
from pycparserext.
the '880.cpp' as follow:
int main()
{
int N;
cin>>N;
int i,b=0,count=1,sum=0;
int *p=new int[N];
for(i=0;i<N;i++)
cin>>p[i];
for(i=0;i<N;i++)
{
if(b<0)
{b=p[i];count=1;}
else
{
b+=p[i];count++;
}
if(b>sum&&count>1)
sum=b;
}
if(sum>0)
cout<<sum<<endl;
else
cout<<"Game Over"<<endl;
}
from pycparserext.
An error like
pycparser.ply.yacc.YaccError: Unable to build parser
occurs before any actual source code gets looked at.
from pycparserext.
I have the same problem. How to reproduce:
python3.6 -m venv venv
source venv/bin/activate
pip install pycparserext
then run python3
and try to create parser:
(venv) andy@andy-ThinkPad-E490:~$ python3
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pycparserext.ext_c_parser import GnuCParser
>>> parser = GnuCParser()
ERROR: /home/andy/venv/lib/python3.6/site-packages/pycparser/c_parser.py:683: Symbol 'id_init_declarator_list_opt' used, but not defined as a token or a rule
ERROR: /home/andy/venv/lib/python3.6/site-packages/pycparser/c_parser.py:762: Symbol 'declaration_specifiers_no_type_opt' used, but not defined as a token or a rule
ERROR: /home/andy/venv/lib/python3.6/site-packages/pycparser/c_parser.py:767: Symbol 'declaration_specifiers_no_type_opt' used, but not defined as a token or a rule
ERROR: /home/andy/venv/lib/python3.6/site-packages/pycparser/c_parser.py:772: Symbol 'declaration_specifiers_no_type_opt' used, but not defined as a token or a rule
WARNING: /home/andy/venv/lib/python3.6/site-packages/pycparser/plyparser.py:43: Rule 'declaration_specifiers_opt' defined, but not used
WARNING: /home/andy/venv/lib/python3.6/site-packages/pycparser/plyparser.py:43: Rule 'specifier_qualifier_list_opt' defined, but not used
WARNING: There are 2 unused rules
WARNING: Symbol 'declaration_specifiers_opt' is unreachable
WARNING: Symbol 'specifier_qualifier_list_opt' is unreachable
WARNING: Symbol 'id_init_declarator_list' is unreachable
WARNING: Symbol 'id_init_declarator' is unreachable
ERROR: Infinite recursion detected for symbol 'direct_declarator'
ERROR: Infinite recursion detected for symbol 'declaration_specifiers_no_type'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/andy/venv/lib/python3.6/site-packages/pycparserext/ext_c_parser.py", line 47, in __init__
debug=yacc_debug, write_tables=False)
File "/home/andy/venv/lib/python3.6/site-packages/pycparser/ply/yacc.py", line 3426, in yacc
raise YaccError('Unable to build parser')
pycparser.ply.yacc.YaccError: Unable to build parser
from pycparserext.
Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pycparserext.ext_c_parser import GnuCParser >>> parser = GnuCParser() >>> import pycparser >>> pycparser.__version__ '2.19' >>>
2.19 is current AFAICT. I guess you're installing for the package index, which is ancient (2016-ish). I've just uploaded a new release. Let me know if that works for you.
Now it works (version was 2016.2 yesterday, now it is 2019.1).
Thank you!
from pycparserext.
Related Issues (20)
- Symbol 'id_init_declarator_list_opt' used, but not defined as a token or a rule HOT 3
- Support for register type xxx __asm__(yyy) HOT 4
- error while importing from pycparser.plyparser import parameterized HOT 3
- Double pointers badly handled HOT 10
- Add an open source license to this repository HOT 1
- Coord.line is always set to 0 for Asm nodes HOT 1
- struct in a struct with __attribute__((packed)) HOT 1
- installation error pycparserext HOT 5
- Cannot traverse nodes using NodeVisitor, FuncDeclExt is not iterable HOT 4
- TypeError: _generate_type() got an unexpected keyword argument 'emit_declname' HOT 2
- Parsing of Basic Blocks HOT 1
- test/test_pycparserext.py L244 test_array_attributes lost array dimension HOT 4
- Check the parsed AST in the tests HOT 1
- Support for case ranges HOT 2
- Next release roadmap HOT 2
- stddef.h include issue HOT 2
- NotImplementedError: cannot attach asm or attributes to nodes of type '<class 'pycparser.c_ast.PtrDecl'>'
- Support complex __attribute__ involving __alignof__ HOT 6
- Support __attribute__ within struct declaration HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycparserext.