Giter VIP home page Giter VIP logo

Comments (8)

zhangysh1995 avatar zhangysh1995 commented on August 20, 2024

I try to modify the TreeMuataion.cpp but it is incompatible:

TreeMutation.cpp:39:34: error: ‘class SQLiteParser’ has no member named ‘program’
   tree::ParseTree* tree = parser.program();
                                  ^~~~~~~
TreeMutation.cpp:47:33: error: ‘class SQLiteBaseVisitor’ has no member named ‘intervals’
    int interval_size = visitor->intervals.size();
                                 ^~~~~~~~~
TreeMutation.cpp:49:56: error: ‘class SQLiteBaseVisitor’ has no member named ‘intervals’
     if(find(intervals.begin(),intervals.end(),visitor->intervals[i])!=intervals.end()){
                                                        ^~~~~~~~~
TreeMutation.cpp:50:23: error: ‘class SQLiteBaseVisitor’ has no member named ‘intervals’
     }else if(visitor->intervals[i].a<=visitor->intervals[i].b){
                       ^~~~~~~~~
TreeMutation.cpp:50:48: error: ‘class SQLiteBaseVisitor’ has no member named ‘intervals’
     }else if(visitor->intervals[i].a<=visitor->intervals[i].b){
                                                ^~~~~~~~~
TreeMutation.cpp:51:35: error: ‘class SQLiteBaseVisitor’ has no member named ‘intervals’
      intervals.push_back(visitor->intervals[i]);
                                   ^~~~~~~~~
TreeMutation.cpp:54:30: error: ‘class SQLiteBaseVisitor’ has no member named ‘texts’
    int texts_size = visitor->texts.size();
                              ^~~~~
TreeMutation.cpp:56:48: error: ‘class SQLiteBaseVisitor’ has no member named ‘texts’
     if(find(texts.begin(),texts.end(),visitor->texts[i])!=texts.end()){
                                                ^~~~~
TreeMutation.cpp:57:23: error: ‘class SQLiteBaseVisitor’ has no member named ‘texts’
     }else if(visitor->texts[i].length()>MAXTEXT){
                       ^~~~~
TreeMutation.cpp:59:31: error: ‘class SQLiteBaseVisitor’ has no member named ‘texts’
      texts.push_back(visitor->texts[i]);
                               ^~~~~
TreeMutation.cpp:74:38: error: ‘class SQLiteParser’ has no member named ‘program’
     tree::ParseTree* treeS = parserS.program();
                                      ^~~~~~~
TreeMutation.cpp:79:6: error: ‘SQLiteSecondVisitor’ was not declared in this scope
      SQLiteSecondVisitor *visitorS=new SQLiteSecondVisitor();
      ^~~~~~~~~~~~~~~~~~~
TreeMutation.cpp:79:6: note: suggested alternative: ‘SQLiteBaseVisitor’
      SQLiteSecondVisitor *visitorS=new SQLiteSecondVisitor();
      ^~~~~~~~~~~~~~~~~~~
      SQLiteBaseVisitor
TreeMutation.cpp:79:27: error: ‘visitorS’ was not declared in this scope
      SQLiteSecondVisitor *visitorS=new SQLiteSecondVisitor();
                           ^~~~~~~~
TreeMutation.cpp:79:27: note: suggested alternative: ‘visitor’
      SQLiteSecondVisitor *visitorS=new SQLiteSecondVisitor();
                           ^~~~~~~~
                           visitor
TreeMutation.cpp:79:40: error: expected type-specifier before ‘SQLiteSecondVisitor’
      SQLiteSecondVisitor *visitorS=new SQLiteSecondVisitor();
                                        ^~~~~~~~~~~~~~~~~~~
TreeMutation.cpp:89:30: error: type ‘<type error>’ argument given to ‘delete’, expected pointer
                       delete visitorS;
                             ^~~~~~~~

Could I know the exact version of ANTLR used in this project?

from superion.

zhunki avatar zhunki commented on August 20, 2024

from superion.

zhangysh1995 avatar zhangysh1995 commented on August 20, 2024

So how could I change the file?

from superion.

zhangysh1995 avatar zhangysh1995 commented on August 20, 2024

I exaplained all my steps in this issue and try to fix the problem. I believe I understand what I am doing.

from superion.

StarGazerM avatar StarGazerM commented on August 20, 2024

My guess is TreeMutator your own mutator.... you need to implement how to to mutate by yourself. And antlr only make a base parser for you, also a parser need to be provided.

from superion.

peng-hui avatar peng-hui commented on August 20, 2024

ANTLR only generates empty BaseVisitor. The authors modified the BaseVisitor to intercept certain intermediate values. Besides, the authors also generate their own SecondVisitor, which is slightly different from BaseVisitor. The TreeMutation.cpp also requires some minor adaption for different grammars.

Unfortunately, the authors did not disclose any such details. I think I have figured it out and wrote some instructions for this. Please check my fork for details if you are still interested: https://github.com/peng-hui/Superion

from superion.

zhunki avatar zhunki commented on August 20, 2024

from superion.

peng-hui avatar peng-hui commented on August 20, 2024

there is a python script under the corresponding folder, which can do the job for you.

Hmmm, do you mean my fork or your own repository? Actually, I don't find such a python script in your code. I would appreciate it if you can add more detailed instructions in your README file to guide other users on how to generate the SecondVisitor and TreeMutation step by step.

from superion.

Related Issues (19)

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.