reignofwebber / vscode-c-cpp-definition-generator

MIT License
30 stars 8 forks source link

Does not work for derived classes #8

Open Mirko-von-Leipzig opened 4 years ago

Mirko-von-Leipzig commented 4 years ago

The following fails with grammar error

class B {};

class A : public B
{
    void AAA();
};
geneReeves commented 4 years ago

I have same issue

geneReeves commented 4 years ago

solved: problem was i wrote class like this: class subclass ;public parentclass { } THAT FAILED, but below works, notice opening bracket. class subclass :public parentclass { }

barraganlazlo commented 4 years ago

same problem puting { on the same line fix it

slatbox commented 4 years ago

there are reduant prefixs on class methosd: my code is : template class Graph { public: static int maxSize = 100; private: int _Size = 0; T * _vertexList = nullptr; int *_edgeMatrix = nullptr; public: Graph(int size,TvertexList = nullptr,int **degeMatrix = nullptr); int getPosOfVertex(T vertex); int getWeightOfEdge(T vertex1,T vertex2); int getFirstNeighbor(T vertex); int getNextNeighbor(T vertex,T afterVertex); bool insertVertex(const T vertex); bool insertEdge(T vertex1,T vertex2,int cost); bool removeVertex(T vertex); bool removeEdge(T vertex1,T vertex2); ~Graph(); };

and the generated code is:

include "Graph.h"

template

Graph::Graph::Graph(int size, T*vertexList, int **degeMatrix) {

}

int Graph::Graph::getPosOfVertex(T vertex) {

}

int Graph::Graph::getWeightOfEdge(T vertex1, T vertex2) {

}

int Graph::Graph::getFirstNeighbor(T vertex) {

}

int Graph::Graph::getNextNeighbor(T vertex, T afterVertex) {

}

bool Graph::Graph::insertVertex(const T vertex) {

}

reduant Graph::