Giter Site home page Giter Site logo

Building error about deckard HOT 2 OPEN

skyhover avatar skyhover commented on September 27, 2024
Building error

from deckard.

Comments (2)

mertkilicaslan avatar mertkilicaslan commented on September 27, 2024

Seems you have syntax error in the YaccParser.py file written in Python 2 syntax. In that case, you may need to update the Python scripts in the Deckard project to be compatible with Python 3, as they all seem to be written in Python 2 syntax. To do this, you can use the 2to3 tool that comes with Python 3 installations.

from deckard.

AnYiFan117 avatar AnYiFan117 commented on September 27, 2024

Seems you have syntax error in the YaccParser.py file written in Python 2 syntax. In that case, you may need to update the Python scripts in the Deckard project to be compatible with Python 3, as they all seem to be written in Python 2 syntax. To do this, you can use the 2to3 tool that comes with Python 3 installations.

thanks!
I tried 2to3.py but it still has an error:
rm -f .pyc
make -C simple clean
make[1]: Entering directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/simple'
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc c_ptgen
make[1]: Leaving directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/simple'
make -C gcc clean
make[1]: Entering directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/gcc'
rm -f .o lex.yy.cc pt_c.tab pt_c.y head.cc gccptgen.a
make[1]: Leaving directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/gcc'
make -C java clean
make[1]: Entering directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/java'
rm -f .o lex.yy.cc pt_j.tab pt_j.y head.cc javaptgen.a
make[1]: Leaving directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/java'
make -C php5 clean
make[1]: Entering directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/php5'
rm -f .o lex.yy.cc pt_zend_language_parser.tab pt_zend_language_parser.y head.cc phpptgen.a
make[1]: Leaving directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/php5'
make -C sol clean
make[1]: Entering directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/sol'
rm -f .o lex.yy.cc pt_solidity. head.cc solidityptgen.a
make[1]: Leaving directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/sol'
make -C gcc
make[1]: Entering directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/gcc'
./mainc.py c.y
bison -d pt_c.y -o pt_c.tab.cc
pt_c.y:2.1-12: warning: deprecated directive: ‘%pure-parser’, use ‘%define api.pure’ [-Wdeprecated]
2 | %pure-parser
| ^~~~~~~~~~~~
| %define api.pure
pt_c.y: warning: 11 shift/reduce conflicts [-Wconflicts-sr]
pt_c.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
pt_c.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
flex -olex.yy.cc c.l
g++ -O3 -I../../include -c -o lex.yy.o lex.yy.cc
g++ -O3 -I../../include -c -o pt_c.tab.o pt_c.tab.cc
pt_c.tab.cc: In function ‘int yyparse()’:
pt_c.tab.cc:12821:20: warning: ISO C++ forbids converting a string constant to ‘char
’ [-Wwrite-strings]
12821 | yyerror (YY_("syntax error"));
| ^~~~~~~~~~~~~~
pt_c.tab.cc:520:22: note: in definition of macro ‘YY_’
520 | # define YY_(Msgid) Msgid
| ^~~~~
pt_c.tab.cc:12932:16: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
12932 | yyerror (YY_("memory exhausted"));
| ^~~~~~~~~~~~~~~~~~
pt_c.tab.cc:520:22: note: in definition of macro ‘YY_’
520 | # define YY_(Msgid) Msgid
| ^~~~~
g++ -O3 -I../../include -c -o head.o head.cc
ar -csrv gccptgen.a lex.yy.o pt_c.tab.o head.o
a - lex.yy.o
a - pt_c.tab.o
a - head.o
make[1]: Leaving directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/gcc'
make -C java
make[1]: Entering directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/java'
./mainj.py j.y
(<_io.TextIOWrapper name='pt_j.y' mode='w' encoding='UTF-8'>, '\n%pure-parser\n\n%{\n#include<ptree.h>\n\nusing namespace std;\n%}\n\n%union{\nTree t;\n}\n\n%{\nvoid yyerror(chars);\nint yylex(YYSTYPE *yylvalp);\n\nTree *root;\n%}\n\n')
bison -d pt_j.y -o pt_j.tab.cc
pt_j.y: warning: 24 shift/reduce conflicts [-Wconflicts-sr]
pt_j.y: warning: 259 reduce/reduce conflicts [-Wconflicts-rr]
pt_j.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
flex -olex.yy.cc j.l
g++ -O3 -I../../include -c -o lex.yy.o lex.yy.cc
In file included from j.l:11:
pt_j.tab.hh:176:8: error: ‘YYSTYPE’ does not name a type; did you mean ‘YYSTATE’?
176 | extern YYSTYPE yylval;
| ^~~~~~~
| YYSTATE
j.l:26:27: error: ‘YYSTYPE’ was not declared in this scope; did you mean ‘YYSTATE’?
26 | #define YY_DECL int yylex(YYSTYPE *yylvalp)
| ^~~~~~~
lex.yy.cc:934:1: note: in expansion of macro ‘YY_DECL’
934 | YY_DECL
| ^~~~~~~
j.l:26:36: error: ‘yylvalp’ was not declared in this scope
26 | #define YY_DECL int yylex(YYSTYPE *yylvalp)
| ^~~~~~~
lex.yy.cc:934:1: note: in expansion of macro ‘YY_DECL’
934 | YY_DECL
| ^~~~~~~
make[1]: *** [: lex.yy.o] Error 1
make[1]: Leaving directory '/home/ayf/deckard/Deckard-rel2.0solidity/src/ptgen/java'
make: *** [Makefile:36: TARGET] Error 2
Error: ptgen make failed. Exit.
Error: ptgen make failed. Deckard build fails.

Is it about the version error of bison and flex? Should I use lower version?

from deckard.

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.