Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <set>
- #include <stdio.h>
- #include <string.h>
- #include <iostream>
- #include <vector>
- #include <stack>
- #include <set>
- //#include "Grammar.cpp"
- using namespace std;
- class Grammar{
- public:
- virtual string getType() =0;
- virtual string getName () =0;
- };
- class Terminal :public Grammar{
- private:
- string name;
- string type;
- public:
- Terminal(string namee){
- name = namee;
- type = "terminal";
- }
- string getName(){
- return name;
- }
- string getType(){
- return type;
- }
- };
- class NonTerminal :public Grammar{
- private:
- string name;
- string type;
- public:
- NonTerminal(string namee){
- name = name;
- type = "non-terminal";
- }
- string getName(){
- return "non-terminal";
- }
- string getType(){
- return type;
- }
- set<Terminal> first;
- set<Terminal> follow;
- };
- int main(){
- cout<<" jhsajdsa "<<endl;
- Grammar* g;
- Terminal t("t");
- g = &t;
- cout<< g->getName();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement