Git Product home page Git Product logo

Comments (7)

inducer avatar inducer commented on August 16, 2024 1
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.

inducer avatar inducer commented on August 16, 2024 1

Thanks, closing.

from pycparserext.

inducer avatar inducer commented on August 16, 2024

I can't reproduce your issue. Also, the tests get run weekly against current versions of ply and pycparserext.

from pycparserext.

githubg0 avatar githubg0 commented on August 16, 2024

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.

inducer avatar inducer commented on August 16, 2024

An error like

pycparser.ply.yacc.YaccError: Unable to build parser

occurs before any actual source code gets looked at.

from pycparserext.

belyak avatar belyak commented on August 16, 2024

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.

belyak avatar belyak commented on August 16, 2024
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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.